internal/web/templates/settings.html

7756246a087737fe2633ac6e794424e139120737
gitbay/internal/web/templates/settings.html history · blame · raw

190 lines · 10404 bytes

  1{{define "width"}}bounded{{end}}
  2{{define "title"}}settings · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
  3{{define "content"}}
  4{{$base := printf "/%s/%s/settings" .Repo.OwnerName .Repo.Name}}
  5<h1>Settings</h1>
  6{{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}}
  7
  8<h2>Identity</h2>
  9<form method="post" action="{{$base}}" class="setform">
 10  <input type="hidden" name="field" value="description">
 11  <label for="description">Description</label>
 12  <input type="text" id="description" name="description" value="{{.Desc}}" placeholder="one line, shown in listings">
 13  <button type="submit" class="btn">Save description</button>
 14</form>
 15<form method="post" action="{{$base}}" class="setform">
 16  <input type="hidden" name="field" value="website">
 17  <label for="website">Website</label>
 18  <input type="text" id="website" name="website" value="{{.Repo.Settings.Website}}" placeholder="https://example.org">
 19  <button type="submit" class="btn">Save website</button>
 20</form>
 21{{if .Branches}}<form method="post" action="{{$base}}" class="setform">
 22  <input type="hidden" name="field" value="default-branch">
 23  <label for="default-branch">Default branch</label>
 24  <select id="default-branch" name="default-branch">
 25    {{$cur := .Repo.DefaultBranch}}{{range .Branches}}<option value="{{.Name}}"{{if eq .Name $cur}} selected{{end}}>{{.Name}}</option>{{end}}
 26  </select>
 27  <button type="submit" class="btn">Save default branch</button>
 28</form>
 29{{end}}<form method="post" action="{{$base}}" class="setform stack">
 30  <input type="hidden" name="field" value="topics">
 31  <label for="topics-add">Topics to add</label>
 32  <input type="text" id="topics-add" name="add" placeholder="add, space-separated">
 33  <label for="topics-remove">Topics to remove</label>
 34  <input type="text" id="topics-remove" name="remove" placeholder="remove">
 35  <button type="submit" class="btn">Apply</button>
 36</form>
 37{{if .Topics}}<p class="meta">{{range .Topics}}<span class="chip topic">{{.}}</span> {{end}}</p>{{end}}
 38
 39<h2>Access</h2>
 40<form method="post" action="{{$base}}" class="setform">
 41  <input type="hidden" name="field" value="visibility">
 42  <label for="visibility">Visibility</label>
 43  <select id="visibility" name="visibility">
 44    <option value="public"{{if eq .Repo.Visibility "public"}} selected{{end}}>Public</option>
 45    <option value="private"{{if eq .Repo.Visibility "private"}} selected{{end}}>Private</option>
 46  </select>
 47  <button type="submit" class="btn">Save visibility</button>
 48</form>
 49<form method="post" action="{{$base}}" class="setform">
 50  <input type="hidden" name="field" value="git-daemon">
 51  <label for="git-daemon">Serve over git://</label>
 52  <input type="checkbox" id="git-daemon" name="git-daemon" value="on"{{if .Repo.Settings.GitDaemon}} checked{{end}}>
 53  <button type="submit" class="btn">Save git://</button>
 54</form>
 55
 56<h2>Merge gates</h2>
 57<p class="meta">Checked before a merge, in this order: checks, approvals, resolved threads, signatures.</p>
 58<form method="post" action="{{$base}}" class="setform">
 59  <input type="hidden" name="field" value="require-checks">
 60  <label for="require-checks">Require green checks</label>
 61  <input type="checkbox" id="require-checks" name="require-checks" value="on"{{if .Repo.Settings.RequireChecks}} checked{{end}}>
 62  <button type="submit" class="btn">Save checks</button>
 63</form>
 64<form method="post" action="{{$base}}" class="setform">
 65  <input type="hidden" name="field" value="require-approvals">
 66  <label for="approvals">Required approvals</label>
 67  <input type="number" id="approvals" name="approvals" min="0" max="10" value="{{.Repo.Settings.RequireApprovals}}">
 68  <button type="submit" class="btn">Save approvals</button>
 69</form>
 70<form method="post" action="{{$base}}" class="setform">
 71  <input type="hidden" name="field" value="require-resolved">
 72  <label for="require-resolved">Require resolved threads</label>
 73  <input type="checkbox" id="require-resolved" name="require-resolved" value="on"{{if .Repo.Settings.RequireResolved}} checked{{end}}>
 74  <button type="submit" class="btn">Save threads</button>
 75</form>
 76<form method="post" action="{{$base}}" class="setform">
 77  <input type="hidden" name="field" value="require-codeowners">
 78  <label for="require-codeowners">Require CODEOWNERS approval</label>
 79  <input type="checkbox" id="require-codeowners" name="require-codeowners" value="on"{{if .Repo.Settings.RequireCodeowners}} checked{{end}}>
 80  <button type="submit" class="btn">Save CODEOWNERS</button>
 81</form>
 82<form method="post" action="{{$base}}" class="setform">
 83  <input type="hidden" name="field" value="require-signed">
 84  <label for="require-signed">Require signed commits</label>
 85  <input type="checkbox" id="require-signed" name="require-signed" value="on"{{if .Repo.Settings.RequireSignedCommits}} checked{{end}}>
 86  <button type="submit" class="btn">Save signing</button>
 87</form>
 88
 89<h2>Protected branches</h2>
 90{{if .Repo.Settings.ProtectedBranches}}
 91<ul class="protlist">
 92{{range .Repo.Settings.ProtectedBranches}}<li><code>{{.}}</code>
 93  <form method="post" action="{{$base}}" class="inline">
 94    <input type="hidden" name="field" value="unprotect">
 95    <input type="hidden" name="branch" value="{{.}}">
 96    <button type="submit" class="linklike">Unprotect</button>
 97  </form></li>
 98{{end}}
 99</ul>
100{{else}}<p class="meta">No protected branches. A protected branch refuses deletion and force-pushes.</p>{{end}}
101<form method="post" action="{{$base}}" class="setform">
102  <input type="hidden" name="field" value="protect">
103  <label for="branch">Protect a branch</label>
104  <select id="branch" name="branch">
105    {{range .Branches}}<option value="{{.Name}}">{{.Name}}</option>{{end}}
106  </select>
107  <button type="submit" class="btn">Protect</button>
108</form>
109<form method="post" action="{{$base}}" class="setform">
110  <input type="hidden" name="field" value="require-mr">
111  <label for="require-mr">Merge requests only</label>
112  <input type="checkbox" id="require-mr" name="require-mr" value="on"{{if .Repo.Settings.RequireMR}} checked{{end}}>
113  <button type="submit" class="btn">Save merge-only</button>
114</form>
115<p class="meta">With merge requests only, a protected branch refuses every direct push once it exists; the merge gates above are then what a change has to pass.</p>
116
117<h2>Protected tags</h2>
118{{if .Repo.Settings.ProtectedTags}}
119<ul class="protlist">
120{{range .Repo.Settings.ProtectedTags}}<li><code>{{.}}</code>
121  <form method="post" action="{{$base}}" class="inline">
122    <input type="hidden" name="field" value="unprotect-tag">
123    <input type="hidden" name="glob" value="{{.}}">
124    <button type="submit" class="linklike">Unprotect</button>
125  </form></li>
126{{end}}
127</ul>
128{{else}}<p class="meta">No protected tags. A tag matching a protected glob is created once and refuses moves and deletion. A tag a release is anchored to refuses both regardless.</p>{{end}}
129<form method="post" action="{{$base}}" class="setform">
130  <input type="hidden" name="field" value="protect-tag">
131  <label for="glob">Protect tags matching</label>
132  <input type="text" id="glob" name="glob" placeholder="v*">
133  <button type="submit" class="btn">Protect</button>
134</form>
135
136<h2>Dependencies</h2>
137<form method="post" action="{{$base}}" class="setform">
138  <input type="hidden" name="field" value="deps">
139  <label for="deps">Check for updates</label>
140  <input type="checkbox" id="deps" name="deps" value="on"{{if .DepsEnabled}} checked{{end}}>
141  <button type="submit" class="btn">Save dependency checks</button>
142</form>
143<p class="meta">Compares the manifests on <code>{{.Repo.DefaultBranch}}</code> against
144proxy.golang.org, npm, crates.io, and PyPI once a day, and tracks what is behind
145in an issue. Checking a private repository tells those registries what it
146depends on.</p>
147{{if .DepsEnabled}}
148<p class="meta">Last checked {{if .Deps.LastCheck}}{{when .Deps.LastCheck}}{{else}}never{{end}}{{if .Deps.IssueNumber}} · tracked in <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/issues/{{.Deps.IssueNumber}}">#{{.Deps.IssueNumber}}</a>{{end}}</p>
149{{if .Deps.LastError}}<p class="error" role="alert">{{.Deps.LastError}}</p>{{end}}
150{{if .Deps.Behind}}<div class="tablewrap"><table class="keys">
151<tr class="cols"><th scope="col">dependency</th><th scope="col">pinned</th><th scope="col">latest</th></tr>
152{{range .Deps.Behind}}<tr>
153  <td class="mono">{{.Ecosystem}} {{.Name}}</td>
154  <td class="mono">{{.Current}}</td>
155  <td class="mono">{{.Latest}}</td>
156</tr>
157{{end}}</table></div>
158{{else}}<p class="none">Nothing behind{{if not .Deps.LastCheck}} — the first check has not run yet{{end}}.</p>{{end}}
159{{end}}
160
161<h2>Runners</h2>
162{{if .Runners}}
163<ul class="protlist">
164{{range .Runners}}<li><code>{{.Fingerprint}}</code> <span class="meta">{{.Username}}{{if .LastSeen}}, last poll {{when .LastSeen}}{{else}}, never polled{{end}}{{if .BuildNumber}}, running {{.BuildRepo}} #{{.BuildNumber}} {{.BuildJob}}{{end}}</span>
165  <form method="post" action="{{$base}}" class="inline">
166    <input type="hidden" name="field" value="runner-remove">
167    <input type="hidden" name="fingerprint" value="{{.Fingerprint}}">
168    <button type="submit" class="linklike">Detach</button>
169  </form></li>
170{{end}}
171</ul>
172{{else}}<p class="meta">No runners attached. Builds for this repository run on the runners attached here; a repository with none queues builds nothing claims.</p>{{end}}
173<form method="post" action="{{$base}}" class="setform">
174  <input type="hidden" name="field" value="runner-add">
175  <label for="runner-key">Attach a runner</label>
176  <textarea id="runner-key" name="key" rows="3" placeholder="ssh-ed25519 AAAA… (from gitbay-runner init)"></textarea>
177  <button type="submit" class="btn">Attach</button>
178</form>
179<p class="meta">Install <code>gitbay-runner</code>, run <code>gitbay-runner init</code>, and paste the key it prints. The runner builds your commits with the repository's secrets; merge requests from forks wait unless it runs with <code>-untrusted</code>.</p>
180
181<h2>Lifecycle</h2>
182<form method="post" action="{{$base}}" class="setform">
183  <input type="hidden" name="field" value="archive">
184  <label for="archive">Archived (read-only)</label>
185  <input type="checkbox" id="archive" name="archive" value="on"{{if .Repo.Settings.Archived}} checked{{end}}>
186  <button type="submit" class="btn">Save archive</button>
187</form>
188<p class="meta">Deleting or transferring a repository is a CLI operation:
189<code>gitbay repo delete {{.Repo.OwnerName}}/{{.Repo.Name}} --yes</code></p>
190{{end}}