Commit Graph
681 Commits
Author SHA1 Message Date
Manuel Raynaud d7eccd766f (backend) add an allowed file extension list
We want to limit what type of file can be uploaded. For this we use an
allowed list of file extension. This allowed list can be disabled using
a setting and this list is configurable using a setting. When enabled,
file with no extension and hidden file are also rejected.
2026-01-09 10:43:53 +01:00
Nathan Vasse 1c1d9233e7 (front) add download and preview events
We need to provide more tracking events on posthog.

Closes #491
2026-01-07 17:57:31 +01:00
Nathan Vasse 5de5e6d354 🌐(front) set html lang attribute on language change
Currently the html lang attribute is always set to `en`, we want to update it
when application language is changed.
2026-01-07 16:11:05 +01:00
Samuel Paccoud - DINUMandManuel Raynaud c9bfdb9fcb ️(backend) avoid N+1 queries to compute link reach/role on chidren view
The link reach/role on an item is derived from its ancestors. Pre-computing
values for each item allows passing them in a mapping that avoids repeated
queries when computing each item's abilities.
2026-01-07 11:25:26 +01:00
Samuel Paccoud - DINUMandManuel Raynaud a42e802f8f ️(backend) avoid N+1 queries to compute nb_accesses on children list
We can calculate a child's number of accesses by adding the count for its
parent item and adding the count directly attached to it. This addition
can be done in the same list query via an annotation so we don't generate
N+1 queries (N equals 200 by default on the children view).
2026-01-07 11:23:47 +01:00
Samuel Paccoud - DINUMandManuel Raynaud 5a6d4c1b27 ️(backend) avoid N+1 queries to include creator details in item object
The item creator is serialized on each item. Not pre-selecting it
generates N+1 queries (N equals 200 by default on the children view!)
2026-01-07 11:23:08 +01:00
Nathan VasseandManuel Raynaud 7cd4c9d64c ♻️(front) remove mimetype check for calc mime category
Some calc files have application/octet-stream mime type sometimes, like
the .numbers file for instance. So checking the mimetype does not make
that much sense.
2026-01-07 10:05:55 +01:00
Manuel Raynaud a382b5316e ♻️(backend) improve mimetype detection
The mimetype detection were sometimes not accurate and return a wrong
indication. For example pptx files were identified as an archive because
they are zip files. This version relies on the file extension is the
gussed mimtype is not relevant.
Guessing mimetype from file few bytes is called magic bytes
https://en.wikipedia.org/wiki/List_of_file_signatures
2026-01-07 10:05:55 +01:00
Manuel Raynaud 691599af70 🐛(backend) stop renaming file when no title is provided
In the ItemViewset::perfom_update method, we trigger the rename_file
task when the title of the item has changed. On a PATCH request, the
title can be absent in the payload leading to renaming the file with a
None value. We have to chank first of the title is present in the
validated_data and also check first in the renamin task if the provided
value is not empty or None.
Fix # 477
2026-01-05 13:53:17 +01:00
Stanislas Bruhiere a11829e6f7 🐛(docker-hub) fix mistake in docker user
Remove :-1000 after docker user in github workflows
2025-12-31 10:39:36 +01:00
Nathan Vasse 9f28cc61ac (back) add /users route to external api custom
We need to allow configuration of /users sub route via
the EXTERNAL_API configuration.
2025-12-18 16:13:07 +01:00
Nathan Vasse 9b77641141 🐛(back) fix external api access and invitation object routes
Before those route were using the item permission, causing such
error: AttributeError: 'ItemAccess' object has no
attribute 'ancestors_deleted_at'.
Update to use the appropriate permission.
2025-12-18 16:06:07 +01:00
Sylvain ZimmerandNathan Vasse 971433ff75 🐛(email) avoid trying to send emails if no provider is configured
We want to allow instance to not setup email sending without causing
crashes. Also add the envvar to the test setup so that the existing
tests that were running without DJANGO_EMAIL_HOST to None still
work.
2025-12-18 14:36:30 +01:00
Fabre FlorianandQuentin BEY 03124f4bf1 (backend) add indexed search feature flag
Add setting FEATURES_INDEXED_SEARCH that allows to disable the
search of indexed files while using the indexation tools.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY 8c232f85d6 🩹(backend) fix weak random choice
Use secrets.choice instead of random.choice to select user in create_demo
command.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY a4307907e1 (backend) refactor indexer service
Replace "drive" by a SERVICE_NAME constant.
Merge search() & search_query() methods.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY 0d5631cf9c (backend) Fix access token storage issues
When indexer service is not configured, the search view should work
event with a disabled OIDC_STORE_ACCESS_TOKEN.
Disable token storage for the unit tests.
Add bin/fernetkey that generates a key for the OIDC_STORE_REFRESH_TOKEN_KEY
setting.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY 5492a68a99 (backend) enable limit for the indexed content
Use SEARCH_INDEXER_CONTENT_MAX_SIZE as limit (in bytes) for the file content.
Fix default configuration of OIDC_STORE_ACCESS_TOKEN

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY 833492d5e2 (backend) Fix trashbin & mimetype issues
In Drive the search should find files in the trashbin for a limited amount
of time. So the soft-delete cannot disable a indexed entry
Be more strict on mimetype patterns.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY 63cfe37695 (backend) adapt to Find new search pagination & fixes
Use nb_results instead of page/page_size argument for /search API.
Add --batch-size argument to the index command.
Fix an issue in SearchIndexer.has_text when item.mimetype is empty.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY 5f50aeaa16 (backend) keep ordering from fulltext search in results
Keep ordering by score from Find API on search/ results when the
fulltext search is enabled.
Refactor pagination to work with a list instead of a queryset
Fix Changelog

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY cad05aa4ff 🔧(compose) disable indexer in default configuration
Set SEARCH_INDEXER_CLASS=None as default configuration for dev.
Add documentation for Find service setup.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY 4fe5c335dd (backend) use batches in indexing task
Reduce the number of Find API calls by grouping all the latest changes
for indexation : send all the items updated or deleted since the
triggering of the task.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY e9d67319a4 (backend) implement fulltext search in existing search view
When the file indexer is enabled (SEARCH_INDEXER_* settings are set) use it
in place of the title filtering.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY e9d2e2baad (backend) indexation tasks with throttle mechanism
Add a celery task that send an item changes to the Find API
A simple flag is set in cache for an amount of time that block any other task
creation and do the throttle.
The SEARCH_INDEXER_COUNTDOWN setting gives the number of seconds between tasks

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY eb4b511569 (backend) add indexer service
Add SearchIndexer service that handles indexation & search API calls to Find
Add SEARCH_INDEXER_* settings to configure it.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY 415e83f344 (backend) add demo populate command
Add a new Django app 'demo' that contains the command 'create_demo'
Generate dummy users and files with existing factories.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Fabre FlorianandQuentin BEY 3ce28275df 🔧(compose) configure external network for communication with search
Search in Drive relies on an external project like "La Suite Find".
We need to declare a common external network in order to connect to
the search app and index our documents.

Signed-off-by: Fabre Florian <ffabre@hybird.org>
2025-12-16 22:50:25 +01:00
Nathan Vasse 9a86a5f46f (backend) enable full customization of external api
We have some instances that requires more open resource server features.
This change adds a setting that allows to cherry-pick
which api routes needs to be available or not.
2025-12-15 13:46:59 +01:00
renovate[bot]andGitHub d3bd11b69e ⬆️(dependencies) update next to v15.4.9 [SECURITY] 2025-12-12 03:46:27 +00:00
Nathan Panchout 5dea2d2ffe (frontend) enhance LeftPanelMobile layout and Gaufre visibility
- Updated LeftPanelMobile component to wrap Gaufre and UserProfile in a
new container for improved layout.
- Added styles for the new container to position it at the bottom of the
panel.
- Modified Gaufre component to conditionally render based on user
authentication status.
2025-12-11 10:35:54 +01:00
Nathan Panchout 8096ed4781 ⬆️(dependencies) update ui-kit and add yarn engine requirement
- Updated the @gouvfr-lasuite/ui-kit dependency to version 0.18.4 in
package.json and yarn.lock.
- Added yarn engine requirement to package.json for consistency across
environments.
2025-12-11 10:35:54 +01:00
renovate[bot]andGitHub 5017bb0bad ⬆️(dependencies) update python dependencies 2025-12-10 08:09:43 +00:00
Manuel Raynaud 6f617f6251 ⬆️(backend) ugrade urllib3 to version 2.6.1
Fix 2 CVE

https://nvd.nist.gov/vuln/detail/CVE-2025-66471
https://nvd.nist.gov/vuln/detail/CVE-2025-66418
2025-12-08 21:53:29 +01:00
Nathan Panchout 1489eb6ed1 (frontend) enhance layout and user profile components
- Updated ExplorerTree styles to use flexbox for better layout
management.
- Refactored Header component to integrate new UserProfile and Gaufre
components.
- Simplified LeftPanelMobile by removing unnecessary components and
adding UserProfile.
- Introduced Gaufre and UserProfile components for improved user
experience and language selection.
- Enhanced LanguagePicker functionality to support user-specific
language settings.
2025-12-05 17:04:17 +01:00
Nathan Panchout f5a04cd8e5 (frontend) add gaufre theme configuration and components
- Introduced a new gaufre theme with widget paths and API URLs.
- Updated the getComponents function to include gaufre theme components.
- Enhanced styles to support the new gaufre theme in cunningham-tokens.
- Added console logs for debugging theme configurations.
2025-12-05 17:04:17 +01:00
Nathan Panchout 41cc92d35c ⬆️(dependencies) upgrade @gouvfr-lasuite/ui-kit to version 0.18.3
Updated the package version in both yarn.lock and package.json to
enhance functionality and ensure compatibility with the latest features.
2025-12-05 17:04:17 +01:00
Manuel Raynaud bafa9b3fe1 🔖(patch) bump release version 0.10.1
Security

- ⬆️(dependencies) update next to v15.4.8
v0.10.1
2025-12-05 14:59:20 +01:00
renovate[bot]andGitHub 16dfda9392 ⬆️(dependencies) update next to v15.4.8 [SECURITY] 2025-12-05 13:38:16 +00:00
Manuel Raynaud bfd9e9573b 🔖(minor) bump release version 0.10.0
Added

- (backend) add more info on the item detail in the admin
- (backend) add an admin action to trigger new file analysis
- (backend) add a command to update file_hash in malware_detection_info

Fixed

- 🐛(front) fix responsive item row
- 🐛(front) fix responsive tree
v0.10.0-preprod v0.10.0
2025-12-04 18:46:38 +01:00
Manuel Raynaud 1a8b44aa3f 🔧(docker) force pip upgrade to avoid security issues
We have migrated to uv but pip is still installed in the python docker
image. We must upgrade it to avoid having an outdated version of it with
security issues.
2025-12-04 18:46:38 +01:00
Manuel Raynaud cc27b07636 ⬆️(backend) upgrade django-lasuite to version 0.0.21
https://github.com/suitenumerique/django-lasuite/releases/tag/v0.0.21
2025-12-04 16:20:54 +01:00
Manuel Raynaud 063a556bbf (backend) add a command to update file_hash in malware_detection_info
We want to update existing item in suspicious upload_state and to the
malware_detection_info the file hash. This is an info we need to track
suspicious files.
2025-12-04 16:20:53 +01:00
Nathan Panchout 2e9662f81d 🐛(frontend) fix responsive tree and grid view
Refactored the AppExplorerBreadcrumbs component to utilize a breadcrumb
query for improved navigation. Added mobile-specific breadcrumbs and
integrated workspace icons. Introduced new pages for public and shared
items, leveraging the useInfiniteItems hook for pagination. Updated
styles for better responsiveness in the explorer interface.
2025-12-04 15:48:46 +01:00
Nathan Panchout 389b8ce3fa (frontend) add useInfiniteItems hook for paginated item retrieval
Introduced a new custom hook, useInfiniteItems, leveraging react-query
to handle infinite scrolling and pagination for items based on specified
filters. This hook simplifies the process of fetching and managing
paginated data in the frontend application.
2025-12-04 10:55:23 +01:00
renovate[bot]andGitHub cf63c78e5d ⬆️(dependencies) update django to v5.2.9 [SECURITY] 2025-12-03 17:03:16 +00:00
Manuel Raynaud 0fe83d298f (backend) add an admin action to trigger new file analysis
We added an action in the item list allowing to trigger new malware
analysis from the beginning. This can be usefull if an analysis has
failed with a 500 or an unknow error.
2025-12-02 17:56:52 +01:00
Manuel Raynaud c8c61dc8cc (backend) add more info on the item detail in the admin
We need more info on the item admin detail view. We added the file size,
why the file is rejected if suspicious but also filter on user emails.
2025-12-02 15:10:19 +01:00
Manuel Raynaud 6904e2162d 🔖(minor) bump release version 0.9.0
Added

- (back) add storage compute backends
- (back) add claims to user
- (back) add usage metrics route
- (global) add entitlements
- (back) add anct entitlement backend
- (back) enhance items django admin

Changed

- 🏗️(core) migrate from pip to uv

Fixed

- 🐛(backend) manage file renaming when filename has not changed
- 🐛(backend) managed empty uploaded files
- 🐛(backend) do not allow renaming a file while not ready
v0.9.0
2025-12-02 11:36:33 +01:00
Nathan Vasse 8150a53c46 (back) enhance items django admin
We lack information on the item admin. Let's add some fields to
allow filtering, and also display facets. Also added ability
to update the upload_state in case we need to do some debugging.
2025-12-02 10:00:58 +01:00