Commit Graph

783 Commits

Author SHA1 Message Date
Edouard Vanbelle 03aac93db3 chore: add /status /ready best practices for Docker & K8S 2026-05-11 00:53:25 +02:00
Edouard Vanbelle 8b08ee165d doc: update example.env and docs/config/env.md 2026-05-10 22:12:55 +02:00
Edouard Vanbelle ad711e18ea feat(contacts): add feature flag to enable/disable exposition of users in address-book 2026-05-10 22:12:11 +02:00
Edouard Vanbelle 7e1484ec2c chore(ui): correct about's github url 2026-05-10 22:08:25 +02:00
Edouard Vanbelle 89ec0d2c24 feat(contacts): add API to address-books, contacts, groups
* full gateway to /carddav
 * add system readonly address-book issued from OxiCloud users
2026-05-10 00:39:25 +02:00
Dionisio Pozo a6eb81a13a Merge pull request #354 from EdouardVanbelle/feat/ui-error-handling 2026-05-09 00:27:48 +02:00
Edouard Vanbelle 7697f3d35b feat(ui): handle errors on folder creation or folder/file renaming
- protect file_management_service::rename_file with validate_storage_name
 - remove specific rename modal and use the generic modal class (less duplicate)
 - handle errors on modal action: do not close the modal on error and display this error
 - hide "Go to parent folder" contextMenu if section is files and folder is the same as current one
2026-05-09 00:06:36 +02:00
Dionisio Pozo c2837eb52d Merge pull request #343 from EdouardVanbelle/e2e-tests 2026-05-08 23:56:02 +02:00
Dionisio Pozo cbddbdc3d5 Merge pull request #320 from EdouardVanbelle/feat/client_ip 2026-05-08 23:55:41 +02:00
Edouard Vanbelle ddf6104749 chore(e2e-test): fix snapshot pixel ratio + try to reuse cargo build to reduce cpu consumption 2026-05-08 21:41:28 +02:00
Edouard Vanbelle 10f43e00a3 ci: retrigger playwright workflow 2026-05-08 21:41:28 +02:00
EdouardVanbelle b550a5def9 test(e2e): update playwright linux snapshots 2026-05-08 21:41:28 +02:00
Edouard Vanbelle 3c3d24ac72 test: initial end to end test with playwright 2026-05-08 21:41:28 +02:00
Dionisio Pozo 52f4a865a9 Merge pull request #349 from EdouardVanbelle/feat/item-path-tool-tip+go-to-parent
show item path on Recent + Favorite, add go to parent folder, fix Folder browsing in Favorites
2026-05-08 01:22:08 +02:00
Dionisio Pozo 71fd84dd9d Merge pull request #350 from EdouardVanbelle/fix/blank-section-on-token-expired
fix(ui): handle any session expired and trigger transparently a refresh token
2026-05-08 01:21:42 +02:00
Dionisio Pozo fec9bb1f96 Merge pull request #351 from EdouardVanbelle/security/refresh-token-rotation
security: prevent re-use of refresh token (reduce surface for any stolen token)
2026-05-08 01:21:27 +02:00
Dionisio Pozo 420eda22fb Merge pull request #353 from EdouardVanbelle/fix/sanity_check_files_and_folder_names
fix(storage names): enure folder and file names are not using reserved chars
2026-05-08 01:21:05 +02:00
Dionisio Pozo 9ed03fada5 Merge pull request #352 from EdouardVanbelle/fix/admin-missing-icons-library
fix(ui): admin panel, profile, etc: restore missing icons library
2026-05-08 01:20:52 +02:00
Edouard Vanbelle 6696ba3ae4 fix(storage names): enure folder and file names are not using reserved chars
- create common function `validate_storage_name()` to check files & folder name
 - replace previous duplicate check with this one
 - better check on create_folder rename_folder (was only checking non empty)
 - use correct error class to ensure 400 on API (was 500)

fix: #345
note: no unit test here, but plan e2e test for that
next: improve UI to display error
2026-05-08 00:26:44 +02:00
Edouard Vanbelle 93d9a21013 fix(ui): admin panel, profile: restore missing icons library 2026-05-07 22:43:02 +02:00
Edouard Vanbelle b90fa6f619 security: prevent re-use of refresh token (reduce surface for any stolen token)
Security: session hardening

  Refresh token rotation with theft detection (family_id)
  - Added family_id column to auth.sessions (migration 20260507000000_session_family.sql) grouping all tokens issued from the same login into a family
  - On refresh, the new session inherits the parent's family_id
  - If a revoked token is replayed (indicates the token was stolen after rotation), the entire family is immediately invalidated and a warning is logged — forcing re-authentication on all devices

  SameSite=Strict on refresh cookie
  - Access cookie stays SameSite=Lax (needed for top-level navigation)
  - Refresh cookie upgraded to SameSite=Strict — it is only ever used for explicit POST to /api/auth/refresh, never via cross-site navigation

  Refresh token TTL: 30 days → 7 days
  - With rotation, active sessions auto-renew and effectively never expire
  - Inactive sessions expire after 7 days instead of 30, reducing the theft window
2026-05-07 13:57:10 +02:00
Edouard Vanbelle a69dde35ce fix(ui): handle any session expired and trigger transparently a refresh token
this change replace original window.fetch by a wrapper that check any 401 response, is so it will request a refresh token
this solve current issue with Favorites & Recent sections that give blank page when token is expired

- exclusion of requests to other domain (401 will not be handled here)
- security with shares /api/s is not handled

- check with CSRF, no risk
2026-05-07 00:55:21 +02:00
Edouard Vanbelle 8e1e9fe201 show item path on Recent + Favorites, add go to parent folder, fix Folder browsing in Favorites 2026-05-06 23:36:05 +02:00
Dionisio Pozo 405721c679 Merge pull request #346 from abnvle/fix/share-password-download 2026-05-05 23:44:36 +02:00
abnvle 8527765bf2 style(share-dialog): give share button breathing room
The Share button moved into .share-options in bdb5a6c sat flush
against the section bottom border. Adds 20px bottom padding plus
margin-top:16px and margin-left:auto on the button so it aligns
right with the Close button below.
2026-05-05 21:57:15 +02:00
abnvle 3bc5c0873b fix(share): password-protected downloads via signed unlock cookie
After successful POST /api/s/{token}/verify, the server issues a
short-lived signed JWT cookie (oxi_share_unlock_<token>; HttpOnly;
SameSite=Lax; 1h TTL). Subsequent /api/s/{token} and
/api/s/{token}/download requests honour the cookie to bypass the
password gate, so password-protected file downloads work end-to-end.

- New module src/infrastructure/services/share_unlock_cookie.rs:
  issue_jwt, verify_jwt, extract_from_cookie_header, build_set_cookie
  + 10 unit tests.
- New ShareService methods issue_unlock_jwt and
  get_shared_link_with_unlock; trait method get_shared_link_by_token
  delegates to a private fetch_share_resolved with an
  allow_password_protected flag.
- access_shared_item, verify_shared_item_password, and
  download_shared_file honour the unlock cookie.

Reuses OXICLOUD_JWT_SECRET, no new env var. Auth-token JWTs and
unlock-cookie JWTs cannot be confused: auth requires
username/email/role/jti claims, unlock has only sub/exp/iat.
Cross-share replay rejected via claims.sub == requested_token check.
2026-05-05 21:56:49 +02:00
Edouard Vanbelle d0c025c316 add X-Request-Id for each req, log all 400 errors 2026-05-05 09:44:25 +02:00
Edouard Vanbelle 8e1a738056 feat(audit): show trace with HTTP's client_ip and user if logged in + add support of trusted proxy via CIDR 2026-05-05 09:44:25 +02:00
Dionisio Pozo e4ea2211ea Merge pull request #329 from EdouardVanbelle/feat/drop-to-sytem 2026-05-04 22:45:19 +02:00
Edouard Vanbelle 0cb641ab20 feat(openapi): add new entry used by drag & drop 2026-05-04 22:41:29 +02:00
Edouard Vanbelle 05037e7491 feat(ui): permit drag&drop to the operating system
a drop outside of the browser will:
  - upload the file if only 1 file selected
  - upload a .zip of the directory or multiple selection (browsers do not permit multiple upload yet)

note: I had to create a new handler because a post request to /api/batch/download is possible via JS but it will create a memory blob in the browser, during the drag action.

This may exhaust the browser's memory if heavy files
This will initiate zip creation from the server even if drop is canceled
The best approach is to add a handler supporting GET calls, this call will be triggered by the browser on drop action outside of it's window
2026-05-04 22:32:31 +02:00
Edouard Vanbelle fbd59a1f38 feat(ui): permit drag&drop to the operating system
a drop outside of the browser will:
  - upload the file if only 1 file selected
  - upload a .zip of the directory or multiple selection (browsers do not permit multiple upload yet)

note: I had to create a new handler because a post request to /api/batch/download is possible via JS but it will create a memory blob in the browser, during the drag action.

This may exhaust the browser's memory if heavy files
This will initiate zip creation from the server even if drop is canceled
The best approach is to add a handler supporting GET calls, this call will be triggered by the browser on drop action outside of it's window
2026-05-04 22:31:20 +02:00
Dionisio Pozo 1cb541dca2 Merge pull request #331 from EdouardVanbelle/feat/full-openapi-coverage 2026-05-04 22:08:33 +02:00
Dionisio Pozo 162c29f283 Merge pull request #338 from EdouardVanbelle/feat/thumbnail-generation-from-client 2026-05-04 22:07:59 +02:00
Edouard Vanbelle e802cdb268 improvement(ui): thumbnail generaiton uses now mime_type (ex: for .ogg containers can be music or video)
- improve also error handling (shows reason of thumbnail generation failure)
2026-05-04 21:16:50 +02:00
Edouard Vanbelle 1d2085457e feath(ui): photo lib now using thumbnail library 2026-05-04 21:08:19 +02:00
Edouard Vanbelle 23336cc2bd fix(ui): correct input-modal, hidden by default 2026-05-04 21:04:15 +02:00
Edouard Vanbelle f6cd18e5e9 feat: generate thumbnail from client is not found on server
- supported thumbnail filetype: image, pdf, video
- add play character if video's thumbnail is loaded
2026-05-04 21:04:15 +02:00
Dionisio Pozo c6b1b14444 Merge pull request #340 from abnvle/feat/polish-translation
add polish (pl) translation
2026-05-04 20:29:13 +02:00
Dionisio Pozo add9faa8c3 Merge pull request #339 from EdouardVanbelle/style/pedantic 2026-05-04 19:30:11 +02:00
Dionisio Pozo ce1ca88fcc Merge pull request #342 from EdouardVanbelle/audit 2026-05-04 19:29:15 +02:00
Dionisio Pozo ff18a2f085 Merge pull request #341 from EdouardVanbelle/style/clippy-warning-fix
style(server): correct clippy warnings
2026-05-04 18:52:01 +02:00
Edouard Vanbelle 0f8eb6d3ab chore: audit: ignore rustls-webpki 0.101.7 issue
# rustls-webpki 0.101.7 — three advisories, all transitive via AWS SDK → rustls 0.21.12.
   # aws-sdk-s3 1.x (latest) has not yet migrated to rustls 0.23.x; no upgrade path available.
   # Severity: low — exploitation requires either a rogue CA or a MitM on AWS S3 infrastructure.
   #   RUSTSEC-2026-0104: DoS via panic in CRL parsing (only if CRLs are processed).
   #   RUSTSEC-2026-0098: URI name constraints ignored (requires CA misissuance).
   #   RUSTSEC-2026-0099: Wildcard name constraint bypass (requires CA misissuance).
   "RUSTSEC-2026-0104",
   "RUSTSEC-2026-0098",
   "RUSTSEC-2026-0099",

   # instant unmaintained — transitive via azure_core 0.21.0 (latest available).
   # No direct security impact; no upgrade path exists.
   "RUSTSEC-2024-0384",
2026-05-04 14:25:45 +02:00
Edouard Vanbelle 46e823ffda chore: move specific CI audit rules into global .cargo/audit.toml 2026-05-04 14:23:01 +02:00
Edouard Vanbelle b6eec61677 chore: update Cargo dependencies to reduce security audit issues 2026-05-04 14:01:00 +02:00
Edouard Vanbelle fde8d9d69f chore: add audit in justfile 2026-05-04 14:01:00 +02:00
Edouard Vanbelle 6e1c435098 style(server): correct clippy warnings 2026-05-04 12:58:30 +02:00
Edouard Vanbelle d0c6bd6a73 feat(openapi): upgrade code to gnerate openapi on all path 2026-05-04 12:02:33 +02:00
abnvle e0a3578ee2 add polish (pl) translation 2026-05-04 00:20:41 +02:00
Edouard Vanbelle 3050556dc0 style(ui): request that all types defined
- check in more restrictive mode = request types
- define main types in static/js/core/types.js
2026-05-03 23:04:27 +02:00