aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorsillylaird <sillyfanboy@gmail.com>2026-09-03 00:33:59 +0000
committersillylaird <sillyfanboy@gmail.com>2026-09-03 00:33:59 +0000
commit898b52edcb47bcb3e9d6106e74ca73e74ea01e70 (patch)
tree85c6ee5ad58b860144551184d4cf86b560c62b91 /README.md
downloadwww-main.tar.gz
www-main.zip
import live www.sillylaird.ca webrootHEADmain
Diffstat (limited to 'README.md')
-rw-r--r--README.md69
1 files changed, 69 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0eaab64
--- /dev/null
+++ b/README.md
@@ -0,0 +1,69 @@
+# www.sillylaird.ca
+
+Personal homepage. PHP 8.3 (no framework, no build step) served from this
+directory. Pages are plain `.php` files; shared markup lives in `partials/`.
+
+## Layout
+
+- `index.php`, `links.php`, `guestbook.php`, … — top-level pages.
+- `partials/` — shared includes:
+ - `head_meta.php` — OG / Twitter / canonical / hreflang / favicon / feed
+ boilerplate. Pass a `$meta` array, then `include` it (see `links.php`).
+ Supports `self_url` / `en_url` / `x_default` overrides for non-default
+ canonicals (the homepage uses these to keep its EN canonical at root `/`).
+ - `header.php`, `footer.php` — site chrome.
+ - `i18n.php` — `t($key)` lookup; locale detected from the `_jp` / `_zh`
+ filename suffix. Dicts live in `locales/{en,ja,zh}.php`.
+ - `session.php`, `site_status.php`, `recent_static.php`, `partials_vibe.php`,
+ `proxy_helpers.php` — session bootstrap, status banner, recent-update
+ renderers, and helpers for the API proxies.
+- `assets/` — `css/`, `js/`, `img/`, `fonts/`. CSS/JS are cache-busted with
+ `?v=<filemtime>` (see the `$_av()` helper in `index.php`).
+- `locales/` — flat key → string translation dicts.
+- Translated pages: each page has `_jp.php` / `_zh.php` variants that
+ `require` the base page; `i18n.php` picks the locale from the filename.
+- Proxies: `gemini-proxy.php`, `lastfm-proxy.php`, etc. shield API keys.
+- Admin password: `/var/lib/sillylaird/admin_auth.php` (outside docroot;
+ override with `ADMIN_AUTH_FILE`). Prefer `password_hash`; legacy sha256+salt
+ still works. Generate a new hash: `php /mnt/slab/make_admin_hash.php`.
+
+## Common maintenance
+
+- `python3 tools/link_check.py` — internal link sanity check (scans `.php` and `.html`)
+- `python3 tools/html_audit.py` — quick a11y/markup audit (scans `.php` and `.html`)
+- `python3 tools/generate_sitemap.py` — rebuild `sitemap.xml` (handles `.php` triples with hreflang)
+- `python3 tools/translate_pages.py` — generate missing `*_zh`/`*_jp` pages
+- `python3 tools/link_rot.py` — check external links for rot (see `--help`)
+- `python3 tools/image_budget.py` — flag oversized images
+- `./tools/optimize_images.sh` — recompress/resize images in place (backs up originals first; `DRY_RUN=1` to preview)
+- `./tools/run_audits.sh` — run the audits + sitemap together; intended for cron
+- `./tools/security_check.sh` — verify response headers / cookie flags
+
+## Ops helpers
+
+- `./tools/backup.sh` — tarball backup (defaults to `/tmp/www.sillylaird.ca-backups`, override with `BACKUP_DIR`)
+- `./tools/uptime_check.sh` — curl-based uptime check (override target with `URL`)
+
+Example cron entries:
+
+```cron
+# nightly backup at 03:15 UTC
+15 3 * * * BACKUP_DIR=/var/backups/www.sillylaird.ca /path/to/tools/backup.sh
+
+# hourly uptime check
+0 * * * * URL=https://www.sillylaird.ca/ /path/to/tools/uptime_check.sh
+
+# daily audits + sitemap regen at 02:30 UTC; mails findings if cron MAILTO is set
+30 2 * * * /path/to/tools/run_audits.sh
+
+# pre-commit hook equivalent (run STRICT to fail on findings)
+# STRICT=1 /path/to/tools/run_audits.sh
+```
+
+## Notes
+
+- `sitemap.xml` is generated by `tools/generate_sitemap.py`.
+- No build step: edit `.php` / CSS / JS directly; cache-busting is automatic
+ via `?v=<filemtime>`.
+</content>
+</invoke>