Commit Graph

35 Commits

Author SHA1 Message Date
fuomag9
0dad675c6d feat: integrate Coraza WAF with full UI and event logging
- Add coraza-caddy/v2 to Caddy Docker build
- Add waf_events + waf_log_parse_state DB tables (migration 0010)
- Add WafSettings type and get/save functions to settings
- Add WafHostConfig/WafMode types to proxy-hosts model
- Add resolveEffectiveWaf + buildWafHandler to caddy config generation
- Create waf-log-parser.ts: parse Coraza JSON audit log → waf_events
- Add WafFields.tsx per-host WAF UI (accordion, mode, CRS, directives)
- Add global WAF settings card to SettingsClient
- Add WAF Events dashboard page with search, pagination, severity chips
- Add WAF Events nav link to sidebar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 22:16:34 +01:00
fuomag9
a45a156068 fix pages viewing 2026-02-27 19:49:11 +01:00
fuomag9
3d88f565ca fix: await searchParams Promise in all paginated pages (Next.js 15+) 2026-02-27 18:40:56 +01:00
fuomag9
6bd7fe92d8 feat: add server-side pagination to proxy-hosts page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 18:00:26 +01:00
fuomag9
1348c0b4cd fix: add server-side validation for geoblock_mode, access_list_id, redirect_url, response_status, and response_headers keys
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 09:35:06 +01:00
fuomag9
0758e5b27a feat: support fail_closed option from caddy-blocker-plugin
New field from upstream plugin: when the real client IP is
indeterminate (trusted proxy present but no usable XFF entry),
fail_closed=true blocks the request instead of passing it through.

- Add fail_closed to GeoBlockSettings type
- Include in mergeGeoBlockSettings (OR semantics: either global or host enables it)
- Emit fail_closed in buildBlockerHandler (only when true)
- Parse geoblock_fail_closed from form in both settings and proxy-host actions
- Add Checkbox UI in the Advanced accordion of GeoBlockFields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 09:14:46 +01:00
fuomag9
c233c77bd8 fix: use consistent form parsing helpers in parseGeoBlockConfig
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 19:56:38 +01:00
fuomag9
bca740fcea feat: add parseGeoBlockConfig to proxy host actions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 19:56:38 +01:00
fuomag9
bb8a0d1023 implemented upstream pinning 2026-02-22 01:11:56 +01:00
fuomag9
eecacfb271 The static response feature has been completely removed 2026-02-09 01:15:28 +01:00
fuomag9
6d56cf2288 deprecate deadhosts, move it to the GUI as a custom response feature 2026-02-07 00:51:48 +01:00
fuomag9
7f93e9e784 Implement custom dns servers 2026-01-22 20:47:56 +01:00
fuomag9
49cf4f5ed1 added load balancing settings 2026-01-21 22:23:17 +01:00
fuomag9
d874cb9a69 add duplicate button and fix http protocol parsing in case user inputs protocol 2026-01-20 01:01:16 +01:00
fuomag9
ce741c98c6 fix alignment issue and missing background 2026-01-15 01:20:19 +01:00
fuomag9
85c7a0f8c7 finalized UI and website for 1.0 release 2026-01-15 01:16:25 +01:00
fuomag9
d3b77a394e better multiple upstreams parsing 2026-01-14 23:46:32 +01:00
fuomag9
d6fde6c001 implemented multiple upstreams, http visual protocol, made UI better 2026-01-14 23:26:01 +01:00
fuomag9
f2e34ec17f Update actions.ts 2026-01-05 15:37:28 +01:00
fuomag9
c9838a23eb Partial Revert "fix some permission stuff" 2026-01-04 22:29:00 +01:00
fuomag9
8ec483b14f fix some permission stuff 2026-01-04 18:49:24 +01:00
fuomag9
7ae51ad034 enforce admin role by reading user role instead of hardcoding 2025-11-19 18:06:24 +01:00
fuomag9
6fa1eb756b Added search feature 2025-11-12 19:32:26 +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
6fb16c3cd7 Fixed Too Many history.replaceState() Calls 2025-11-08 11:25:52 +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
ad0225a16e Throttle login attempts and lock admin actions to privileged sessions 2025-11-04 00:00:22 +01:00
fuomag9
2cd8ace6bf Fix UI state management issues with data refresh
- Add router.refresh() to proxy-hosts and redirects dialogs
- Auto-close dialogs 1 second after successful form submission
- Fixes stale data not refreshing after create/edit/delete operations
- Fixes localhost redirect issues (requires BASE_URL env var to be set)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 22:30:08 +01:00
fuomag9
668b667fe9 updated a lot of stuff 2025-11-02 22:16:13 +01:00
fuomag9
b064003c34 Updated the UI 2025-10-31 23:25:04 +01:00
fuomag9
d9ced96e1b implement oauth2 login 2025-10-31 23:02:30 +01:00
fuomag9
29acf06f75 Swapped the entire UI to Material UI, applied a global dark theme, and removed all of the old styled-jsx/CSS-module styling 2025-10-31 21:03:02 +01:00
fuomag9
315192fb54 first rewrite commit 2025-10-31 20:08:28 +01:00