Skip to content

Add WordPress for Cub Scout Pack 138 on hetznix01 - #713

Merged
genebean merged 4 commits into
mainfrom
pack138
Sep 11, 2026
Merged

Add WordPress for Cub Scout Pack 138 on hetznix01#713
genebean merged 4 commits into
mainfrom
pack138

Conversation

@genebean

@genebean genebean commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add services.wordpress on hetznix01 for Cub Scout Pack 138 (138cubpack.com)
  • MariaDB + mysqlBackup (mirrors existing PostgreSQL backup pattern)
  • Nginx vhosts for both 138cubpack.com (primary) and 138cubpack.technicalissues.us (dev, usable before domain transfer)
  • Dev vhost references primary vhost's root, extraConfig, and locations to stay in sync automatically
  • fail2ban jails wired to wp-fail2ban plugin's own filter files via environment.etc symlinks
  • Nix-managed plugins: disable-xml-rpc, wp-fail2ban, simple-login-captcha, wordpress-importer
  • wordpress-importer packaged manually (not yet in nixpkgs) for one-time WXR migration from wordpress.com; remove after import is complete
  • Restic backup paths for MySQL dumps and uploads directory

Migration steps (after merging / deploying)

  • Rebuild and switch on hetznix01
  • Activate wordpress-importer in WP Admin → Plugins
  • Export content from wordpress.com: Tools → Export → All content
  • Import via WP Admin → Tools → Import → WordPress (check "Download and import file attachments")
  • Transfer 138cubpack.com domain from WordPress.com to Gandi
  • Point A/AAAA records at hetznix01 (cert auto-issues via Gandi DNS challenge)
  • Update Site URL + Home URL in WP Admin → Settings → General to https://138cubpack.com
  • Remove wordpress-importer derivation and plugin entry, redeploy
  • Cancel WordPress.com Personal plan

🤖 Generated with Claude Code

genebean and others added 2 commits September 8, 2026 22:05
Adds a self-hosted WordPress site for 138cubpack.com with MariaDB,
security hardening, and fail2ban integration.

MariaDB: enables services.mysql with conservative memory settings
(64MB InnoDB buffer pool, 25 max connections) appropriate for a
low-traffic site on a shared VPS. Daily mysqlBackup job matches the
existing PostgreSQL backup schedule; backup paths are appended to the
existing restic job.

WordPress: services.wordpress with webserver=nginx, Unix socket auth
to MariaDB (no password), ondemand PHP-FPM pool capped at 4 workers,
and three Nix-managed plugins (wp-fail2ban, disable-xml-rpc,
simple-login-captcha). FORCE_SSL_ADMIN is set via settings and
$_SERVER['HTTPS'] is forced on via extraConfig so nginx SSL
termination is handled correctly. DISALLOW_FILE_EDIT is set by the
module automatically (read-only Nix store) so we don't duplicate it.

Nginx: primary vhost for 138cubpack.com (ACME via Gandi DNS challenge
— cert issues after domain transfer) and a dev vhost at
138cubpack.technicalissues.us (cert issues immediately). The dev vhost
mirrors root, extraConfig (index index.php), and locations from the
primary vhost so they stay in sync. xmlrpc.php is blocked at the
nginx layer on both vhosts as defense in depth.

Security: wp-fail2ban filter files are symlinked from the plugin's
store path into /etc/fail2ban/filter.d/. Two jails watch the systemd
journal for WordPress syslog events: wordpress-hard (1 failure = 24h
ban) and wordpress-soft (5 failures in 1h = 1h ban).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The NixOS wordpress module copies plugins into the Nix store (read-only),
so WP Admin cannot install plugins directly — FS_METHOD=direct would not
help. Package wordpress-importer 0.9.6 manually using the fetchzip pattern
from the NixOS wiki so it appears in WP Admin → Plugins after a rebuild.

Remove this plugin and its derivation from the let block once the WXR
import from wordpress.com is complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
genebean and others added 2 commits September 8, 2026 22:44
Set upload_max_filesize and post_max_size to 50M in the PHP-FPM pool
and client_max_body_size 50M in nginx (dev vhost inherits it via the
config reference). Add webp-converter-for-media plugin so uploaded
images are automatically converted and served as WebP.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Package the Infield theme (GPL v2, by Automattic) from the
Automattic/themes GitHub repo. Not yet in nixpkgs so packaged manually,
same pattern as the wordpress-importer plugin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@genebean
genebean merged commit db43c96 into main Sep 11, 2026
2 checks passed
@genebean
genebean deleted the pack138 branch September 11, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant