Commit Graph

1833 Commits

Author SHA1 Message Date
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
fuomag9
af9145673b Merge pull request #10 from fuomag9/dependabot/github_actions/actions/stale-10
ci(deps): bump actions/stale from 9 to 10
2025-11-04 23:37:55 +01:00
fuomag9
d07ea08529 Merge pull request #12 from fuomag9/dependabot/npm_and_yarn/production-dependencies-ab61d3bc24
deps(deps): bump the production-dependencies group with 3 updates
2025-11-04 23:37:42 +01:00
fuomag9
5091e111b7 Merge pull request #11 from fuomag9/dependabot/npm_and_yarn/development-dependencies-7615b575d3
deps(deps-dev): bump the development-dependencies group with 2 updates
2025-11-04 23:37:26 +01:00
dependabot[bot]
f6b94d985a deps(deps): bump the production-dependencies group with 3 updates
Bumps the production-dependencies group with 3 updates: [@mui/icons-material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-icons-material), [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) and [bcryptjs](https://github.com/dcodeIO/bcrypt.js).


Updates `@mui/icons-material` from 7.3.4 to 7.3.5
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v7.3.5/packages/mui-icons-material)

Updates `@mui/material` from 7.3.4 to 7.3.5
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v7.3.5/packages/mui-material)

Updates `bcryptjs` from 3.0.2 to 3.0.3
- [Release notes](https://github.com/dcodeIO/bcrypt.js/releases)
- [Commits](https://github.com/dcodeIO/bcrypt.js/compare/v3.0.2...v3.0.3)

---
updated-dependencies:
- dependency-name: "@mui/icons-material"
  dependency-version: 7.3.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: "@mui/material"
  dependency-version: 7.3.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: bcryptjs
  dependency-version: 3.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-04 22:20:34 +00:00
dependabot[bot]
fc9276635f deps(deps-dev): bump the development-dependencies group with 2 updates
Bumps the development-dependencies group with 2 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [eslint](https://github.com/eslint/eslint).


Updates `@types/node` from 24.9.2 to 24.10.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `eslint` from 9.38.0 to 9.39.1
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v9.38.0...v9.39.1)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.10.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: eslint
  dependency-version: 9.39.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-04 22:20:03 +00:00
dependabot[bot]
42c7f358b6 ci(deps): bump actions/stale from 9 to 10
Bumps [actions/stale](https://github.com/actions/stale) from 9 to 10.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v9...v10)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-04 22:19:37 +00:00
dependabot[bot]
3369ade5d4 ci(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-04 22:19:33 +00:00
dependabot[bot]
b0d6088473 ci(deps): bump docker/build-push-action from 5 to 6
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-04 22:19:30 +00:00
dependabot[bot]
a0a37be0d1 docker: bump node from 20-slim to 25-slim in /docker/web
Bumps node from 20-slim to 25-slim.

---
updated-dependencies:
- dependency-name: node
  dependency-version: 25-slim
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-04 22:19:30 +00:00
fuomag9
735e9b9c69 Merge pull request #6 from fuomag9/claude/fix-docker-tag-format-011CUoXaPFzx8eN9neD6hVug
Claude/fix docker tag format 011 c uo xa p fzx8e n9ne d6h vug
2025-11-04 23:18:50 +01:00