Commit Graph

1843 Commits

Author SHA1 Message Date
fuomag9 f6365a4766 added preview image, better title 2025-11-15 11:27:22 +01:00
fuomag9 aa21329b63 Create CNAME 2025-11-15 11:07:59 +01:00
fuomag9 539cfc5a04 Merge branch 'develop' of github.com:fuomag9/caddy-proxy-manager into develop 2025-11-15 11:07:37 +01:00
fuomag9 ffd7ded175 Added website 2025-11-15 11:07:33 +01:00
fuomag9 ab64b67844 Potential fix for code scanning alert no. 5: Prototype-polluting function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-11-15 10:25:13 +01:00
fuomag9 d071fbf90e updated github actions 2025-11-15 00:16:49 +01:00
fuomag9 06dc28fabd Added user logs functionality 2025-11-14 23:27:05 +01:00
fuomag9 58ec7e321e undo loki stuff 2025-11-12 23:22:30 +01:00
fuomag9 fa65dc1b2c Corrected Configuration for trea/caddy-loki-logger 2025-11-12 22:38:58 +01:00
fuomag9 a172595790 I've corrected the Caddy configuration structure. The error was because I placed logging inside the apps object, but in Caddy's JSON config, logging must be at the root level, alongside admin and apps. 2025-11-12 22:28:59 +01:00
fuomag9 ec580d2385 Add the ability to log to loki 2025-11-12 22:07:51 +01:00
fuomag9 6fa1eb756b Added search feature 2025-11-12 19:32:26 +01:00
fuomag9 52f73e5ca7 1. First try to load from /config/caddy/autosave.json (the auto-saved config from the last run) 2. Fall back to /etc/caddy/Caddyfile only on first run when autosave doesn't exist 2025-11-11 21:39:19 +01:00
fuomag9 a95ecce935 Update Dockerfile 2025-11-11 19:39:15 +01:00
fuomag9 7416573a15 Update docker-compose.yml 2025-11-11 19:28:06 +01:00
fuomag9 a5f6aed25d Update Dockerfile 2025-11-11 19:21:49 +01:00
fuomag9 c10808cf3b Update Dockerfile 2025-11-11 19:11:23 +01:00
fuomag9 76e31a3ea5 fix building 2025-11-11 19:05:43 +01:00
fuomag9 0ed2846133 switch caddy to ubuntu 2025-11-11 18:58:26 +01:00
fuomag9 2155aec746 Revert "Fix Caddy monitoring service detection and error logging"
This reverts commit 97a9d7947d, reversing
changes made to 88b25cee65.
2025-11-09 21:45:26 +01:00
fuomag9 97a9d7947d Fix Caddy monitoring service detection and error logging
- Replace AbortSignal.timeout() with AbortController for better compatibility
- Add detailed error logging to diagnose connection failures
- Improve health status logging (only warn once when becoming unhealthy)
- Add logging when Caddy recovers from unhealthy state
- Add current state to initialization log for debugging

This fixes the monitoring service continuously reporting failures and improves
restart detection after OOM crashes or container restarts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 21:16:43 +01:00
fuomag9 88b25cee65 Add Caddy restart detection, auto-recovery, and metrics exposure
- Implemented health monitoring service that detects Caddy restarts/crashes
- Automatically reapplies configuration when Caddy restarts
- Added metrics settings UI for enabling Prometheus/Grafana monitoring
- Caddy metrics exposed on separate port (default: 9090) via reverse proxy
- Admin API (port 2019) kept internal-only for security
- Updated docker-compose.yml with metrics port documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 19:36:40 +01:00
fuomag9 9e2ea47f90 Add Caddy restart detection, auto-recovery, and metrics exposure
- Implemented health monitoring service that detects Caddy restarts/crashes
- Automatically reapplies configuration when Caddy restarts
- Added metrics settings UI for enabling Prometheus/Grafana monitoring
- Caddy metrics available at /metrics endpoint (configurable port/path)
- Updated docker-compose.yml with metrics port documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:40:39 +01:00
fuomag9 1c09acf515 fix not being able to create multiple proxy hosts in succession without needing to refresh the page
also add recommendation for not disabling Set Host Header
2025-11-08 14:37:50 +01:00
fuomag9 70c5fa831c Now when users configure Authentik defaults in Settings, those values will automatically pre-fill when creating new proxy hosts, but can still be customized per host
also allow instant enable/disable of hosts directly from the table/list views without needing to edit each host
2025-11-08 14:15:55 +01:00
fuomag9 b17ae54fbd Squashed commit of the following:
commit b5a751005850115c84fd8fddb83f32a52835a422
Author: fuomag9 <1580624+fuomag9@users.noreply.github.com>
Date:   Sat Nov 8 13:54:22 2025 +0100

    Update ProxyHostsClient.tsx

commit c93b3898c31b9c206fba74605dad5a578e326ce4
Author: fuomag9 <1580624+fuomag9@users.noreply.github.com>
Date:   Sat Nov 8 13:43:00 2025 +0100

    test-protected-paths
2025-11-08 13:55:23 +01:00
fuomag9 dc8e5e262f fixed Proxy Hosts Not Working After Docker Restart 2025-11-08 12:05:03 +01:00
fuomag9 6fb16c3cd7 Fixed Too Many history.replaceState() Calls 2025-11-08 11:25:52 +01:00
fuomag9 ee8813ac95 The certificates page has been completely redesigned 2025-11-08 11:11:36 +01:00
fuomag9 3be4e1bf7d Rewritten to use drizzle instead of prisma
commit c0894548dac5133bd89da5b68684443748fa2559
Author: fuomag9 <1580624+fuomag9@users.noreply.github.com>
Date:   Fri Nov 7 18:38:30 2025 +0100

    Update config.ts

commit 5a4f1159d2123ada0f698a10011c24720bf6ea6f
Author: fuomag9 <1580624+fuomag9@users.noreply.github.com>
Date:   Fri Nov 7 15:58:13 2025 +0100

    first drizzle rewrite
2025-11-07 19:26:32 +01:00
fuomag9 20a72008ac Merge branch 'develop' of github.com:fuomag9/nginx-proxy-manager into develop 2025-11-07 11:52:18 +01:00
fuomag9 102bd04d4c Fix auto certificate not showing in GUI when editing proxy host
When editing a proxy host with certificate_id set to null (auto), the
dropdown would not show "Managed by Caddy (Auto)" as selected and it
would revert to another certificate. There were two issues:

1. Form submission: Empty string from dropdown was treated as falsy,
   returning undefined instead of null (means "don't change")

2. Database update: The ?? operator treated null as falsy and fell back
   to existing value instead of saving null

Changes:
- app/(dashboard)/proxy-hosts/actions.ts: Check formData.has() and
  explicitly convert empty string to null for auto mode
- src/lib/models/proxy-hosts.ts: Use !== undefined instead of ?? to
  allow null values to be saved
- app/(dashboard)/proxy-hosts/ProxyHostsClient.tsx: Add Certificate
  column to table showing "Managed by Caddy (Auto)" for auto certs

Applied same fixes to access_list_id for consistency.

Now when users select "Managed by Caddy (Auto)", it correctly sets
certificate_id to null, displays properly on subsequent edits, and
shows in the table view.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 11:51:41 +01:00
fuomag9 459e171360 Fix auto certificate not showing in GUI when editing proxy host
When editing a proxy host with certificate_id set to null (auto), the
dropdown would not show "Managed by Caddy (Auto)" as selected. The issue
was that empty string from the dropdown was treated as falsy, returning
undefined instead of null, which means "don't change" in the update logic.

Changes:
- Check if certificate_id field exists with formData.has()
- Explicitly convert empty string to null for auto mode
- Apply same fix to access_list_id for consistency

Now when users select "Managed by Caddy (Auto)", it correctly sets
certificate_id to null and displays properly on subsequent edits.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 11:14:46 +01:00
fuomag9 f079860007 Fix Authentik forward auth by converting to proper reverse_proxy JSON config
The forward_auth directive only exists in Caddyfile syntax, not JSON config.
This fix converts Authentik authentication to use the underlying reverse_proxy
handler with proper configuration:

- Replace forward_auth handler with reverse_proxy
- Convert "private_ranges" keyword to actual CIDR blocks for JSON config
- Parse upstream URL to extract host:port for dial field (removing http://)
- Add handle_response block to copy Authentik headers on 2xx status
- Preserve X-Forwarded-Method and X-Forwarded-Uri headers

Fixes error: "unknown module: http.handlers.forward_auth"
Fixes error: "invalid IP address: 'private_ranges'"
Fixes error: "lookup /hostname: no such host" (dial with URL scheme)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 11:08:09 +01:00
fuomag9 e57d3c3da0 fix build 2025-11-07 09:37:50 +01:00
fuomag9 664d420ec2 updated src/lib/caddy.ts (lines 410-475) to generate the proper reverse_proxy handler configuration that mimics what forward_auth does 2025-11-07 00:19:28 +01:00
fuomag9 8df7aa332d remove arm64 build 2025-11-06 23:15:07 +01:00
fuomag9 56cd0861b5 Merge pull request #16 from fuomag9/claude/setup-prisma-github-actions-011CUsKz8eCpsYeJ6NLzPVqT
Fix Prisma client generation in Docker build following best practices
2025-11-06 22:25:45 +01:00
Claude ad07fd4c13 Fix Prisma client generation in Docker build following best practices
Following the Prisma guide for GitHub Actions and CI/CD, this commit addresses
the Prisma client generation issues in the Docker build process:

Changes:
1. **package.json**:
   - Removed silent failure fallback in postinstall hook
   - Removed redundant prisma generate from build script
   - Now fails fast if Prisma generation has issues

2. **docker/web/Dockerfile**:
   - Added DATABASE_URL environment variable in deps stage
   - Explicitly run prisma generate after npm install to ensure client is created
   - Generate Prisma client again in builder stage for build context
   - Removed --skip-generate flag from prisma db push
   - Added clear comments explaining each Prisma-related step

These changes ensure:
- Prisma client is generated with correct engines for debian-openssl-3.0.x
- Build fails early if there are Prisma configuration issues
- DATABASE_URL is set before running any Prisma commands
- Proper multi-stage Docker build with Prisma support
2025-11-06 21:17:23 +00:00
fuomag9 11c1ce9362 Merge pull request #15 from fuomag9/claude/fix-prisma-schema-errors-011CUs7qLSUg89WLj1ZHdJdf
Fix Prisma engine download failures by pre-generating client in deps …
2025-11-06 21:48:12 +01:00
Claude 5ef6798a31 Fix Prisma engine generation by copying schema before npm install
The previous attempt failed because Prisma CLI couldn't parse the binaryTarget
configuration due to an incorrect environment variable I set. This commit:

- Removes the non-existent PRISMA_CLI_BINARY_TARGETS environment variable
- Copies the Prisma schema BEFORE running npm ci, allowing the postinstall
  script to properly generate the Prisma client with engines
- Adds openssl and ca-certificates to deps stage for engine downloads
- Simplifies the builder stage to rely on pre-generated engines from deps

This ensures Prisma engines are downloaded during npm installation via the
postinstall hook, making them available for subsequent build steps.
2025-11-06 20:42:44 +00:00
Claude db686f9d7d Fix Prisma engine download failures by pre-generating client in deps stage
The build was failing with Prisma schema validation errors because Prisma
couldn't download engine binaries from binaries.prisma.sh (403 Forbidden).
This resulted in cryptic parsing errors during 'prisma generate'.

Changes:
- Add openssl and ca-certificates to deps stage for engine downloads
- Set PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING to bypass checksum validation
- Pre-generate Prisma client with engines in deps stage
- Copy pre-generated client to builder stage to avoid re-downloading
- Set PRISMA_SKIP_POSTINSTALL_GENERATE in builder to prevent regeneration

This ensures engines are bundled during the deps stage and reused in
subsequent stages, eliminating network dependency during the build phase.
2025-11-06 18:39:39 +00:00
fuomag9 a8a0ca924b Merge pull request #14 from fuomag9/claude/fix-prisma-schema-errors-011CUqJ2BtyqkKHkrEkrHkmS
Fix Prisma schema validation errors by installing OpenSSL in builder …
2025-11-05 20:47:48 +01:00
Claude b557d0486c Fix Prisma schema validation errors by installing OpenSSL in builder stage
The build was failing during 'prisma generate' with numerous validation
errors because Prisma's query engine requires OpenSSL to function properly.
The builder stage was missing the openssl package, causing the engine to
fail to load and produce cryptic parsing errors.

This adds openssl installation to the builder stage, matching what was
already present in the runner stage.
2025-11-05 19:30:21 +00:00
fuomag9 f61f0c3d52 Merge pull request #13 from fuomag9/claude/fix-prisma-permission-errors-011CUqCvQfgTJWvYnFa24A1w
Fix Prisma client permission errors by cleaning old client before reg…
2025-11-05 19:57:05 +01:00
Claude 54d9fb5e63 Fix Prisma client permission errors by cleaning old client before regeneration
- Remove /app/node_modules/.prisma/client before generating
- Prevents EACCES errors when Prisma tries to unlink existing files
- Cleanup runs as root before switching to nextjs user
2025-11-05 18:22:24 +00:00
fuomag9 71f4193410 Update entrypoint.sh 2025-11-05 00:29:26 +01:00
fuomag9 114bf1b980 Merge pull request #7 from fuomag9/dependabot/github_actions/docker/build-push-action-6
ci(deps): bump docker/build-push-action from 5 to 6
2025-11-04 23:38:37 +01:00
fuomag9 baa741d7b0 Merge pull request #8 from fuomag9/dependabot/docker/docker/web/node-25-slim
docker: bump node from 20-slim to 25-slim in /docker/web
2025-11-04 23:38:22 +01:00
fuomag9 e7c516ae71 Merge pull request #9 from fuomag9/dependabot/github_actions/actions/checkout-5
ci(deps): bump actions/checkout from 4 to 5
2025-11-04 23:38:10 +01:00