No description
  • PHP 53.5%
  • Vue 17.2%
  • TypeScript 12.3%
  • JavaScript 8.3%
  • Shell 5%
  • Other 3.7%
Find a file
Julius Koenig 95eb51cc4d
All checks were successful
CI / Frontend (lint, stylelint, type, tests, build) (push) Successful in 1m39s
CI / PHP (lint, cs, phpstan, phpunit, metadata) (push) Successful in 1m53s
CI / Build and validate release archive (push) Successful in 1m50s
Integration / Integration (current major, test image) (push) Successful in 6m9s
docs: describe the resource-oriented table API and browser-only table preferences
api.md: all table operations are listed under the resource prefixes, the
preview table keeps its stable URLs and the removed /table/config + legacy
routes are documented as removed; architecture.md: the resource-oriented
decision and the completed state; testing.md: resource-oriented smoke tests
and localStorage-only preferences.
2026-10-31 01:59:22 +01:00
.forgejo/workflows feat(phase-2.7): dev seed, background execution and mail-covered CI matrix 2026-10-28 00:48:22 +01:00
appinfo chore(cleanup): remove dead policy client code and stale comments/statements 2026-10-30 23:45:14 +01:00
build test(api): cover all resource table endpoints and the removed legacy routes 2026-10-31 01:58:27 +01:00
docs docs: describe the resource-oriented table API and browser-only table preferences 2026-10-31 01:59:22 +01:00
img feat(ui): full-width layout without overflow, compact icon actions, app icon 2026-10-27 22:06:50 +01:00
l10n feat(phase-3): extend CSV import to mail settings and isolate Swagger UI 2026-10-30 16:39:15 +01:00
lib feat(api): migrate all remaining table resources and remove the legacy table API 2026-10-31 01:55:37 +01:00
scripts feat(phase-2): decouple mail profiles from mail assignments 2026-10-30 02:07:05 +01:00
src feat(ui): address all table resources by prefix and drop server column config 2026-10-31 01:57:32 +01:00
templates feat: add Nextcloud app skeleton with admin settings page 2026-10-24 00:54:10 +02:00
tests test(api): cover all resource table endpoints and the removed legacy routes 2026-10-31 01:58:27 +01:00
vendor-bin feat: baseline phases 2.0–2.4.1 (persistence, services, API, admin UI, hardening) 2026-10-27 20:45:18 +01:00
.env.example dev: compose-based local environment on the shared current-pg test image 2026-10-26 20:46:00 +01:00
.eslintrc.cjs feat: baseline phases 2.0–2.4.1 (persistence, services, API, admin UI, hardening) 2026-10-27 20:45:18 +01:00
.gitignore feat(phase-2.7): dev seed, background execution and mail-covered CI matrix 2026-10-28 00:48:22 +01:00
.php-cs-fixer.dist.php build: add PHP and frontend toolchain with unit tests 2026-10-24 00:54:18 +02:00
AGENTS.md update: project rules 2026-10-30 22:24:26 +01:00
CHANGELOG.md feat(phase-3): extend CSV import to mail settings and isolate Swagger UI 2026-10-30 16:39:15 +01:00
compose.yaml dev: install frontend dependencies only when needed (compose) 2026-10-26 21:08:23 +01:00
composer.json feat: baseline phases 2.0–2.4.1 (persistence, services, API, admin UI, hardening) 2026-10-27 20:45:18 +01:00
composer.lock build: add PHP and frontend toolchain with unit tests 2026-10-24 00:54:18 +02:00
LICENSE feat: add Nextcloud app skeleton with admin settings page 2026-10-24 00:54:10 +02:00
openapi.json chore(openapi): regenerate the spec without the legacy table API 2026-10-31 01:56:35 +01:00
package-lock.json feat: baseline phases 2.0–2.4.1 (persistence, services, API, admin UI, hardening) 2026-10-27 20:45:18 +01:00
package.json feat(phase-3): extend CSV import to mail settings and isolate Swagger UI 2026-10-30 16:39:15 +01:00
phpstan.neon feat(mail): read-only Nextcloud Mail adapter, ownership bridge, dry run 2026-10-27 21:30:27 +01:00
README.md docs: bring API/admin-UI/architecture/README up to date and add the phase-A audit 2026-10-30 23:45:20 +01:00
stylelint.config.cjs feat: add Nextcloud app skeleton with admin settings page 2026-10-24 00:54:10 +02:00
tsconfig.json feat: add Nextcloud app skeleton with admin settings page 2026-10-24 00:54:10 +02:00
vite.config.ts feat: add Nextcloud app skeleton with admin settings page 2026-10-24 00:54:10 +02:00
vitest.config.ts feat(swagger): serve the OpenAPI spec via an admin-gated same-origin route 2026-10-30 23:45:04 +01:00

Mail Provisioning

Central administration and provisioning of IMAP/SMTP mail accounts for Nextcloud users.

Status: alpha. The app provides the versioned OCS admin API v1 with unified session/token authorization (ApiAuthGuard), resource scopes and secure, revocable API tokens, a generated, committed OpenAPI spec with interactive Swagger UI, and the full Vue administration UI (dashboard, mail accounts, account profiles, provisionings, preview, jobs, API section, settings). The controlled provisioning engine resolves the desired state deterministically (direct assignments over group assignments, then priority; ties are explicit conflicts), compares it with the real Nextcloud Mail accounts in a read-only dry run and only writes through an explicit plan → confirm → run flow with persisted, user-scoped, idempotent jobs and a gated Mail adapter (writes never adopt or modify user-created mail accounts; no deprovisioning). User-wide mail settings (mail profiles, text blocks, address lists, S/MIME certificate metadata, mail assignments) are managed and provisioned through the same explicit confirmation model. Automatic provisioning (scheduled/login/change triggers) exists but is disabled by default and only ever runs previously confirmed work asynchronously. The universal, server-driven table API provides search/filter/sort/pagination, CSV export/import and per-user column configuration for all 10 resources. See docs/architecture.md, docs/database.md, docs/api.md, docs/admin-ui.md and docs/mail-adapter.md.

Features (current)

  • Nextcloud administration section "Mail Provisioning" hosting the Vue admin UI with an internal navigation: Dashboard, Provisioning (overview, mail accounts, account profiles, provisionings/assignments, mail profiles, text blocks, address lists, S/MIME certificates, mail assignments, preview, jobs), API (OpenAPI/Swagger + tokens) and Settings.
  • Data-driven dashboard with real KPIs, the last run's reconciliation outcome, a 30-day job-activity chart and the most recent jobs — empty states instead of invented numbers.
  • Mail account, profile and provisioning management (create/edit/delete/toggle/priority) with account/user/group assignments, deterministic resolution rules and write-only passwords (a new password is sent only when typed, clearing is always an explicit checkbox, stored secrets are never loaded back into the UI).
  • User-wide mail settings: mail profiles with capability values, text blocks, address lists, S/MIME certificate metadata (never key material) and mail assignments (exactly one mail profile plus user/group targets and resource references).
  • Read-only preview for one Nextcloud user (effective accounts, explicit conflicts, discarded assignments, warnings) plus the desired-vs-actual comparison against the real Nextcloud Mail accounts.
  • Controlled execution: an expiring, fingerprint-bound execution plan lists the planned actions; the administrator explicitly confirms it and a persisted, user-scoped job performs the writes (create/update only — never delete). Plans become stale as soon as the configuration or mail state changes and are rejected (409); jobs are idempotent and resumable, secret set/replace/clear bumps a monotonic revision.
  • Jobs view: persisted history with status, trigger, actor, timestamps, duration, counters and a per-operation detail table (no secrets).
  • Universal tables: a generic, server-driven table API (search, filters, sorting, pagination, CSV export/import, per-user column configuration) for the 10 management resources, plus a read-only resolver preview table.
  • Automation (scheduled/login/change triggers), global self-service policy (restrict manual mail-account creation via the native Mail switch) and settings/feature flags — everything disabled by default, nothing runs automatically without explicit confirmation.
  • API section: generated, committed openapi.json (composer run openapi, CI drift check), same-origin spec download and an admin-gated, Shadow-DOM isolated interactive Swagger UI with dark mode; resource-scoped API tokens with optional expiry, one-time plaintext display, revocation and record deletion.
  • Status/diagnostics view: app/API/server/mail-app versions, tested window, compatibility badge, rolling-support guarantee and the state of the Mail adapter (reads + compatibility-gated writes).
  • The admin UI follows the Nextcloud user language (English/German).
  • Full development, test, build and release infrastructure:
    • Docker-based local development environment (Nextcloud + PostgreSQL)
    • PHP toolchain: PHP-CS-Fixer, PHPStan, PHPUnit, PHP syntax checks
    • Frontend toolchain: Vue 3 + Vite, TypeScript (vue-tsc), Vitest, ESLint, Stylelint
    • Reproducible release packaging with archive validation and SHA-256
    • Forgejo/Gitea Actions workflows for CI, integration and releases

Quick start (local development)

cp .env.example .env                 # optionally adjust dev credentials
docker compose up -d                 # start Nextcloud + PostgreSQL + app init
docker compose ps                    # wait until nextcloud is healthy
open http://localhost:8084           # admin/admin

The app source is bind-mounted and linked into the Nextcloud instance; code changes are picked up immediately. See docs/development.md.

Local multi-user test environment

The local instance can be prepared with five fixed dev users, the two mail-test-* groups and a simple seed configuration (three accounts, three profiles and three provisioning rules, no artificial conflicts) with documented expected results:

scripts/dev-seed.sh --yes        # idempotent, dev-only (prompts without --yes)
scripts/dev-verify.sh --execute user1   # sessions, groups, previews, execution
scripts/dev-seed-reset.sh --yes  # remove ONLY the seed-owned data

Synthetic, non-productive test credentials (user1/user2/user3/ user4/user5, password = user id, dev only) and the full acceptance table are documented in docs/testing.md and docs/development.md.

Tooling (host-based)

The PHP toolchain runs with Composer + vendor-bin:

composer install      # install root + vendor-bin dependencies
composer run lint     # PHP syntax check
composer run cs:check # coding standards
composer run phpstan  # static analysis
composer run test:unit

The frontend requires Node.js >= 20.19:

npm ci
npm run build         # produces js/ and css/ assets
npm run lint
npm run stylelint
npm run test:types    # vue-tsc
npm test              # vitest frontend tests

See docs/development.md.

Building a release archive

./build/package-app.sh --zip          # dist/mail_provisioning-<version>.{tar.gz,sha256,zip}
./build/validate-archive.sh dist/mail_provisioning-<version>.tar.gz

The archive is installable via occ app:install (copy into apps/ and occ app:enable mail_provisioning) or manually via the web UI. See docs/releasing.md.

CI/CD

Workflows live in .forgejo/workflows/ and run on the Forgejo instance code.bastelquartier.de:

  • ci.yml — fast checks on every push/PR: lint, static analysis, unit tests, frontend lint/stylelint/type-check/tests/build, OpenAPI drift check, packaging
  • integration.yml — PR + main: installs the built archive into a fresh Nextcloud (current major) and verifies settings/access/logs
  • matrix.yml — weekly + manual: compatibility matrix (33/34/35 × PostgreSQL/MariaDB) with a support-drift check
  • release.yml — tag-based releases with strict gates; existing releases are never overwritten

See docs/ci-cd.md for runner requirements, version selection and diagnosing runs with fj.

Supported Nextcloud versions

The app is developed and tested against Nextcloud 33–35 (currently the officially supported majors). The declared compatibility window in appinfo/info.xml (33–35) only claims what is actually tested. New majors are never added automatically; see docs/testing.md.

Nextcloud App Store

The app is intended for publication in the Nextcloud App Store. The app id mail_provisioning was checked against the store API and is not registered yet. Publication requires a signing certificate and is deliberately disabled until secrets and certificates are provided. See docs/app-store.md.

License

AGPL-3.0-or-later. See LICENSE.

Documentation

The historical prototype archive (oidc_mail_provisioning.zip) in the repository root is intentionally git-ignored and never committed; it is only a reference for the desired-state reconciliation and Mail adapter concepts.