27 Commits

Author SHA1 Message Date
Alexander
52cf246ade Merge pull request #8 from Pacerino/feature/host-plugins
Feature/host plugins
2026-06-15 23:53:44 +02:00
Pacerino
0331888621 [Docker] Expose Caddy's HTTPS port (8443) in E2E docker-compose configuration 2026-06-15 23:28:49 +02:00
Pacerino
e3763c8603 [Docker] Install pinned Caddy from official release, allow custom binary
The Alpine caddy package lags and lacked `list-modules --json`. Install the
official static Caddy binary pinned via ARG CADDY_VERSION (multi-arch via
TARGETARCH) instead. The entrypoint now launches ${CPM_CADDY_BINARY:-caddy}
so a mounted plugin-enabled build is used by both Caddy and CPM's detection.
2026-06-15 23:15:39 +02:00
Pacerino
e52d07edeb [Backend] Make caddy list-modules resilient to older builds
Older Caddy versions don't support `list-modules --json`, which made the
plugins page fail with an opaque "exit status 1". Surface stderr in the error
and fall back to parsing the plain-text output (--packages / --skip-standard)
when --json is unsupported, so module detection works on any Caddy version.
2026-06-15 23:15:30 +02:00
Pacerino
36b0672d75 [CI] Add per-PR E2E deployment and teardown workflow
Deploy the PR image to the self-hosted runner in API mode and run a full
end-to-end test (login, host creation, live reverse-proxy to whoami, basic
auth plugin, module discovery). The environment is published on a fixed port
3001 and left running until the PR is closed or a /teardown comment is posted.

- docker-compose.e2e.yml: cpm (API mode) + whoami upstream, per-PR isolation
- test/e2e/run.sh: full api-mode E2E assertions against the live container
- .github/workflows/pr-e2e.yml: deploy/E2E, teardown on close, /teardown comment
2026-06-15 22:59:20 +02:00
Pacerino
a33d535352 [Tests][CI] Add backend/frontend test suites and refactor test tooling
Add unit/integration tests across backend handlers, auth, caddy and
util packages, plus frontend component and API tests with the new
test setup. Update CI workflow and Vite config to run the suites.
2026-06-15 14:17:39 +02:00
Pacerino
b4509d12e7 [Backend][Frontend] Add host plugins with module config and schema-driven UI
Introduce per-host plugin support: Caddy module discovery, module
config endpoints, plugin schemas (basicauth, cloudflare) and the
host plugins API. On the frontend, add the Plugins page, plugin/host
plugin dialogs and schema-driven form fields.
2026-06-15 14:17:34 +02:00
Alexander
c0ec48bae4 Merge pull request #6 from Pacerino/develop
Revive CPM: modern stack, Caddy API mode, OIDC, Docker & CI
v3.1.0-rc1
2026-06-14 13:06:12 +02:00
Pacerino
2e2eb2fe29 [CI] Add release job: cross-compiled binaries + GitHub release
On version tags, build static pure-Go binaries for linux, macOS and
Windows (amd64 + arm64), package them with checksums and publish a
GitHub release with the artifacts. Grant contents: write for releases.
2026-06-14 12:32:40 +02:00
Pacerino
ca6b2f1e64 [Backend] Switch to pure-Go sqlite driver, drop CGO
Replace gorm.io/driver/sqlite (mattn/go-sqlite3, CGO) with
github.com/glebarez/sqlite (modernc, pure Go). Builds and tests no
longer need a C toolchain, fixing CI on runners without gcc. Drop the
race detector from CI (it requires CGO) and build a static binary in
Docker.
2026-06-14 03:18:28 +02:00
Pacerino
b4a1bff5b8 [CI] Enable CGO for backend tests
go test -race (and the sqlite driver) require CGO; set CGO_ENABLED=1 on
the test-backend job.
2026-06-14 02:57:40 +02:00
Pacerino
51f89454f5 [Docs] Revise README for clarity and structure; update features and quick start instructions 2026-06-14 02:43:31 +02:00
Pacerino
0baeee0fca Merge feature/revival-modernization into develop
Revive the project: modern Go toolchain, Caddy provider abstraction
(Caddyfile + admin API modes), configurable local/OIDC auth, a rewritten
Vite/React/shadcn frontend, Docker image and CI pipeline.
2026-06-14 02:37:44 +02:00
Pacerino
abed2d2c69 [CI] Add Dockerfile, entrypoint and GitHub Actions pipeline
Multi-stage Dockerfile builds the frontend and backend into a single
Alpine image bundling Caddy, started via an entrypoint. CI runs backend
tests (with race detector), builds the frontend and publishes the image
to GHCR on master/tags. Targets a self-hosted runner with a local build
cache. Updates .gitignore (secrets/runtime state) and README.
2026-06-14 02:35:56 +02:00
Pacerino
5e6c6b083c [Frontend] Rewrite SPA with Vite, React, TypeScript, Tailwind and shadcn/ui
Replace the Create React App frontend with a modern Vite stack. Adds a
login page (local form or SSO depending on auth mode), an OIDC callback
page, and a hosts page with create/edit/delete. Build output is emitted
into backend/embed/assets for embedding in the binary.
2026-06-14 02:35:41 +02:00
Pacerino
2bc7cd5a98 [Backend] Wire providers/auth into API and add startup bootstrap
Route host changes through the selected Caddy provider, add auth routes
and the frontend-dir serving toggle, seed a default admin user on first
run, and validate space/comma separated domain lists via a custom
validator. Includes validator tests.
2026-06-14 02:35:28 +02:00
Pacerino
8019bb9861 [Backend] Add configurable authentication (local or OIDC)
Support CPM_AUTH_MODE=local|oidc. OIDC uses go-oidc with JIT user
provisioning and an optional email-domain allowlist. Adds auth config,
login and callback endpoints, a JWT signing-key bootstrap and
Provider/Subject fields on the user model. Includes OIDC allowlist tests.
2026-06-14 02:35:13 +02:00
Pacerino
7ff0949067 [Backend] Add Caddy provider abstraction with Caddyfile and API modes
Introduce a Provider interface selectable via CPM_CADDY_MODE:
- CaddyfileProvider renders per-host snippets (template whitespace fixed)
- APIProvider manages Caddy's JSON config via the admin API
Add configurable reload strategy (systemd/exec/api/none) and a
configurable listen address for the bootstrapped server in API mode.
Includes unit tests for the JSON builder, provider factory and the
API provider (httptest).
2026-06-14 02:34:54 +02:00
Pacerino
401e2520c1 [Backend] Modernize toolchain to Go 1.24 and update dependencies
Bump Go version, update all dependencies and migrate jwx v1 (deprecated)
to jwx v3.
2026-06-14 02:34:40 +02:00
Pacerino
906e8a0ba2 [Backend] Reload Caddy via dbus 2022-10-04 11:49:00 +02:00
Pacerino
766975f52b small changes to error codes and behavior 2022-10-03 22:50:54 +02:00
Pacerino
aaef8a4c97 [Frontend] Implement Login with JWT and axios 2022-10-03 22:50:21 +02:00
Pacerino
e7557515f1 [Backend] Implement Login with JWT 2022-10-03 20:40:58 +02:00
Pacerino
ff1190e8bd rename imports 2022-09-26 15:46:53 +02:00
Pacerino
cd92e72f60 Delete Readme from frontend 2022-09-26 15:43:48 +02:00
Pacerino
935d938aab Adding License 2022-09-26 15:42:26 +02:00
Pacerino
15842e3c45 Initial Upload 2022-09-26 15:41:00 +02:00