Commit Graph

647 Commits

Author SHA1 Message Date
Dionisio Pozo 37ffa85ab7 Merge pull request #290 from subhranil2605/fix/windows-crlf-entrypoint 2026-04-13 19:32:41 +02:00
Subhranil Sarkar 96e9087f41 fix: resolve CRLF line ending issue for Windows users
Windows Git converts LF to CRLF by default, causing entrypoint.sh
to fail inside Alpine Linux containers with 'no such file or directory'.

Changes:
- Dockerfile: added sed to strip carriage returns from entrypoint.sh
- .gitattributes: enforce LF line endings for all shell scripts

Fixes #289
2026-04-13 21:49:08 +05:30
Dionisio Pozo 65c8fc7f5e Merge pull request #288 from EdouardVanbelle/fix/frontend-search-view 2026-04-13 14:42:24 +02:00
Dionisio Pozo f74cf4d9b5 Merge pull request #287 from EdouardVanbelle/fix/frontend-shared-view 2026-04-13 14:41:48 +02:00
Dionisio Pozo 024cdc610a Merge pull request #286 from EdouardVanbelle/refactor/dark-theme 2026-04-13 14:29:14 +02:00
Edouard Vanbelle 2733542bce refactor(css): dark theme: remove and merge specific cases 2026-04-13 13:26:38 +02:00
Edouard Vanbelle e6a815a03c refactor(css): dark theme: merge photos 2026-04-13 13:26:38 +02:00
Edouard Vanbelle f7c7136149 refactor(css): dark theme: merge notfication + dropzone 2026-04-13 13:26:38 +02:00
Edouard Vanbelle 260eb4d4c8 refactor(css): merge context menu for dark theme 2026-04-13 13:26:38 +02:00
Edouard Vanbelle 4dff552299 refactor(css): use 1 global declaration for scrollbar 2026-04-13 13:26:38 +02:00
Edouard Vanbelle ce207ebad1 refactor(css): merge profile + admin dark style 2026-04-13 13:26:38 +02:00
Edouard Vanbelle 413832d1a2 refactor(css): remove use generic colors for language-selector + correct item selection color 2026-04-13 13:26:38 +02:00
Edouard Vanbelle 26ce794090 fix(SharedSection): hide files list header, shared view has it's own view 2026-04-13 13:25:48 +02:00
Edouard Vanbelle 28963965a1 fix(searchResult): move search result into sticky header 2026-04-13 13:24:58 +02:00
Dionisio Pozo 9e632e147a Merge pull request #284 from su77ungr/main 2026-04-13 04:17:14 +02:00
su77ungr 1b14475d05 add WWW-Authenticate handshake for spec-compliancy 2026-04-13 02:12:17 +02:00
Dionisio Pozo 9e3e766646 Update README with OxiCloud vs NextCloud comparison 2026-04-12 20:59:45 +02:00
Dionisio Pozo dcea5040d0 Merge pull request #283 from EdouardVanbelle/refactor/css-regroupement 2026-04-12 09:53:27 +02:00
Edouard Vanbelle 54c736a8b1 refactor(css): removed unnecessary dark theme override 2026-04-12 02:58:24 +02:00
Edouard Vanbelle 4862c17e11 refactor(css): change css grouping fileType & filesView
- fileType.css for filetype to icons representation
 - filesViews.css for grid and list view (merge of previous cards.css & fileList.css)
2026-04-12 02:53:35 +02:00
Edouard Vanbelle b95cf8dee9 refactor(css/icons): centralize icon folder to card.css 2026-04-12 02:22:57 +02:00
Diocrafts 1dbe7e4553 fix: resolve all biome ci errors and warnings
- Format all 14 locale JSON files (2-space → 4-space indent per biome config)
- Fix publicShare.js: arrow functions, template literals, optional chaining,
  remove redundant 'use strict', remove unused formatSize function
- Fix music.js: template literal, unused _trackId parameter
- Fix contextMenus.js, fileOperations.js, fileSharing.js: unused parameters
- Fix auth.js, music.css, share-public.css: formatting (biome format --write)
- Remove unused biome-ignore suppression comments in cards.css and reset.css
- Remove empty .share-state block in share-public.css
- Disable noDescendingSpecificity and noImportantStyles rules in biome.json
  (intentional CSS patterns for utility classes and theme overrides)
2026-04-12 02:13:08 +02:00
Diocrafts 1efcdb58a5 quick fix 2026-04-12 02:03:19 +02:00
Diocrafts 37975afb39 fix(i18n): sync all 14 locale files to 575 keys each
- Move 38 misplaced root-level shared_* keys into shared.shared_* in
  de, es, fr, pt (values preserved, just re-nested correctly)
- Add 17 missing music.* keys to all non-en languages (en fallback)
- Add missing dialogs.*, actions.*, shared.*, notifications.* keys to
  fa (33), zh (71), de (20), fr (22), it (22), nl (20), pt (22)
- Sync language_selector.languages across all 14 locales (was missing
  ar, hi, it, ja, ko, nl, ru in most files)

All 14 languages now have exactly 575 keys matching en.json.
2026-04-12 02:02:21 +02:00
Diocrafts edf1e66989 feat: add public share page with download support (#253)
Share links now point to /s/{token} (was /api/s/{token}) and render a
proper HTML page instead of raw JSON.

Changes:
- static/share.html: standalone public share page
- static/css/views/share-public.css: share page styles
- static/js/views/public/publicShare.js: client-side logic that fetches
  share metadata via /api/s/{token}, handles password-protected shares,
  and renders file download / folder info
- build.rs: include share.html in the HTML embed pipeline
- web/mod.rs: serve /s/{token} route (unauthenticated)
- share_dto.rs: generate URLs as /s/{token} instead of /api/s/{token}
- share_handler.rs: new download_shared_file() handler that validates the
  share token and streams file content without requiring authentication
- routes.rs: mount GET /api/s/{token}/download (public, uses AppState)
2026-04-12 01:51:30 +02:00
Diocrafts c512534bfa fix: session_expired after login on HTTP deployments (#241)
Three changes to fix the immediate-logout issue reported by multiple
Docker users:

1. Add explicit `credentials: 'same-origin'` to the login fetch call.
   This was the only fetch in the entire codebase missing it. While
   modern browsers default to 'same-origin', some privacy configs or
   older engines may default to 'omit', silently dropping Set-Cookie
   headers from the login response.

2. Post-login cookie verification: after a successful login, the
   frontend now checks that the CSRF cookie (non-HttpOnly, readable
   by JS) was actually stored before redirecting. If the browser
   rejected the cookies, a clear error message is shown explaining
   the OXICLOUD_COOKIE_SECURE / HTTP mismatch.

3. Server-side diagnostic: the login handler now warns in logs when
   Secure cookies are set on a request that didn't arrive via HTTPS
   (no X-Forwarded-Proto: https header), pointing admins to the
   OXICLOUD_COOKIE_SECURE=false fix.

Root cause: users who set OXICLOUD_BASE_URL=https://... (or have
OXICLOUD_COOKIE_SECURE=true) but access via plain HTTP get cookies
with the Secure flag, which browsers silently reject over HTTP.
2026-04-12 01:38:19 +02:00
Diocrafts 5be035a172 fix: restore ext-thumbnail disk lookup in get_cached_thumbnail
After the blob_hash dedup change, get_cached_thumbnail with
blob_hash=None (cache-first fast path) only checked moka. External
video thumbnails stored as ext-{file_id}.jpg on disk were not found
after a server restart when moka is empty.

Now checks ext-{file_id}.jpg on disk before falling through to the
blob-hash disk lookup, so video thumbnails survive restarts.
2026-04-12 00:56:58 +02:00
Diocrafts 2dde4da5cf feat: thumbnail dedup — store thumbnails by blob_hash instead of file_id (#233)
Thumbnails are now keyed by blob_hash on disk so identical files share
a single set of thumbnails (icon/preview/large). For 4000 duplicate
files with the same content, this reduces thumbnail storage from 12,000
files to just 3.

Changes:
- get_thumbnail_path() keys by blob_hash instead of file_id
- get_thumbnail(), get_cached_thumbnail(), generate_all_sizes_background()
  accept blob_hash parameter for disk dedup
- generate_all_sizes_background() fast path: if blob-hash thumbnails
  already exist on disk, skip image processing entirely and just
  populate moka cache for the new file_id
- delete_thumbnails() only invalidates moka cache (shared disk
  thumbnails must not be deleted when one file is removed)
- delete_blob_thumbnails() added for GC; garbage_collect() now cleans
  up orphaned thumbnail files alongside blob files
- External thumbnails (video frames) stored as ext-{file_id}.jpg
  since they are client-generated and not dedup-able
- ThumbnailPort trait updated with blob_hash parameters
- All handler call sites updated (file_handler, preview_handler)
- Tests updated for new signatures
2026-04-12 00:50:10 +02:00
Diocrafts e91dcee0ea fix: scale folder upload timeout by file size (fixes #249)
The folder upload path (uploadFolderEntries) used a flat 10s fetch
timeout for all files regardless of size. Large files like .CR2 RAW
images (~25MB) on slower networks (e.g. Raspberry Pi) exceeded this
timeout, causing the AbortController to kill the request before the
server received the full body — hence no server logs and 'unknown
error' on the frontend.

Changed to size-scaled timeout: 30s base + 2s per MB (min 10s).
A 25MB CR2 now gets ~80s instead of 10s.
2026-04-12 00:29:34 +02:00
Dionisio Pozo eab1143324 Merge pull request #282 from mboutolleau/fix/postgresql-data-location 2026-04-11 21:54:37 +02:00
Mathieu Boutolleau 3e23d9541b Change PostgreSQL data directory to /var/lib/postgresql/
Starting with PostgreSQL 18, the data directory (PGDATA)
of the Docker Image has changed to be version specific.
For PostgreSQL 18 it is /var/lib/postgresql/18/docker/.

This means that to persist data, mounts and volumes
should target the new location: /var/lib/postgresql/.

Fixes DioCrafts/OxiCloud#281
2026-04-11 21:39:11 +02:00
Diocrafts f08cffc0e8 feat: add VitePress docs site, music file picker modal, Dockerfile optimization, i18n keys for 14 locales
- Add docs/ with VitePress site (19 pages): guide, config, architecture, FAQ
- Add GitHub Actions workflow for auto-deploy to GitHub Pages
- Replace music 'Add Tracks' upload picker with in-app audio file browser modal
- Add music picker CSS styles with dark theme support
- Add missing i18n keys (search_audio, no_audio_files, etc.) to all 14 locales
- Optimize Dockerfile: shared base stage, COPY --chmod, consolidated RUN, HEALTHCHECK
- Improve README: docs links, updated stats (222+ tests, 14 languages), feature status
2026-04-11 20:58:34 +02:00
Dionisio Pozo 1bb65e6448 Merge pull request #275 from EdouardVanbelle/refactor/css-variables
refactor(css): maximize usage of variables (1st part)
2026-04-11 20:49:52 +02:00
Edouard Vanbelle 8d6964a0ff POC: use FontAwesome / svg on card view to simplify code 2026-04-11 20:24:43 +02:00
Diocrafts 78fcf5f08f perf: move audio metadata I/O to spawn_blocking + stream reextract_all
- Move all sync I/O (id3::Tag, mp3_duration) into spawn_blocking via
  extract_metadata_blocking() to avoid stalling Tokio worker threads
- Replace fetch_all with streaming .fetch() in reextract_all_audio_metadata
  for O(1) memory usage regardless of audio file count
- Consolidate get_duration_secs into extract_metadata_blocking, eliminating
  redundant file open (tag was read twice before)
2026-04-11 19:36:34 +02:00
Diocrafts 63bcd0ffe7 perf: non-blocking hash + parallel thumbnail generation
- Replace blocking blake3::hash() with DedupService::hash_file() in
  file_upload_service (create_file, update_file). Uses spawn_blocking +
  mmap_rayon instead of blocking the Tokio async worker.
- Parallelize thumbnail resize+encode with rayon par_iter() for the 3
  sizes (Icon, Preview, Large) inside spawn_blocking.
2026-04-11 19:13:48 +02:00
Dionisio Pozo 3dc4e6a68b Merge pull request #280 from EdouardVanbelle/style/apply-biome-formatter-linter-recos
style(js/css): apply biome formatter & linter recos
2026-04-11 19:06:43 +02:00
Edouard Vanbelle 5f87dbf612 fix(device-verify): includes main.css + rename class to avoid collision 2026-04-11 18:58:38 +02:00
Edouard Vanbelle 3ab219f77d refactor(css): reduce css icons 2026-04-11 18:39:03 +02:00
Edouard Vanbelle 49c3406e4b refacor(css): reduce dependency of theme=dark 2026-04-11 18:39:03 +02:00
Edouard Vanbelle 56a067ee96 refactor(css): apply biome format on css 2026-04-11 18:39:03 +02:00
Edouard Vanbelle 94b36e41e0 refactor(css): maximize usage of variables (1st part, to simplify CSS & style)
note: there is still work to do, but has there are risks to conflict I prefer to commit this first part now
2026-04-11 18:39:03 +02:00
Edouard Vanbelle 13aa90cf3c style(js): correct linter main warnings 2026-04-11 18:27:54 +02:00
Edouard Vanbelle c7eeb734d7 style(css+js): apply biome formatter 2026-04-11 18:20:43 +02:00
Dionisio Pozo 904aca5edf Merge pull request #279 from EdouardVanbelle/fix/file-list-display 2026-04-11 18:19:07 +02:00
Diocrafts a2aece0752 perf: scale thumbnail decode semaphore with available CPUs
Replace hardcoded DEFAULT_MAX_CONCURRENT_DECODES=4 with adaptive
max_concurrent_decodes() that uses available_parallelism()/2 (min 2).
Matches the pattern already used in image_transcode_service.

Improves thumbnail throughput on 16+ core servers by 2-4x.
2026-04-11 18:14:33 +02:00
Edouard Vanbelle 21a551b836 fix(style): correct file list display (was overlapped by header) 2026-04-11 18:10:50 +02:00
Diocrafts d32a32c30a perf: add TTL/TTI to content cache and invalidate on file mutations 2026-04-11 17:39:17 +02:00
Diocrafts 725f661f72 style: fix cargo fmt formatting in dedup_handler 2026-04-11 16:19:49 +02:00
Diocrafts 81f33458e0 perf: streaming hash-on-write dedup upload, remove dead code 2026-04-11 16:17:47 +02:00