deploy(forgejo): version the navbar back-link header.tmpl

The Forgejo UI customization (top-left logo replaced with a xetup.x9.cz
back-link) lives in the Forgejo data volume, which is not under git. Keep the
source here with a deploy README so it survives a volume loss.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
X9 Dev 2026-06-03 16:39:48 +02:00
parent 1856f1df4a
commit d1a387078d
2 changed files with 67 additions and 0 deletions

34
deploy/forgejo/README.md Normal file
View file

@ -0,0 +1,34 @@
# Forgejo customizations
Custom UI tweaks for the `xetup-forgejo` instance (git.xetup.x9.cz). These live
in the Forgejo data volume (`xetup_forgejo-data`), which is NOT under git, so the
source of truth is kept here and deployed into the container.
## Files
- `templates/custom/header.tmpl` - injected into `<head>` on every page. Replaces
the meaningless Forgejo brand logo (top-left navbar) with a back-link to
`xetup.x9.cz`. Pure CSS for the look; a small inline script retargets the
`#navbar-logo` href.
## Deploy
Custom templates are read at startup, so a restart is required after any change.
```bash
# Path inside the container: GITEA_CUSTOM=/data/gitea
docker exec xetup-forgejo sh -c 'mkdir -p /data/gitea/templates/custom'
docker cp deploy/forgejo/templates/custom/header.tmpl \
xetup-forgejo:/data/gitea/templates/custom/header.tmpl
docker exec xetup-forgejo sh -c 'chown -R git:git /data/gitea/templates'
docker restart xetup-forgejo
```
The runner (`xetup-runner`) reconnects on its own after the restart.
## Verify
```bash
curl -s http://localhost:3100/x9/xetup/releases | grep -q 'content: "xetup.x9.cz"' \
&& echo "header.tmpl injected" || echo "NOT injected"
```

View file

@ -0,0 +1,33 @@
<style>
/* The Forgejo brand in the top-left has no meaning for us; turn it into a
back-link to the main site (xetup.x9.cz). Pure CSS for the look, a tiny
script below retargets the href. */
#navbar-logo img { display: none !important; }
#navbar-logo {
display: inline-flex !important;
align-items: center;
gap: .35rem;
padding: .35rem .7rem !important;
border: 1px solid var(--color-secondary, #d4d7dc);
border-radius: 6px;
font-weight: 600;
line-height: 1;
white-space: nowrap;
}
#navbar-logo::before { content: "\2190"; font-size: 1.05em; }
#navbar-logo::after { content: "xetup.x9.cz"; }
#navbar-logo:hover {
background: var(--color-hover, rgba(0,0,0,.05));
border-color: var(--color-primary, #4078c0);
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function () {
var logo = document.getElementById('navbar-logo');
if (logo) {
logo.setAttribute('href', 'https://xetup.x9.cz');
logo.setAttribute('aria-label', 'Zpet na xetup.x9.cz');
logo.setAttribute('title', 'Zpet na xetup.x9.cz');
}
});
</script>