Commit Graph

4 Commits

Author SHA1 Message Date
hikari 7085845234 feat: enforce alphabetical server block ordering
Test nginx configuration / Static Analysis (pull_request) Failing after 6s
Test nginx configuration / nginx Syntax Check (pull_request) Successful in 24s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m59s
Adds test 13 to test.sh to verify that server blocks within each
sites-available file are sorted alphabetically by server_name
(LC_ALL=C; regex and wildcard entries excluded).

Fixes aria.conf and mommy.conf to conform: hyphenated names sort
before the bare domain in C locale ('-' < '.'), so trans-bot now
precedes trans, and mommy-slack now precedes mommy.
2026-03-03 16:16:18 -08:00
hikari 493d758df8 refactor: remove port 80 listeners and enforce HTTPS-only in tests
Test nginx configuration / Static Analysis (pull_request) Failing after 5s
Test nginx configuration / nginx Syntax Check (pull_request) Successful in 16s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m6s
Removes the listen 80 / listen [::]:80 blocks from cdn.conf since
port 80 is blocked at the firewall. Updates test 6 to enforce that
no custom server block listens on port 80 at all.
2026-03-03 16:10:51 -08:00
hikari 55fcab69a1 feat: add comprehensive nginx config test suite
Test nginx configuration / Static Analysis (pull_request) Failing after 4s
Test nginx configuration / nginx Syntax Check (pull_request) Successful in 22s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m28s
Replaces the obsolete test.sh (which referenced configs/prod.conf,
a file that no longer exists) with 12 static-analysis checks:

  1.  No deprecated TLS versions (TLSv1 / TLSv1.1)
  2.  No duplicate literal server_name values
  3.  Every sites-available conf has a sites-enabled symlink
  4.  No broken symlinks in sites-enabled
  5.  No orphaned sites-enabled symlinks
  6.  No HTTP-only server blocks (port 80 without port 443)
  7.  ssl_certificate / ssl_certificate_key counts match per file
  8.  Plain-HTTP proxy_pass targets are local only
  9.  All SSL cert paths use /etc/letsencrypt/live/
  10. ssl_certificate uses fullchain.pem, key uses privkey.pem
  11. No raw IP addresses as server_name
  12. conf.d contains only expected files

Adds .gitea/workflows/test.yml with two CI jobs: static-analysis
(runs test.sh, no nginx required) and syntax-check (installs
nginx-full, copies config, generates stub SSL certs for all
referenced letsencrypt paths, then runs nginx -t).
2026-03-03 16:06:18 -08:00
naomi 7c098d41c7 feat: actually sort, add test for sorting 2025-05-25 13:50:18 -07:00