From bb6bc2387d58c737dbf92e73f8544bf39319dbd8 Mon Sep 17 00:00:00 2001 From: Lena Date: Sat, 1 Aug 2026 00:00:00 +0000 Subject: Enter git-forge A small self-hosted git forge: HTTP push and pull, cgit browsing, local and OIDC accounts, TOTP, scoped push tokens, per-repo permissions, issues, a wiki, and outbound mail. It does not reimplement git. git-http-backend and cgit run as CGI behind its own listener, which authorises every request before exec'ing either. One binary, one data directory, one listener: no database, no JavaScript, and state is JSON in a git repo with a working tree. --- templates/admin.html | 236 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 templates/admin.html (limited to 'templates/admin.html') diff --git a/templates/admin.html b/templates/admin.html new file mode 100644 index 0000000..871b061 --- /dev/null +++ b/templates/admin.html @@ -0,0 +1,236 @@ +{{define "title"}}Admin - {{.Site}}{{end}} +{{define "main"}} +

This instance

+
+ +

+ + +

+

+ + +

+
+Logo +

+{{if .Data.Site.Logo.Name}} +Currently {{.Data.Site.Logo.Name}}. +{{else}} +Currently cgit's own. +{{end}} +

+

+ + + +Drawn in the header at 96 pixels at most, and left at its own size below that. + +

+

+ +

+
+ +
+Favicon +

+{{if .Data.Site.Icon.Name}} +Currently {{.Data.Site.Icon.Name}}. +{{else}} +Currently cgit's own. +{{end}} +

+

+ + + +Served at /favicon.ico, whatever type it is. + +

+

+ +

+
+

+Both take a png, jpeg, gif, webp, or an icon, up to 512 KiB, and are kept in +the config repository, so they are in the backup and in the history with +everything else. SVG is refused: it is XML that can carry script, and this is +served back to browsers. +

+

+
+

+Everything else in forge.json decides how the process starts, and is left to +the file: a listener or a base url typed into a browser is a way to lock +everybody out. +

+ +

Repositories

+ + + + + +{{range .Data.Repos}} + + + + + + + +{{else}} + +{{end}} +
NameVisibilityIssuesWiki
{{.Path}}{{.Repo.Visibility}}{{.Repo.Issues}}{{.Repo.Wiki}} +{{if not .Registered}} +
+ + + +
+{{end}} +
None yet.
+

+A repository with an adopt button has a directory but no entry in repos.json. +It is served private with issues and wiki off until it is adopted or deleted. +

+ +

Create a repository

+
+ +

+ + +

+

+ + +

+

+ + +

+{{template "knobs" .Data.New}} +

+
+ +

Accounts

+{{with .Data.Link}} +
+One time link for {{$.Data.For}}, valid for two days. It both sets the password +and confirms the address, and it dies the moment it is used. +
+
{{.}}
+{{end}} + + + + + + +{{range $name, $u := .Data.Users}} + + + + + + + +{{end}} +
AccountOriginEmailAdminSecond factor
{{$name}}{{$u.Origin}}{{with $u.Email}}{{.}}{{if not $u.EmailConfirmed}} unconfirmed{{end}}{{end}}{{if $u.Admin}}yes{{end}}{{if $u.TOTP}}yes{{else}}none{{end}}
+ +

Create an account

+

+Creating an account issues a one time set-password link rather than a password, +so an admin never handles one. That link is a way in that outlives this session, +so this asks for your own authenticator code. +

+
+ +

+ + +

+

+ + +

+

+ + +

+

+The admin flag is not set here. Handing it out is its own act, below. +

+

+
+ +
+

Changes that hand out power, or cannot be undone

+

+Each of these asks for your own authenticator code as well, so that a session +somebody else is sitting in front of cannot use them. +

+ +

Admin flag

+
+ +

+ + +

+

+ +

+

+ + +

+

+
+ +

Clear an authenticator

+

+The way back in for somebody who has lost both their authenticator and their +recovery codes. It signs every session for that account out. +

+
+ +

+ + +

+

+ + +

+

+
+ +

Delete an account

+

This also drops every grant that pointed at it.

+
+ +

+ + +

+

+ + +

+

+
+
+{{end}} -- cgit v1.2.3