feat: name the site with SITE_TITLE, and the tab after the community #20

Open
bot-genji1024 wants to merge 1 commit from feat/site-title into main
Collaborator
  • SITE_TITLE in .env (default koto) names the site where the server has not been asked yet. At container start render-config.sh writes it into index.html (<title>, apple-mobile-web-app-title), the manifest (name, short_name) and config.json (siteTitle). The image keeps the build's index.html and manifest in /etc/koto and renders from those, so a restart or a changed value starts afresh. The value is escaped for HTML and JSON.
  • The browser tab after login follows the community's name (the header, changed in the settings), and goes back to SITE_TITLE after logging out.
  • Notifications that name no sender take siteTitle from the config the service worker has cached, falling back to koto.
  • A new community starts with SITE_TITLE as its name.
  • .env.example and docs/deployment.md describe the setting. Previews get no siteTitle and stay "koto".

Existing installs: nothing changes until SITE_TITLE is set; then docker compose up -d --build. An installed home-screen app may keep its old name until it is re-added; that is up to the phone.

Tested: tsc, oxlint, unit tests. I built the image and ran it with SITE_TITLE=ちひろ "&" <ノート> a\b|c and with it empty: index.html, the manifest and config.json came out correctly escaped (both JSON files parse), stayed correct after a restart, and nginx served them. I could not run the browser E2E: on this host (swap full) the first page load timed out at 30 s, and the same happened on unchanged main.

Closes #19

- **`SITE_TITLE`** in `.env` (default `koto`) names the site where the server has not been asked yet. At container start `render-config.sh` writes it into index.html (`<title>`, `apple-mobile-web-app-title`), the manifest (`name`, `short_name`) and `config.json` (`siteTitle`). The image keeps the build's index.html and manifest in `/etc/koto` and renders from those, so a restart or a changed value starts afresh. The value is escaped for HTML and JSON. - **The browser tab after login** follows the community's name (the header, changed in the settings), and goes back to `SITE_TITLE` after logging out. - **Notifications** that name no sender take `siteTitle` from the config the service worker has cached, falling back to koto. - **A new community** starts with `SITE_TITLE` as its name. - `.env.example` and `docs/deployment.md` describe the setting. Previews get no `siteTitle` and stay "koto". Existing installs: nothing changes until `SITE_TITLE` is set; then `docker compose up -d --build`. An installed home-screen app may keep its old name until it is re-added; that is up to the phone. Tested: `tsc`, `oxlint`, unit tests. I built the image and ran it with `SITE_TITLE=ちひろ "&" <ノート> a\b|c` and with it empty: index.html, the manifest and config.json came out correctly escaped (both JSON files parse), stayed correct after a restart, and nginx served them. I could not run the browser E2E: on this host (swap full) the first page load timed out at 30 s, and the same happened on unchanged main. Closes #19
feat: name the site with SITE_TITLE, and the tab after the community
All checks were successful
ci / check (pull_request) Successful in 1m2s
c0218aff39
The browser tab, the installed app's name and push notifications without a
sender all said "koto" whatever the community was called.

SITE_TITLE in .env (default koto) is written at container start into
index.html's title, the manifest's name and config.json; the service worker
reads it from the cached config for notification titles, and a new
community starts with it as its name. After login the tab follows the
community's name, which the admin changes in the settings.

Closes #19
All checks were successful
ci / check (pull_request) Successful in 1m2s
Required
Details
This pull request is blocked because it is missing approval from one or more official reviewers.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/site-title:feat/site-title
git switch feat/site-title
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
genji1024/koto!20
No description provided.