perf(serve): static boot shell, gzip and immutable caching for the hashed assets

Measured against the live host:
- the shell shipped no Content-Encoding, so every visit moved 139 KB of JS raw
  -> gzip on (level 5, vary, text/js/css/json/svg/woff2): 139,433 B -> 49,835 B
- /static/* is content-hashed but had no cache header -> max-age=31536000, immutable;
  index.html is no-cache so a deploy lands immediately
- try_files fell through to a non-existent index.php -> SPA fallback to index.html
- index.html now carries a boot shell (name, role, 'rendering the resume') so a cold
  load shows the identity instead of an empty dark rectangle while the JS types in
- deploy/nginx/me.hoelee.com.conf is the versioned copy of the live config; README
  documents the Portainer archive deploy path, the Tor mirror and the inode pitfall
This commit is contained in:
hoelee committed 2026-11-13 22:40:22 +08:00
1 parent 7f8ac893d0
commit 5727ab0c8a
3 files changed
+110 -5

No files matched your search

+26 -4
View File
@@ -30,7 +30,7 @@ see Credits.
| Path | Purpose |
| --- | --- |
| `src/App.vue` | Desktop layout — orchestrates the typewriter sequence |
| `src/Mobile.vue` | Mobile layout (used when viewport ≤ 500px) |
| `src/Mobile.vue` | Mobile/tablet layout (used when viewport ≤ 900px) |
| `src/config/profile.js` | **All content lives here** — details, Markdown, animation speed, typed CSS |
| `src/components/StyleEditor.vue` | Left panel: highlighted, self-typing CSS |
| `src/components/ResumeEditor.vue` | Right panel: resume markdown → HTML |
@@ -67,7 +67,7 @@ Requires Node ≥ 18 (built and tested on Node 24).
## Deployment
Pushed to **Gitea only** — `git.hoelee.com/hoelee/hoelee-profile`. There is no GitHub mirror.
Source of truth: **Gitea** — `git.hoelee.com/hoelee/hoelee-profile` (mirrored to GitHub).
`me.hoelee.com` is served by an `nginx:alpine` container (`nginx-me.hoelee.com`) on the VPS at
`41.216.187.102`, behind Traefik. The container mounts the built site read-only:
@@ -84,8 +84,30 @@ npm run build
rsync -av --delete dist/ [email protected]:/docker/web/me.hoelee.com/public/
```
The site is static — no PHP or database is used. The `php:9000` upstream in the nginx config is a
leftover from the shared web template and is not needed by this site.
Without SSH the same build can be pushed over the Portainer Docker API with a tar archive
(`PUT /api/endpoints/4/docker/containers/php-me.hoelee.com/archive?path=/var/www/html`) — that
container is the writable side of the mount. Remove stale `static/js/index-*.js` bundles in place;
do **not** delete and recreate the directory, because the read-only bind mount keeps pointing at the
old inode and nginx starts returning 403.
### Tor mirror
The same container is published as a Tor onion service — the unRaid `tor-server` maps
`hoeleeaiwowgndbxswegtdzoeupz7lkkechtqmurbmnpvwa4k3vyuyid.onion` to `41.216.187.102:10001`, which is
this nginx. There is no second copy of the site: one deploy updates clearnet and onion together.
### nginx config
`deploy/nginx/me.hoelee.com.conf` is the versioned copy of the live config (gzip on, immutable
caching for the hashed `static/` assets, SPA fallback to `index.html`). To apply:
```bash
scp deploy/nginx/me.hoelee.com.conf [email protected]:/docker/web/me.hoelee.com/nginx/default.conf
ssh [email protected] 'docker exec nginx-me.hoelee.com nginx -t && docker exec nginx-me.hoelee.com nginx -s reload'
```
The site is static — no PHP or database is used. The `php:9000` sidecar is a leftover from the shared
web template and is not needed by this site.
## Credits