Commit Graph

43 Commits

Author SHA1 Message Date
Edouard Vanbelle 7de83de0a9 chore(ci): wire caldav/carddav test suite 2026-07-15 07:55:31 +02:00
Edouard Vanbelle 7e34045ff8 feat(drive): fix webdav back-compat
add env variable `OXICLOUD_WEBDAV_DRIVE_LISTING_PREFIX`
    which is by default:
    `OXICLOUD_WEBDAV_DRIVE_LISTING_PREFIX="@drive"`

    so `/webdav/` -> points to user's personal drive (**backward compatibilit**y)
    `/web/dav/@drive/{uuid|drive name}/` points to the respective drive

    if admins want directly `/webdav/` pointing to list of drives they need to:
    `OXICLOUD_WEBDAV_DRIVE_LISTING_PREFIX=""`

    + ensure lock is per user (RFC 4918 §9.11)

    fix: #554
2026-07-06 22:14:50 +02:00
Edouard Vanbelle 0a6368e1bf feat(plugins): annotation to allow panic 2026-07-03 02:27:48 +02:00
M.Schmidt f9999cdd0f fix(webdav): RFC 4918 litmus compliance 2026-06-22 21:37:14 +02:00
Edouard Vanbelle ada4b021bf test(oidc): test OIDC login and refresh flow
- ensure Oxicloud s correctly functional with OIDC login
    - refresh token works
    - givenname, familyname, picture are imported in users' informations
    - test relogin (server is not using same path)
    - test email verified
    - test admin group provided from IdP
2026-06-28 23:22:37 +02:00
Edouard Vanbelle 4a99eb2453 chore(ci): make space on CI runners 2026-06-25 00:41:31 +02:00
Bradley Nelson 02335c0680 test(e2e): run the SvelteKit SPA Playwright suite in CI
The e2e CI job ran the legacy `scenarios/*` specs against the vanilla `static/`
frontend that upstream has since removed, so it could never pass. Point CI at
this repo's SvelteKit SPA suite (tests/e2e/spa) and wire up what it needs:

- CI: build the release binary with `--features plugins` (the admin Plugins-tab
  specs exercise the WASM runtime) and run `npm run test:coverage`, building the
  instrumented SPA with COVERAGE=1 VITE_E2E=1 so the server serves the
  data-testid-instrumented build the specs drive.
- Coverage harness: target 127.0.0.1 instead of `localhost` (which resolves to
  ::1 first on CI runners while the server binds IPv4, so readiness never
  connected) and poll `/ready` for webServer readiness; tee start-server-spa.sh
  output to a log surfaced by an always-run CI step for diagnostics.
- Files page: restore a persistent breadcrumb home link (buildCrumbs returns
  only the path folders, so there was no "go home" affordance), and fix the
  `?file=` deep-link race where the viewer→URL effect stripped the param before
  the listing loaded — a bookmarked preview link now opens the viewer.

All 101 spa specs pass locally.
2026-06-22 10:34:47 -06:00
Bradley Nelson e3823ce470 test(e2e): Playwright + Vitest coverage harness and test instrumentation
Add an end-to-end and unit test suite for the SvelteKit frontend:

- Playwright e2e specs (tests/e2e/spa) with a throwaway container stack,
  codegen scenarios, and an Istanbul-based coverage report pipeline.
- Vitest unit tests across API endpoints, components, stores and composables.
- `data-testid` hooks on interactive elements (AppShell, FileViewer,
  ShareDialog, search, photos, files breadcrumbs, login/Nextcloud flows,
  public share pages) so the e2e suite can target them deterministically.
- Serve the SPA app-shell CSP from a <meta> policy (svelte.config.js) plus a
  middleware that skips the CSP header on HTML; move the Nextcloud Login Flow
  v2 grant page to the SvelteKit /nextcloud/login route.
- `just front-codegen` recipe and start-server-spa.sh harness.

Make the test environment robust and consistent:
- Install a deterministic in-memory localStorage/sessionStorage in the Vitest
  setup so storage behaves identically across Node versions (Node 26 ships a
  native Web Storage global that otherwise shadows jsdom's).
- Pin devenv to Node 26 + PostgreSQL 18 and pin every CI job to Node 26.3.0
  so the dev shell and CI run the same toolchain versions.

Repair the API/WebDAV (hurl) suite, which had drifted from the backend:
- Migrate the removed `/api/folders/{id}/listing` endpoint to `/resources`
  (cursor-paginated `{items:[{resource_type,resource}]}` shape) across the
  batch-copy, grants, nested-group, and WebDAV NC tests + the dav_helpers
  wipe routine.
- Stop photos_etag from uploading the dedup-tracked fixture so the dedup
  blob-lifecycle test can own its content-addressed blob exclusively.
- dedup_create now asserts the idempotent same-content re-upload (201 +
  existing file id) instead of the stale 409 expectation.

Generated coverage reports, nyc output and the e2e server runtime data dir
are gitignored rather than committed.
2026-06-22 00:05:06 -06:00
DioCrafts eef0ef5522 chore(frontend): toolchain migration checkpoint + UI perf optimizations
Checkpoint of the in-progress frontend toolchain work (Vite pinned to ^6 after
the 7/8 rolldown build break, eslint-plugin-svelte v3 navigation/reactivity
fixes, CI/Dockerfile/manifest updates) together with three UI performance
optimizations (verified on the Vite 6 build):

- Critical CSS: move auth.css/music.css off the global path into their route
  chunks (login/device/nextcloud-login, music) -- -25% gzipped critical CSS
  (~5.4 KB) on every non-auth/non-music page load.
- relativeTimeAgo: cache the Intl.RelativeTimeFormat (was rebuilt per call, once
  per row per render) -- 22.7x faster date formatting in large lists.
- Virtualize search results and grouped trash (list view) via VirtualList -- DOM
  rows mounted stay ~constant (~27) instead of O(N) (94.6% fewer for 500 hits).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 19:03:07 +02:00
Claude 6023bca2e8 fix(build): render Nextcloud login page via askama, not include_str!(OUT_DIR)
The SvelteKit migration gated build.rs's static-dist/OUT_DIR generation
behind OXICLOUD_RUST_ASSETS=1 (early return), but login_v2_handler.rs
still embedded the page with
`include_str!(concat!(env!("OUT_DIR"), "/nextcloud-login.html"))`. With
OXICLOUD_RUST_ASSETS unset (the default), that file is never written to
OUT_DIR, so a clean `cargo build` failed to compile. (#489)

Migrate the page off include_str! to an askama template
(templates/nextcloud/login.html), mirroring the existing
DrivePickerTemplate in the same handler. This drops the only
compile-time dependency on the legacy build.rs pipeline, so the
OXICLOUD_RUST_ASSETS=1 CI workaround is no longer needed and is removed
from ci.yml, load-smoke.yml and load-nightly.yml.

Also fix the second failure on #489: with OXICLOUD_RUST_ASSETS=1 the
release pipeline panicked in copy_dir_recursive because `static/locales`
is now a symlink to frontend/static/locales. entry.file_type() reports
the link itself (not its target), so the symlinked directory was routed
to fs::copy and failed with "the source path is neither a regular file
nor a symlink to a regular file". Classify entries with fs::metadata,
which follows symlinks, so symlinked directories are traversed.

static/nextcloud-login.html is removed (its content moved into the
template; no other consumer) and dropped from build.rs HTML_INCLUDE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CNCEMN6fC2xSmxqCVbstkd
2026-06-19 17:13:49 +00:00
Edouard Vanbelle ad2187c21b chore(ci): force OXICLOUD_RUST_ASSETS=1 2026-06-19 17:55:59 +02:00
Edouard Vanbelle 14b63c9bd9 chore(ci): use same pg version 18 2026-06-19 16:06:38 +02:00
Claude 047e0f06ff Merge main (Photos/People/Places + ReBAC) into the SvelteKit rewrite
Bring the feature-rich main branch into the frontend Svelte rewrite
(PR #478, base bcn/frontend-svelte-rewrite). main moved well ahead of the
PR's branch point (b8a0018): it added the Places photo-map and People
(faces) backends, photos enhancements, the ReBAC→role-grants migration,
load tests, and more.

Conflicts resolved (4 files):
- Dockerfile: combine the explicit --bin allowlist (defence-in-depth from
  main) with the SPA copy from the frontend build stage (PR).
- .github/workflows/ci.yml: keep the PR's Svelte frontend job
  (svelte-check + eslint + stylelint + prettier + vitest); the legacy
  static/-targeted tsc/locale/icon advisory steps don't fit the new
  working-directory: frontend job and svelte-check supersedes them.
- justfile: keep both the new fe-* / dev recipes (PR) and the load-* k6
  recipes (main).
- static/locales: keep the PR's symlink (-> ../frontend/static/locales);
  main's new photos/people locale keys are folded into the Svelte locale
  files alongside the ported views.

Backend (people/places/faces handlers, routes, DI, migrations) merged
cleanly. `cargo check --bins` passes. The new Places/People UI is not yet
in the Svelte app; that is ported in follow-up commits.
2026-06-19 12:45:22 +00:00
Edouard Vanbelle f095baf26b chore(ci): translation and icons will warn only 2026-06-18 02:46:01 +02:00
Edouard Vanbelle cde19704b3 chore(ci): fix ci.yml 2026-06-18 02:03:42 +02:00
Bradley Nelson daa3010458 init new frontend 2026-06-17 17:06:30 -06:00
Bradley Nelson 803150635c add frontend 2026-06-16 21:26:36 -06:00
Bradley Nelson 87d68c5b6f init plugins 2026-06-16 17:57:57 -06:00
Edouard Vanbelle b1455b5583 chore(wasm): check, clippy, test, CI 2026-06-15 15:53:43 +02:00
Edouard Vanbelle 595273277b test(e2e): webdav + nextcloud full e2e test coverage
add a full coverage of Webdav and Nextcloud
    purpose: prepare move to Drives and ensure no regression at all

    test scenarios are in docs/plan/BASELINE_TESTS_NC_WEBDAV.md

    current existing bugs identified via these tests:

      ┌──────────┬─────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
      │   Bug    │ Surface │                                            Pin location                                            │
      ├──────────┼─────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
      │ G4/G5/K5 │ NC      │ AlreadyExists → 500 instead of 412 (handle_move + trashbin restore)                                │
      ├──────────┼─────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
      │ G9       │ NC      │ Folder DELETE not row-recursive — orphan descendants stay live                                     │
      ├──────────┼─────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
      │ M5/M7    │ Native  │ resolve_path_for_user mismatch — PUT writes, GET reads via lenient lookup, MOVE/DELETE can't find  │
      │          │         │ via strict                                                                                         │
      ├──────────┼─────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
      │ M8       │ Native  │ COPY discards destination filename — collides with source                                          │
      ├──────────┼─────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
      │ N2       │ Native  │ LOCK creates the token, mutators don't check it — class-2 advertisement is aspirational            │
      └──────────┴─────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
2026-06-13 19:01:40 +02:00
Edouard Vanbelle 8b08b081c5 chore(ci): check icons and i18n 2026-06-05 14:18:41 +02:00
Edouard Vanbelle d2dedcbb00 fix(integration-test): ensure integration tests are runned on a separate DB to avoid polution 2026-05-31 23:53:40 +02:00
Edouard Vanbelle e169f53218 test(integration): add integration test on subject group 2026-05-31 22:45:09 +02:00
Edouard Vanbelle 636f0b87bd fix(builder): add OXC semantic to deconflic JS modules using the same global variables/functions
- this solve issues like: Uncaught SyntaxError: Identifier 'GROUP_BY_DEFS' has already been declared (at app.XXXX.js)
    - add a protection on build: test to reload bundled app, on failure exit immediately (prevent the build or a broken bundle)
    - add final check during CI: node --check on the bundle to brevent going to production too if any failure

example of a bundle:

```
warning: oxicloud@0.6.0: bundle: 50 files in dependency order:
warning: oxicloud@0.6.0: bundle: deconflicting 2 name(s): GROUP_BY_DEFS, LOAD_MORE_ID
warning: oxicloud@0.6.0: bundle:   [29] GROUP_BY_DEFS -> GROUP_BY_DEFS_29  (favoritesView.js)
warning: oxicloud@0.6.0: bundle:   [29] LOAD_MORE_ID -> LOAD_MORE_ID_29  (favoritesView.js)
warning: oxicloud@0.6.0: bundle:   [31] GROUP_BY_DEFS -> GROUP_BY_DEFS_31  (recentView.js)
warning: oxicloud@0.6.0: bundle:   [31] LOAD_MORE_ID -> LOAD_MORE_ID_31  (recentView.js)
warning: oxicloud@0.6.0: bundle:   [34] GROUP_BY_DEFS -> GROUP_BY_DEFS_34  (sharedWithMeView.js)
warning: oxicloud@0.6.0: bundle:   [34] LOAD_MORE_ID -> LOAD_MORE_ID_34  (sharedWithMeView.js)
warning: oxicloud@0.6.0: bundle:   [44] GROUP_BY_DEFS -> GROUP_BY_DEFS_44  (filesView.js)
warning: oxicloud@0.6.0: bundle:   [44] LOAD_MORE_ID -> LOAD_MORE_ID_44  (filesView.js)
```
2026-05-28 14:22:53 +02:00
Edouard Vanbelle 891ff89a5d test(playwright): add playwright report to track changes + correct playwright parameters
ci: fix actions/checkout@v6 → @v4 (v6 does not exist)

GitHub started rejecting invalid action versions at parse time,
causing every CI run to fail with 0s / 'workflow file issue'
before any jobs could start.

 * test(e2e): only no retry
 * test(e2e): use static name in tests to facilitate screenshot comparaison
 * test(e2e): update linux screenshots
 * test(e2e): adapt test due to user-vignette generation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 11:29:58 +02:00
Edouard Vanbelle a181d4081e ci: add typescript check (no emit, check only types are fully declared) 2026-05-19 10:18:40 +02:00
Edouard Vanbelle b47013ea8a fix(ci): add missing b3sum 2026-05-13 19:47:39 +02:00
Edouard Vanbelle f7946028f4 tests: add webdav tests 2026-05-13 15:55:34 +02:00
Edouard Vanbelle a0aa9c5cd1 ci: trigger test on /tests change 2026-05-11 20:00:22 +02:00
Edouard Vanbelle 5df4075f7f test(api): add API test coverage on files, folders, favorites, recent, trash 2026-05-11 19:31:12 +02:00
Edouard Vanbelle a6923da88a ci: build, api-test, front-test only on pull_request 2026-05-11 12:12:07 +02:00
Edouard Vanbelle d8625b9f39 ci: merge end-to-end workflow into ci, permits to reduce amount of built 2026-05-11 12:10:15 +02:00
Edouard Vanbelle 3c3d24ac72 test: initial end to end test with playwright 2026-05-08 21:41:28 +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 08884f3b6d refactor(css): track use of undeclared CSS variables 2026-04-14 12:43:51 +02:00
Edouard Vanbelle 11973cae2a chore(css): ensure css are not using direct colors 2026-04-14 01:10:34 +02:00
Edouard Vanbelle 057bab5dad chore: prepare JS + CSS linter and add CI depending frontend of backend changes 2026-04-08 00:09:24 +02:00
Edouard Vanbelle badf35f08f chore: remove all executable attributes on non bash files 2026-04-01 23:14:42 +02:00
Jared Wolff f6e2b30688 fix(ci): update references from db/schema.sql to sqlx migrations
CI and Docker builds broke after removing db/ in favor of migrations/.
- ci.yml: point psql init at migrations/20260307000000_initial_schema.sql
- Dockerfile: COPY migrations instead of db; remove unused db copy in final stage
- docker-build.yml: remove db/schema.sql presence check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:43:15 -04:00
Dionisio f2d35ca792 feat: auto-persist JWT secret, remove setup token requirement
- JWT secret auto-generates and persists to <STORAGE_PATH>/.jwt_secret
- Remove setup token: first admin setup is open until system initialized
- Fix schema.sql: move CREATE EXTENSION pg_trgm/ltree to top
- Update login UI and auth.js to remove setup token fields
2026-03-05 22:12:53 +01:00
George Wu 7e2e110cec Ignore RUSTSEC-2023-0071 in security audit
RUSTSEC-2023-0071 (Marvin Attack) affects RSA private key operations.
This application uses HS256 for internal JWT signing and only performs
RSA public key verification (not private key operations) for OIDC/OAuth2.
2026-02-24 17:09:07 -08:00
Dionisio 1e8a7dd5bb feat: redesign admin panel & profile page, optimize Dockerfile, remove rootless
- Completely redesign admin.html matching OxiCloud design system
- Create standalone profile.html page with avatar, details & password change
- Optimize Dockerfile: 3-stage build, non-root user, OCI labels, layer cache
- Add .dockerignore to reduce build context
- Remove redundant Dockerfile.rootless & rootless-compose.yml
- Redesign login language selector as compact dropdown with search
- Fix CI/CD workflows (ci.yml, docker-build.yml, docker-publish.yml)
- Update app.js to navigate to profile page instead of modal
2026-02-11 14:09:40 +01:00
Dionisio 3050955f9c feat: add admin/profile UI, i18n (fr/de/pt), fix CI pipelines
- Add admin panel link and profile modal in user menu dropdown
- Add French, German and Portuguese locale support (full translations)
- Register new locales across JS frontend and Rust backend
- Create CI pipeline (fmt, clippy, test, audit, build)
- Fix docker-build.yml (cache, real tests, reduced timeout)
- Fix docker-publish.yml (multi-arch via QEMU, latest tag, pre-publish tests)
- Add dependabot.yml for automated dependency updates
2026-02-11 12:37:03 +01:00