-
Notifications
You must be signed in to change notification settings - Fork 0
fix: #82 serve index.html for album pages on the VM #85
Conversation
Apache had no fallback for client-side routes, so opening or reloading /project2/album/:id gave a 404. Document the FallbackResource for /var/www/html/project2 in VM-setup.md and make the deploy job check that /project2/album/1 returns 200.
|
Looked at this properly. The diagnosis and the shape of the fix are right, and the deploy check is the correct guard — it turns "someone forgot the VM step" into a red build instead of a broken deep link. Three things, none blocking: 1. The
2. Applying it is easier as a separate conf file Editing a site config by hand is the part that makes this feel risky to do over a flaky VPN. A dedicated conf plus sudo tee /etc/apache2/conf-available/project2-spa.conf >/dev/null <<'EOF'
# SPA fallback: client-side routes such as /project2/album/42 have no file behind them.
<Directory /var/www/html/project2>
FallbackResource /project2/index.html
</Directory>
EOF
sudo a2enconf project2-spa
sudo /usr/sbin/apachectl configtest
sudo systemctl reload apache2
# expect 200 / 200 / 200
curl -s -o /dev/null -w 'deep link %{http_code}\n' http://localhost/project2/album/1
curl -s -o /dev/null -w 'index %{http_code}\n' http://localhost/project2/
curl -s -o /dev/null -w 'graphql %{http_code}\n' -X POST http://localhost/graphql \
-H 'content-type: application/json' -d '{"query":"{ __typename }"}'Rollback, if 3. One trade-off worth a sentence With CI is green on the branch (deploy skipped, as expected on a PR). The "before merging" section is accurate: the deploy check means |
The VM step was done as a dedicated conf enabled with a2enconf rather than by editing the site config, so the runbook now describes the machine that exists. Keeping it in conf-available means it survives edits to the vhost, does not need a hand-edit over SSH, and rolls back with one command. The verification also checks a built asset's content type, not only the status code: a 200 with text/html would mean the fallback is catching files too, which the status code alone cannot show. Notes the trade-off that a genuinely missing asset now returns index.html with 200 instead of 404.
|
Pushed What changed The instructions no longer say to edit the site config by hand. They create a dedicated conf and enable it, which is what was applied on the VM: sudo tee /etc/apache2/conf-available/project2-spa.conf ...
sudo a2enconf project2-spa
sudo /usr/sbin/apachectl configtest
sudo systemctl reload apache2Two additions beyond the wording:
The VM step is done and verified I applied it while connected to the VM, so the "Before merging" section is satisfied: And in a real browser: opening One thing to update when convenient: the PR description still says the step is pending and that it edits the site config. Not worth another commit, but the text no longer matches the doc. |
The log stopped at the 2026-11-04 M4 rows, so the review rounds that followed were missing from it. Adds one row per piece of work, oldest first: - #77, the millisecond cursor that skipped rows - #72, the guard that counted `pending` while Vitest reports `skipped` - #73, the benchmark that measured the wrong predicate, and what measuring both showed about the index - #78 and #79, the removal interaction test and the truncated sentence - #73/#78, the approvals Gitea invalidated over a moved merge base - #85, the Apache fallback review and the VM verification Rows are factual about what the tool proposed and what was checked afterwards, in the same shape as the existing entries.
Closes #82
Summary
Opening or reloading an album page such as
/project2/album/42on the VM gave an Apache 404. Apache has no file at that path and no fallback toindex.html. The links are full page loads fromBASE_URL, and the Vite dev server always falls back, so this never showed up locally.docs/VM-setup.mdnow has the fix for the Apache site config, plus the commands to check and reload it (apachectl configtest,systemctl reload apache2,curl):I chose this over an
.htaccessfile because Apache on Debian ignores.htaccessby default (AllowOverride None). Built assets are still served as before, and/graphqlis outside/project2/, so the proxy is unaffected.ci.yml: the deploy job now requests/project2/album/1after publishing the client and again in the smoke checks. It fails if Apache doesn't return 200, so a lost fallback breaks the deploy instead of the site.One-line note in the README's Infrastructure section and a row in
docs/AI-USAGE.md.Before merging
Someone with sudo on the VM has to add the
FallbackResourceblock to the Apache site config and reload Apache before this is merged. Otherwise the new deploy check fails on the next push tomain.Verification
prettier --checkpasses on the four changed files.ci.ymlstill parses as YAML.