Simple conetent + restyled

This commit is contained in:
2026-09-21 17:59:29 +02:00
parent 0772462742
commit 467bf77d34
55 changed files with 2162 additions and 2070 deletions
+36 -3
View File
@@ -29,6 +29,37 @@ missing). Everything else runs inside containers.
| 3000 | Gitea | https://astro-git.isl-dev.grid.cyfronet.pl (ingress vhost) |
| 8080 | portal (nginx, static) | https://astro.isl-dev.grid.cyfronet.pl (ingress vhost) |
## Switch an existing demo to `simple`
1. In a checkout of `ctao/content`, create a `simple` branch from the existing
content branch. Copy `sample-content/pages/*.md` and
`sample-content/uploads/hero.jpg` from this code repository into its root
`pages/` and `uploads/` directories, then commit the seed files. Existing
news or other page files can remain in the content history; this portal
loads only the four Example files.
2. Push the content branch to Gitea as `ctao/content:simple`, and the code
branch as `ctao/portal:simple`. These are separate pushes; Bitbucket is
not the deployment remote.
3. Copy the updated `build.sh` to `~/ctao-portal-demo/bin/build.sh` and the
updated `ctao-portal-build.service` to `~/.config/systemd/user/`. Reload
systemd with `systemctl --user daemon-reload`. The service explicitly sets
`CODE_BRANCH=simple` and `CONTENT_BRANCH=simple`; the script defaults agree.
4. Start the build service or let its timer run. It overlays `pages/` and
`uploads/`, clears the previous news overlay, and runs `npm run check`
before the atomic release switch. Missing Example pages fail the build.
5. Verify the four `/example/…/` pages and empty `/news/`. Sign in at `/admin/`,
save an Example title, and check that a commit appears on
`ctao/content:simple` and the rebuilt page reflects it.
The OAuth client and public portal origin stay the same. Sveltia's
`backend.branch` in `public/admin/config.yml` must always match
`CONTENT_BRANCH`. Branches are selected independently; a single `BRANCH`
environment variable is no longer used. For a separate preview hostname,
update the site origin, OAuth redirect, and Gitea CORS together.
To roll back, restore the previous deployed release and the previous worker
script/service configuration. The original content `main` branch is retained.
## Install (each step reviewed before running; [W] = writes to the machine)
1. **[W]** `loginctl enable-linger $USER`. Without lingering every user unit
@@ -53,10 +84,12 @@ missing). Everything else runs inside containers.
password never lands in a file or shell history:
`podman exec -it ctao-demo-gitea gitea admin user create --admin --username <you> --email <you@…> --random-password`
7. **[W]** In the Gitea UI: create org `ctao` with repos `portal` and
`content` (both public read). Then, from your workstation, push both over
`content` (both public read). Seed the content `simple` branch with
`sample-content/pages/` and `sample-content/uploads/` as described above.
Then, from your workstation, push both over
the vhost with a repo-scoped token:
`git push https://<user>:<token>@astro-git.isl-dev.grid.cyfronet.pl/ctao/portal.git main`
`git push https://<user>:<token>@astro-git.isl-dev.grid.cyfronet.pl/ctao/content.git main`
`git push https://<user>:<token>@astro-git.isl-dev.grid.cyfronet.pl/ctao/portal.git simple`
`git push https://<user>:<token>@astro-git.isl-dev.grid.cyfronet.pl/ctao/content.git simple`
8. **[W]** `systemctl --user enable --now ctao-portal-build.timer`. The first run
clones + `npm ci` + builds (minutes); later runs are seconds. Wait until
`journalctl --user -u ctao-portal-build -n 5` shows `published <sha>`