Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Customize the instance from an instance repository

6ce635a84ad5d5d0c862d4deb4d46489dc97c677 · Keenan Nemetz · 1d ago · parent f2fd4024

Customize the instance from an instance repository

The landing page's prose was config-only, so changing it meant editing
vole.toml on the host and restarting, and the packaged service cannot write
that file. Custom CSS, assets, and a favicon had nowhere to live at all.

This adds an instance repository, modelled on GitHub's .github repository:
fixed paths in one private repository, read as data rather than executed.

    profile/README.md           the landing page introduction
    profile/private/README.md   replaces it for signed-in viewers
    profile/custom.css          loaded after the built-in stylesheets
    profile/favicon.svg         favicon override
    assets/                     served at /static/custom/assets/

forge/instancerepo reads one commit into an immutable snapshot on a two
second timer and swaps it atomically; a request never runs git, and a load
failure keeps the previous theme. Markdown goes through the issue sanitiser,
assets are an extension whitelist with size and count caps, and scripts and
HTML are not assets. The repository is private to instance admins and hidden
from the home grid and activity rail, but its files are served to visitors.

The Admin Configuration tab grows an Instance repository panel: status, the
last commit, the last load error, the clone URL, the recognized paths, and a
button that creates the repository with starter files. The home page's pencil
keeps the in-place editor, but a save is now a commit to profile/README.md
with the admin as the author and web.home.intro in the audit log, instead of a
row in users.db.

The rest of the landing page stays in the shape it had: instance_name as the
heading, the introduction card, then the repository grid beside the Latest
rail. Moving a configurable page layout into a template system was tried and
dropped: this is fixed files, not a templating surface.

This replaces the pending introduction-store change, which is closed.

server/web/admin.go +5−2

@@ -48,7 +48,7 @@ type adminPageView struct {
48 48 Tab string
49 49 Tabs []adminTab
50 50
51 // Overview, storage, runners, and configuration.
51 // Overview, storage, runners, configuration, and landing page.
52 52 Accounts int
53 53 Repos int
54 54 Started time.Time
@@ -61,6 +61,9 @@ type adminPageView struct {
61 61 RunnerWindow string
62 62 Config *statusConfigView
63 63
64 // InstanceRepo is the Configuration tab's Instance repository panel.
65 InstanceRepo instanceRepoView
66
64 67 // AccountSummary is the overview's counts, derived from the roster the users
65 68 // directory lists.
66 69 AccountSummary adminAccountSummary
@@ -148,7 +151,7 @@ func (w *Web) adminView(r *http.Request, tab, msg string) adminPageView {
148 151 case "audit":
149 152 v.Audit = w.auditView(r)
150 153 default:
151 w.fillStatusView(&v)
154 w.fillStatusView(r, &v)
152 155 }
153 156 return v
154 157 }