Commit Graph

196 Commits

Author SHA1 Message Date
fuomag9
ec580d2385 Add the ability to log to loki 2025-11-12 22:07:51 +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
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
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
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
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
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
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
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
Claude
94edfe08bc Implement official Prisma solution for client generation
Following Prisma's official documentation for deployment caching issues:
https://www.prisma.io/docs/orm/more/help-and-troubleshooting/vercel-caching-issue

Changes:
- Add 'prisma generate' to build script (official Prisma recommendation)
- Add postinstall script for automatic client generation
- Remove custom stub generator workaround
- Keep runtime Prisma client generation in entrypoint.sh for reliability
- Add openssl to runtime container (required for Prisma engines)

This follows Prisma best practices: explicitly run prisma generate during the
build process to ensure Prisma Client is always up-to-date. The entrypoint
script regenerates the client at runtime to guarantee engine availability in
the production environment.
2025-11-04 20:55:36 +00:00
fuomag9
6418629c0b Fix Next.js server binding to 0.0.0.0 for health checks 2025-11-03 19:20:39 +01:00
fuomag9
f05b56bf02 Use HTTP for default site to prevent certificate errors on startup 2025-11-03 19:15:31 +01:00
fuomag9
a6cb399622 Copy all chunks directory for instrumentation 2025-11-02 22:57:28 +01:00
fuomag9
a1f61cad40 Copy instrumentation chunks to fix module loading 2025-11-02 22:55:53 +01:00
fuomag9
63ad2f4b9d Copy instrumentation files to standalone build 2025-11-02 22:54:06 +01:00
fuomag9
404ff29a4c Fix npm cache directory issue in entrypoint 2025-11-02 22:45:04 +01:00
fuomag9
757b14fc70 Fix database initialization on fresh deployments
Added entrypoint script to handle database permissions on fresh deployments.
The issue occurred because Docker creates the ./data directory with root permissions
when it doesn't exist, preventing the nextjs user (uid 1001) from writing to it.

Changes:
- Add entrypoint.sh that runs as root, fixes permissions, then switches to nextjs user
- Install gosu for safe privilege dropping
- Initialize database on first run with proper permissions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 22:42:17 +01:00
fuomag9
668b667fe9 updated a lot of stuff 2025-11-02 22:16:13 +01:00
fuomag9
315192fb54 first rewrite commit 2025-10-31 20:08:28 +01:00
copilot-swe-agent[bot]
2185b8244c Refine security patterns: reduce false positives in null byte detection and expand RFI protocol coverage
Co-authored-by: fuomag9 <1580624+fuomag9@users.noreply.github.com>
2025-09-19 16:55:43 +00:00
copilot-swe-agent[bot]
dd2e443da6 Remove overly restrictive rules based on feedback - PUT/DELETE methods, spam filtering, scanner detection, and rate limiting
Co-authored-by: fuomag9 <1580624+fuomag9@users.noreply.github.com>
2025-09-19 16:05:22 +00:00
copilot-swe-agent[bot]
21e1697b8a Significantly enhance block-exploits.conf with comprehensive security protections
Co-authored-by: fuomag9 <1580624+fuomag9@users.noreply.github.com>
2025-09-19 15:36:40 +00:00
Jamie Curnow
54d463ac36 Safer and flexible boolean env vars 2025-07-09 21:27:50 +10:00
Jamie Curnow
a23dc24021 Tweak ownership output 2025-07-09 21:01:21 +10:00
Jamie Curnow
4f9df893c8 Ownership script shakeup
- Don't touch a file to determine if we need to run
- Instead, check ownership of each location and skip it if we are happy
- Keeping SKIP_CERTBOT_OWNERSHIP flag
- More vebose logging of outcomes
2025-07-09 20:30:27 +10:00
Jamie Curnow
304b38e82b Fix ownership if statement 2025-07-09 18:19:50 +10:00
Jamie Curnow
9a0383bc73 Move SKIP_CERTBOT_OWNERSHIP check around the entire certbot code 2025-07-09 16:30:45 +10:00
Jamie Curnow
1357774f21 Add SKIP_CERTBOT_OWNERSHIP env var support to skip certbot folder ownership 2025-07-09 13:14:27 +10:00
Jamie Curnow
817021a43d Update s6 overlay 2025-07-08 17:32:23 +10:00
Jamie Curnow
3735f3c11d Formating for ownership script 2025-07-08 09:44:10 +10:00
Aditya
0cab720f23 fix: optimize certbot ownership script to reduce container startup time
Replace inefficient find/execdir implementation that was causing 3+ minute
startup delays with a more efficient approach that:

1. Uses a flag file to skip redundant operations on container restarts
2. Processes site-packages directories with bulk chown operations instead
   of individual file checks and changes
3. Maintains the same functionality while dramatically improving performance

This change should significantly reduce container startup time while ensuring
all necessary file permissions are still properly set.
2025-04-20 20:38:54 +10:00
Jamie Curnow
5e66d677f1 Adds test for dashboard endpoints 2025-03-24 14:34:45 +10:00
Jamie Curnow
6a60627833 Cypress test for Streams
and updated cypress + packages
2025-02-05 16:02:17 +10:00
jbowring
3091c21cae Add SSL certificate to TCP streams if certificate in database 2025-02-04 17:12:04 +10:00
Jamie Curnow
9687e9e450 Use previous version of powerdns image, newer version is broken 2025-01-07 10:30:08 +10:00
Jamie Curnow
fc30a92bd4 Open port for authentik in dev 2024-12-24 18:19:52 +10:00
Jamie Curnow
ca3ee98c68 Postgres Support
- Combines #4086 and #4087 PRs
- Adds authentik in CI stack
2024-12-24 16:48:48 +10:00
irexyc
a0b26b9e98 Add woff2 format to assets.conf for Cache Assets 2024-11-04 20:01:39 +08:00
Jamie Curnow
929ac3bd7c Adds env var to set certbot acme server
this is required for test suite to use dns certbot request
without talking to live or staging letsencrypt servers or
production level dns providers. This is a backwards port
from the v3 branch and opens the door for a full certificate
cypress test
2024-10-16 11:06:29 +10:00
Jamie Curnow
f48e1b46a8 Updated swagger cypress package,
which works with proxies
2024-10-16 08:32:49 +10:00
Jamie Curnow
81b89185f2 Squid ci fixes 2024-10-13 22:15:18 +10:00
Jamie Curnow
f2bb8f2b3d Squid ci fixes 2024-10-13 22:04:07 +10:00
Jamie Curnow
b01817bc7f Adds squid to dev/CI stacks
- for testing forwarded ip address later
2024-10-13 21:54:58 +10:00
jc21
e7e4003d15 Merge pull request #4053 from NginxProxyManager/master
Master
2024-10-11 15:26:06 +10:00