internal/web/templates/settings.html

545ba0bcdea3b534903bd78c918c0c025a97eda7
gitbay/internal/web/templates/settings.html

415 lines · 29448 bytes

  1{{define "width"}}wide{{end}}
  2{{define "title"}}settings · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
  3{{define "content"}}
  4{{$base := printf "/%s/%s/settings" .Repo.OwnerName .Repo.Name}}
  5<div class="pagehead">
  6  <h1>Settings</h1>
  7</div>
  8{{if .Notice}}{{if .Saved}}<p class="notice" role="status">{{.Notice}}</p>{{else}}<p class="error" role="alert">{{.Notice}}{{if .Reauth}} <a href="/login">Sign in again</a>{{end}}</p>{{end}}{{end}}
  9<div class="withcol narrow">
 10<nav class="sidecol sticky" aria-label="Sections" data-scrollspy="1">
 11<details class="sidedrop">
 12<summary><span class="sideword">Sections</span></summary>
 13  <div class="grp"><h2 class="colhead">Sections</h2>
 14  <ul>
 15    <li><a href="#identity">Identity</a></li>
 16    <li><a href="#access">Access</a></li>
 17    <li><a href="#webhooks">Webhooks</a></li>
 18    <li><a href="#gates">Merge gates</a></li>
 19    {{if or .ScanAvailable .Security.Enabled}}<li><a href="#security">Code scanning</a></li>{{end}}
 20    <li><a href="#secrets">Secret scan</a></li>
 21    <li><a href="#branches">Protected branches</a></li>
 22    <li><a href="#tags">Protected tags</a></li>
 23    <li><a href="#deps">Dependencies</a></li>
 24    <li><a href="#runners">Runners</a></li>
 25    <li><a href="#lifecycle">Lifecycle</a></li>
 26  </ul></div>
 27</details>
 28</nav>
 29<div class="colmain">
 30
 31<section id="identity" class="setcard"><h2>Identity</h2>
 32<form method="post" action="{{$base}}" class="setform">
 33  <input type="hidden" name="field" value="description">
 34  <div><label for="description">Description</label></div>
 35  <div><input type="text" id="description" name="description" value="{{or (index .Submitted "description") .Desc}}" placeholder="one line, shown in listings"></div>
 36  <div><button type="submit">Save</button></div>
 37</form>
 38<form method="post" action="{{$base}}" class="setform">
 39  <input type="hidden" name="field" value="website">
 40  <div><label for="website">Website</label></div>
 41  <div><input type="text" id="website" name="website" value="{{or (index .Submitted "website") .Repo.Settings.Website}}" placeholder="https://example.org"></div>
 42  <div><button type="submit" class="btn">Save</button></div>
 43</form>
 44<form method="post" action="{{$base}}" class="setform">
 45  <input type="hidden" name="field" value="topics">
 46  <div><label for="topics">Topics</label><p class="hint">Comma separated, lower case.</p></div>
 47  <div><input type="text" id="topics" name="topics" value="{{or (index .Submitted "topics") (join .Topics ", ")}}"></div>
 48  <div><button type="submit" class="btn">Save</button></div>
 49</form>
 50{{if .Branches}}<form method="post" action="{{$base}}" class="setform" data-autosave="1">
 51  <input type="hidden" name="field" value="default-branch">
 52  <div><label for="default-branch">Default branch</label></div>
 53  <div><select id="default-branch" name="default-branch">{{$cur := .Repo.DefaultBranch}}{{range .Branches}}<option value="{{.Name}}"{{if eq .Name $cur}} selected{{end}}>{{.Name}}</option>{{end}}</select></div>
 54  <div><button type="submit" class="btn">Save</button></div>
 55</form>{{end}}
 56</section>
 57
 58<section id="access" class="setcard"><h2>Access</h2>
 59<form method="post" action="{{$base}}" class="setform">
 60  <input type="hidden" name="field" value="visibility">
 61  <div><span class="fieldname">Visibility</span></div>
 62  <div class="check">
 63    <label><input type="radio" name="visibility" value="public"{{if eq .Repo.Visibility "public"}} checked{{end}}> Public</label>
 64    <label><input type="radio" name="visibility" value="private"{{if eq .Repo.Visibility "private"}} checked{{end}}> Private</label>
 65  </div>
 66  <div><button type="submit" class="btn">Save</button></div>
 67</form>
 68<form method="post" action="{{$base}}" class="setform" data-autosave="1">
 69  <input type="hidden" name="field" value="git-daemon">
 70  <div><label for="git-daemon">Serve over git://</label><p class="hint">Public repositories only.</p></div>
 71  <div class="check"><input type="checkbox" id="git-daemon" name="git-daemon" value="on"{{if .Repo.Settings.GitDaemon}} checked{{end}}></div>
 72  <div><button type="submit" class="btn">Save</button></div>
 73</form>
 74<h3>Who can reach this repository</h3>
 75{{if .Access}}<div class="tablewrap"><table class="keys">
 76<thead><tr class="cols"><th scope="col">user</th><th scope="col">role</th><th scope="col">via</th><th scope="col"><span class="vh">actions</span></th></tr></thead>
 77<tbody>{{range .Access}}<tr>
 78  <td class="mono"><a href="/{{.User}}">{{.User}}</a></td>
 79  <td>{{.Role}}</td>
 80  <td>{{.Source}}</td>
 81  <td class="act">{{if eq .Source "direct"}}<form method="post" action="{{$base}}" class="inline">
 82    <input type="hidden" name="field" value="access-revoke">
 83    <input type="hidden" name="user" value="{{.User}}">
 84    <button type="submit" class="danger">Revoke</button>
 85  </form>{{end}}</td>
 86</tr>{{end}}</tbody></table></div>
 87{{else}}<p class="meta">Nobody else can reach it.</p>{{end}}
 88<form method="post" action="{{$base}}" class="setform">
 89  <input type="hidden" name="field" value="access-grant">
 90  <div><label for="grant-user">Grant access</label><p class="hint">An account name and a role. A grant adds to what an organization or team already gives.</p></div>
 91  <div><input type="text" id="grant-user" name="user" value="{{index .Submitted "user"}}" autocomplete="off" spellcheck="false" placeholder="username">
 92  <select name="role" aria-label="Role">{{$role := index .Submitted "role"}}<option value="read"{{if eq $role "read"}} selected{{end}}>read</option><option value="write"{{if eq $role "write"}} selected{{end}}>write</option><option value="admin"{{if eq $role "admin"}} selected{{end}}>admin</option></select></div>
 93  <div><button type="submit" class="btn">Grant</button></div>
 94</form>
 95</section>
 96
 97<section id="webhooks" class="setcard"><h2>Webhooks</h2>
 98{{if .Hooks}}
 99<ul class="protlist">
100{{range .Hooks}}<li><span class="mono">#{{.ID}}</span> <code>{{.URL}}</code> <span class="meta">{{.Events}}{{if .Secret}}, signed{{end}}</span>
101  <form method="post" action="{{$base}}" class="inline">
102    <input type="hidden" name="field" value="webhook-remove">
103    <input type="hidden" name="id" value="{{.ID}}">
104    <button type="submit" class="danger">Remove</button>
105  </form></li>
106{{end}}
107</ul>
108{{else}}<p class="meta">No webhooks.</p>{{end}}
109<details class="editbox"{{if or (index .Submitted "url") (index .Submitted "events")}} open{{end}}>
110  <summary>Add a webhook</summary>
111  <form method="post" action="{{$base}}" class="setform stack" autocomplete="off">
112    <input type="hidden" name="field" value="webhook-add">
113    <label for="hook-url">Payload URL</label>
114    <input type="text" id="hook-url" name="url" value="{{index .Submitted "url"}}" placeholder="https://ci.example.org/hook" spellcheck="false">
115    <label for="hook-events">Events</label>
116    <p class="hint">Comma separated, or <code>*</code> for all.</p>
117    <input type="text" id="hook-events" name="events" value="{{or (index .Submitted "events") "*"}}" spellcheck="false">
118    <label for="hook-secret">Secret</label>
119    <p class="hint">Optional. Signs each delivery; it is not shown again.</p>
120    <input type="password" id="hook-secret" name="secret" value="" autocomplete="new-password">
121    <span class="btngroup"><button type="submit">Add webhook</button></span>
122  </form>
123</details>
124<h3>Recent deliveries</h3>
125{{if .Deliveries}}<div class="tablewrap"><table class="keys">
126<thead><tr class="cols"><th scope="col">id</th><th scope="col">event</th><th scope="col">url</th><th scope="col">state</th><th scope="col"><span class="vh">actions</span></th></tr></thead>
127<tbody>{{range .Deliveries}}<tr>
128  <td class="mono">{{.ID}}</td>
129  <td>{{.Event}}</td>
130  <td class="mono">{{.URL}}</td>
131  <td>{{.Status}} ({{.Attempts}} attempts){{if .LastError}}<br><span class="meta">{{.LastError}}</span>{{end}}</td>
132  <td class="act"><form method="post" action="{{$base}}" class="inline">
133    <input type="hidden" name="field" value="webhook-redeliver">
134    <input type="hidden" name="delivery" value="{{.ID}}">
135    <button type="submit" class="btn">Redeliver</button>
136  </form></td>
137</tr>{{end}}</tbody></table></div>
138{{else}}<p class="meta">Nothing delivered yet.</p>{{end}}
139</section>
140
141<section id="gates" class="setcard"><h2>Merge gates</h2>
142<p class="meta">Checked before a merge, in this order: checks, approvals, resolved threads, signatures.</p>
143<form method="post" action="{{$base}}" class="setform" data-autosave="1">
144  <input type="hidden" name="field" value="require-checks">
145  <div><label for="require-checks">Required checks</label><p class="hint">Requires CI to succeed.{{with .Repo.Settings.RequiredContexts}} Also waits for {{range $i, $c := .}}{{if $i}}, {{end}}<code>{{$c}}</code>{{end}} until they report{{if not $.Repo.Settings.RequireChecks}}, once this is on{{end}}.{{end}}</p></div>
146  <div class="check"><input type="checkbox" id="require-checks" name="require-checks" value="on"{{if .Repo.Settings.RequireChecks}} checked{{end}}></div>
147  <div><button type="submit" class="btn">Save</button></div>
148</form>
149<form method="post" action="{{$base}}" class="setform">
150  <input type="hidden" name="field" value="require-contexts">
151  <div><label for="contexts">Required contexts</label><p class="hint">Statuses the checks gate waits for until they report, separated by spaces. Saving any turns required checks on; saving none leaves it as it is.</p></div>
152  <div><input type="text" id="contexts" name="contexts" value="{{range $i, $c := .Repo.Settings.RequiredContexts}}{{if $i}} {{end}}{{$c}}{{end}}" autocomplete="off"></div>
153  <div><button type="submit" class="btn">Save</button></div>
154</form>
155<form method="post" action="{{$base}}" class="setform">
156  <input type="hidden" name="field" value="require-approvals">
157  <div><label for="approvals">Approvals</label><p class="hint">Approvals from anyone with write access. Zero means none required.</p></div>
158  <div class="num"><input type="number" id="approvals" name="approvals" min="0" max="10" value="{{.Repo.Settings.RequireApprovals}}"></div>
159  <div><button type="submit" class="btn">Save</button></div>
160</form>
161<form method="post" action="{{$base}}" class="setform" data-autosave="1">
162  <input type="hidden" name="field" value="require-resolved">
163  <div><label for="require-resolved">Review threads</label><p class="hint">Every thread on the diff must be resolved before merging.</p></div>
164  <div class="check"><input type="checkbox" id="require-resolved" name="require-resolved" value="on"{{if .Repo.Settings.RequireResolved}} checked{{end}}></div>
165  <div><button type="submit" class="btn">Save</button></div>
166</form>
167<form method="post" action="{{$base}}" class="setform" data-autosave="1">
168  <input type="hidden" name="field" value="require-codeowners">
169  <div><label for="require-codeowners">CODEOWNERS</label><p class="hint">Code owners must approve.</p></div>
170  <div class="check"><input type="checkbox" id="require-codeowners" name="require-codeowners" value="on"{{if .Repo.Settings.RequireCodeowners}} checked{{end}}></div>
171  <div><button type="submit" class="btn">Save</button></div>
172</form>
173<form method="post" action="{{$base}}" class="setform" data-autosave="1">
174  <input type="hidden" name="field" value="require-signed">
175  <div><label for="require-signed">Signed commits</label><p class="hint">Every commit in the request must carry a verified signature. Squash and merge strategies are refused, since both mint an unsigned commit.</p></div>
176  <div class="check"><input type="checkbox" id="require-signed" name="require-signed" value="on"{{if .Repo.Settings.RequireSignedCommits}} checked{{end}}></div>
177  <div><button type="submit" class="btn">Save</button></div>
178</form>
179</section>
180
181{{if or .ScanAvailable .Security.Enabled}}<section id="security" class="setcard"><h2>Code scanning</h2>
182<form method="post" action="{{$base}}" class="setform">
183  <input type="hidden" name="field" value="security">
184  <div><label for="security-enabled">Scheduled scan</label><p class="hint">Runs the instance's code scanner over <code>{{.Repo.DefaultBranch}}</code> on its schedule, on a runner attached to this repository, and keeps an issue of what it finds.</p></div>
185  <div class="check"><input type="checkbox" id="security-enabled" name="security" value="on"{{if .Security.Enabled}} checked{{end}}></div>
186  <div><button type="submit" class="btn">Save</button></div>
187</form>
188{{if .ScanAvailable}}<form method="post" action="{{$base}}" class="setform" data-autosave="1">
189  <input type="hidden" name="field" value="security-frequency">
190  <div><label for="security-frequency">Frequency</label><p class="hint">Daily, weekly on Sunday, or monthly on the 1st, at {{printf "%02d:00" .ScanHour}} UTC.</p></div>
191  <div><select id="security-frequency" name="security-frequency">{{$freq := .ScanFrequency}}{{range .ScanFrequencies}}<option value="{{.}}"{{if eq . $freq}} selected{{end}}>{{.}}</option>{{end}}</select></div>
192  <div><button type="submit" class="btn">Save</button></div>
193</form>{{end}}
194{{if .Security.Enabled}}
195<p class="meta">Next scan {{.Security.NextRun}} · last results {{if .Security.LastResults}}{{when .Security.LastResults}}{{else}}never{{end}}{{if .Security.IssueNumber}} · <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/issues/{{.Security.IssueNumber}}">#{{.Security.IssueNumber}}</a>{{end}}</p>
196{{with .Security.Aside}}{{if .Any}}<p class="meta">Set aside by the last scan:{{if .Ignored}} {{.Ignored}} under the paths or rules below, or marked vendored or generated in <code>.gitattributes</code>.{{end}}{{range $lib, $n := .Unused}} {{$n}} from {{$lib}} rules, which no manifest names.{{end}}{{if .Quoted}} {{.Quoted}} unquoted-attribute hits on attributes the template quotes.{{end}}{{if .Unsplit}} {{.Unsplit}} unquoted-expansion hits on expansions the shell does not split.{{end}}{{if .Joined}} {{.Joined}} string-concat-in-list hits on strings joined inside a call, not as a list element.{{end}}{{if .NoReturn}} {{.NoReturn}} return hits on lines with no return statement.{{end}}{{if .Attributes}} {{.Attributes}} is-function-without-parentheses hits on names the repository defines as attributes.{{end}}{{if .InTests}} {{.InTests}} insecure-random hits in tests.{{end}}</p>{{end}}{{end}}
197{{if .Security.Findings}}<div class="tablewrap"><table class="keys">
198<tr class="cols"><th scope="col">location</th><th scope="col">rule</th><th scope="col">level</th><th scope="col"><span class="vh">dismiss</span></th></tr>
199{{range .Security.Findings}}<tr>
200  <td class="mono">{{.Path}}:{{.Line}}</td>
201  <td class="mono">{{.Rule}}</td>
202  <td>{{.Level}}</td>
203  <td><form method="post" action="{{$base}}" class="inline">
204    <input type="hidden" name="field" value="security-dismiss">
205    <input type="hidden" name="fingerprint" value="{{.Fingerprint}}">
206    <select name="reason" aria-label="Reason"><option value="false-positive">False positive</option><option value="wont-fix">Won't fix</option><option value="test">Used in tests</option></select>
207    <button type="submit">Dismiss</button>
208  </form></td>
209</tr>
210{{end}}</table></div>
211{{else if .Security.LastResults}}<p class="none">The last scan found nothing open.</p>{{end}}
212{{if .Security.Dismissed}}<details class="editbox"><summary>Dismissed ({{len .Security.Dismissed}})</summary>
213<p><input type="search" class="tablefilter" placeholder="Filter dismissed findings…" aria-label="Filter dismissed findings" data-filter-table="sec-dismissed"></p>
214<div class="tablewrap"><table class="keys" id="sec-dismissed">
215<thead><tr class="cols"><th scope="col">location</th><th scope="col">rule</th><th scope="col">reason</th><th scope="col"><span class="vh">reopen</span></th></tr></thead>
216<tbody>{{range .Security.Dismissed}}<tr>
217  <td class="mono">{{.Path}}:{{.Line}}</td>
218  <td class="mono">{{.Rule}}</td>
219  <td>{{.Reason}}{{if .DismissedBy}} <span class="meta">by {{.DismissedBy}}</span>{{end}}</td>
220  <td><form method="post" action="{{$base}}" class="inline">
221    <input type="hidden" name="field" value="security-reopen">
222    <input type="hidden" name="fingerprint" value="{{.Fingerprint}}">
223    <button type="submit">Reopen</button>
224  </form></td>
225</tr>
226{{end}}</tbody></table></div></details>{{end}}
227{{end}}
228<form method="post" action="{{$base}}" class="setform">
229  <input type="hidden" name="field" value="security-ignore">
230  <div><label for="security-ignore">Ignored paths</label><p class="hint">Findings under these paths are set aside from the next scan. Path globs separated by spaces: <code>testdata/**</code>, <code>web/templates/*.html</code>. Paths <code>.gitattributes</code> marks <code>linguist-vendored</code> or <code>linguist-generated</code> are set aside without being listed.</p></div>
231  <div><input type="text" id="security-ignore" name="security-ignore" value="{{join .Repo.Settings.SecurityIgnore " "}}"></div>
232  <div><button type="submit" class="btn">Save</button></div>
233</form>
234<form method="post" action="{{$base}}" class="setform">
235  <input type="hidden" name="field" value="security-exclude-rule">
236  <div><label for="security-exclude-rule">Excluded rules</label><p class="hint">Findings from these rules are set aside from the next scan. A rule id or a family of them, separated by spaces: <code>swift.lang.crypto.insecure-random</code>, <code>javascript.browser</code>.</p></div>
237  <div><input type="text" id="security-exclude-rule" name="security-exclude-rule" value="{{join .Repo.Settings.SecurityExcludeRules " "}}"></div>
238  <div><button type="submit" class="btn">Save</button></div>
239</form>
240</section>
241{{end}}
242
243<section id="secrets" class="setcard"><h2>Secret scan</h2>
244<form method="post" action="{{$base}}" class="setform" data-autosave="1">
245  <input type="hidden" name="field" value="secret-scan">
246  <div><label for="secret-scan">Pushes</label><p class="hint">Each push's new files are checked for credentials in known formats. Warn accepts the push and tells the pusher where; block refuses it. Only the path, line and kind of credential are reported, never the value.</p></div>
247  <div><select id="secret-scan" name="secret-scan">{{$mode := or .Repo.Settings.SecretScan "warn"}}<option value="off"{{if eq $mode "off"}} selected{{end}}>off</option><option value="warn"{{if eq $mode "warn"}} selected{{end}}>warn</option><option value="block"{{if eq $mode "block"}} selected{{end}}>block</option></select></div>
248  <div><button type="submit" class="btn">Save</button></div>
249</form>
250<form method="post" action="{{$base}}" class="setform">
251  <input type="hidden" name="field" value="secret-scan-allow">
252  <div><label for="secret-scan-allow">Allowed paths</label><p class="hint">Findings under these paths are ignored, for test fixtures. Path globs separated by spaces: <code>testdata/**</code>, <code>*_test.go</code>.</p></div>
253  <div><input type="text" id="secret-scan-allow" name="secret-scan-allow" value="{{join .Repo.Settings.SecretScanAllow " "}}"></div>
254  <div><button type="submit" class="btn">Save</button></div>
255</form>
256</section>
257
258<section id="branches" class="setcard"><h2>Protected branches</h2>
259{{if .Repo.Settings.ProtectedBranches}}
260<ul class="protlist">
261{{$mr := .Repo.Settings.RequireMR}}{{range .Repo.Settings.ProtectedBranches}}<li><code>{{.}}</code>{{if $mr}} <span class="hint">Direct pushes refused, merge requests only.</span>{{end}}
262  <form method="post" action="{{$base}}" class="inline">
263    <input type="hidden" name="field" value="unprotect">
264    <input type="hidden" name="branch" value="{{.}}">
265    <button type="submit" class="danger">Unprotect</button>
266  </form></li>
267{{end}}
268</ul>
269{{else}}<p class="meta">No protected branches. A protected branch refuses deletion and force-pushes.</p>{{end}}
270<form method="post" action="{{$base}}" class="setform">
271  <input type="hidden" name="field" value="protect">
272  <div><label for="branch">Protect a branch</label></div>
273  <div><select id="branch" name="branch">{{range .Branches}}<option value="{{.Name}}">{{.Name}}</option>{{end}}</select></div>
274  <div><button type="submit" class="btn">Protect</button></div>
275</form>
276<form method="post" action="{{$base}}" class="setform" data-autosave="1">
277  <input type="hidden" name="field" value="require-mr">
278  <div><label for="require-mr">Require merge requests</label><p class="hint">Every protected branch changes through a merge request. A direct push is refused in pre-receive.</p></div>
279  <div class="check"><input type="checkbox" id="require-mr" name="require-mr" value="on"{{if .Repo.Settings.RequireMR}} checked{{end}}></div>
280  <div><button type="submit" class="btn">Save</button></div>
281</form>
282</section>
283
284<section id="tags" class="setcard"><h2>Protected tags</h2>
285{{if .Repo.Settings.ProtectedTags}}
286<ul class="protlist">
287{{range .Repo.Settings.ProtectedTags}}<li><code>{{.}}</code>
288  <form method="post" action="{{$base}}" class="inline">
289    <input type="hidden" name="field" value="unprotect-tag">
290    <input type="hidden" name="glob" value="{{.}}">
291    <button type="submit" class="danger">Unprotect</button>
292  </form></li>
293{{end}}
294</ul>
295{{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}}
296<form method="post" action="{{$base}}" class="setform">
297  <input type="hidden" name="field" value="protect-tag">
298  <div><label for="glob">Protect tags matching</label></div>
299  <div><input type="text" id="glob" name="glob" placeholder="v*"></div>
300  <div><button type="submit" class="btn">Protect</button></div>
301</form>
302</section>
303
304<section id="deps" class="setcard"><h2>Dependencies</h2>
305<form method="post" action="{{$base}}" class="setform">
306  <input type="hidden" name="field" value="deps">
307  <div><label for="deps-enabled">Check for updates and advisories</label><p class="hint">Evaluates the manifests and lockfiles on <code>{{.Repo.DefaultBranch}}</code> against the registries and OSV, and opens an issue for each. Updates for Go, NPM, Crates, and PyPI; advisories for those and SwiftPM.</p></div>
308  <div class="check"><input type="checkbox" id="deps-enabled" name="deps" value="on"{{if .DepsEnabled}} checked{{end}}></div>
309  <div><button type="submit" class="btn">Save</button></div>
310</form>
311{{if .DepsEnabled}}
312<p class="meta">Last checked {{if .Deps.LastCheck}}{{when .Deps.LastCheck}}{{else}}never{{end}}{{if .Deps.IssueNumber}} · <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/issues/{{.Deps.IssueNumber}}">#{{.Deps.IssueNumber}}</a>{{end}}{{if .Deps.AdvisoryIssueNumber}} · advisories <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/issues/{{.Deps.AdvisoryIssueNumber}}">#{{.Deps.AdvisoryIssueNumber}}</a>{{end}}</p>
313{{if .Deps.LastError}}<p class="error" role="alert">{{.Deps.LastError}}</p>{{end}}
314{{if .Deps.Behind}}<div class="tablewrap"><table class="keys">
315<tr class="cols"><th scope="col">dependency</th><th scope="col">pinned</th><th scope="col">latest</th></tr>
316{{range .Deps.Behind}}<tr>
317  <td class="mono">{{.Ecosystem}} {{.Name}}</td>
318  <td class="mono">{{.Current}}</td>
319  <td class="mono">{{.Latest}}</td>
320</tr>
321{{end}}</table></div>
322{{else}}<p class="none">Nothing behind{{if not .Deps.LastCheck}} — the first check has not run yet{{end}}.</p>{{end}}
323{{if .Deps.Advisories}}<div class="tablewrap"><table class="keys">
324<tr class="cols"><th scope="col">dependency</th><th scope="col">version</th><th scope="col">advisory</th><th scope="col">fixed in</th><th scope="col"><span class="vh">dismiss</span></th></tr>
325{{range .Deps.Advisories}}<tr>
326  <td class="mono">{{.Ecosystem}} {{.Name}}</td>
327  <td class="mono">{{.Version}}</td>
328  <td class="mono"><a href="https://osv.dev/vulnerability/{{.ID}}">{{.ID}}</a></td>
329  <td class="mono">{{.Fixed}}</td>
330  <td><form method="post" action="{{$base}}" class="inline">
331    <input type="hidden" name="field" value="deps-dismiss">
332    <input type="hidden" name="advisory" value="{{.ID}}">
333    <select name="reason" aria-label="Reason"><option value="not-affected">Not affected</option><option value="wont-fix">Won't fix</option><option value="dev-only">Development only</option></select>
334    <button type="submit">Dismiss</button>
335  </form></td>
336</tr>
337{{end}}</table></div>
338{{else if .Deps.LastCheck}}<p class="none">No open advisories.</p>{{end}}
339{{if .Deps.NotImported}}<p class="meta">Not imported by any Go file here, so not reported:{{range .Deps.NotImported}} <a href="https://osv.dev/vulnerability/{{.ID}}">{{.ID}}</a> ({{.Name}}){{end}}. Imports through another module are not seen.</p>{{end}}
340{{if .Deps.Dismissed}}<details class="editbox"><summary>Dismissed advisories ({{len .Deps.Dismissed}})</summary>
341<p><input type="search" class="tablefilter" placeholder="Filter dismissed advisories…" aria-label="Filter dismissed advisories" data-filter-table="deps-dismissed"></p>
342<div class="tablewrap"><table class="keys" id="deps-dismissed">
343<thead><tr class="cols"><th scope="col">dependency</th><th scope="col">advisory</th><th scope="col">reason</th><th scope="col"><span class="vh">reopen</span></th></tr></thead>
344<tbody>{{range .Deps.Dismissed}}<tr>
345  <td class="mono">{{.Ecosystem}} {{.Name}}</td>
346  <td class="mono"><a href="https://osv.dev/vulnerability/{{.ID}}">{{.ID}}</a></td>
347  <td>{{.Reason}}{{if .By}} <span class="meta">by {{.By}}</span>{{end}}</td>
348  <td><form method="post" action="{{$base}}" class="inline">
349    <input type="hidden" name="field" value="deps-reopen">
350    <input type="hidden" name="advisory" value="{{.ID}}">
351    <button type="submit">Reopen</button>
352  </form></td>
353</tr>
354{{end}}</tbody></table></div></details>{{end}}
355{{end}}
356</section>
357
358<section id="runners" class="setcard"><h2>Runners</h2>
359{{if .Runners}}
360<ul class="protlist">
361{{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}}{{if .Jobs}}, only {{join .Jobs ", "}}{{end}}</span>
362  <form method="post" action="{{$base}}" class="inline">
363    <input type="hidden" name="field" value="runner-remove">
364    <input type="hidden" name="fingerprint" value="{{.Fingerprint}}">
365    <button type="submit" class="danger">Detach</button>
366  </form></li>
367{{end}}
368</ul>
369{{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}}
370<details class="editbox"{{if or (index .Submitted "key") (index .Submitted "jobs")}} open{{end}}>
371  <summary>Attach a runner</summary>
372  <form method="post" action="{{$base}}" class="setform stack">
373    <input type="hidden" name="field" value="runner-add">
374    <label for="runner-key">Runner public key</label>
375    <p class="hint">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>
376    <textarea id="runner-key" name="key" rows="3" spellcheck="false" placeholder="ssh-ed25519 AAAA… (from gitbay-runner init)">{{index .Submitted "key"}}</textarea>
377    <label for="runner-jobs">Jobs</label>
378    <p class="hint">Leave empty for every job. Name jobs, comma-separated, to have this runner claim only those here, for instance <code>gitbay-security</code> on a runner with the code scanning image.</p>
379    <input type="text" id="runner-jobs" name="jobs" value="{{index .Submitted "jobs"}}">
380    <span class="btngroup"><button type="submit">Attach runner</button></span>
381  </form>
382</details>
383</section>
384
385<section id="lifecycle" class="setcard setcard-danger"><h2>Lifecycle</h2>
386<form method="post" action="{{$base}}" class="setform">
387  <input type="hidden" name="field" value="archive">
388  <div><label for="archive">Archived</label><p class="hint">Read-only for everyone. Issues and requests close to new activity. Reversible.</p></div>
389  <div class="check"><input type="checkbox" id="archive" name="archive" value="on"{{if .Repo.Settings.Archived}} checked{{end}}></div>
390  <div><button type="submit" {{if .Repo.Settings.Archived}}class="btn"{{else}}class="danger"{{end}}>Save</button></div>
391</form>
392<form method="post" action="{{$base}}" class="setform">
393  <input type="hidden" name="field" value="rename">
394  <div><label for="rename">Name</label><p class="hint">Clone URLs change. The old path stops resolving.</p></div>
395  <div><input type="text" id="rename" name="name" value="{{or (index .Submitted "name") .Repo.Name}}" autocomplete="off" spellcheck="false"></div>
396  <div><button type="submit" class="btn">Rename</button></div>
397</form>
398{{$path := printf "%s/%s" .Repo.OwnerName .Repo.Name}}
399<form method="post" action="{{$base}}" class="setform stack">
400  <input type="hidden" name="field" value="transfer">
401  <label for="new-owner">Transfer</label>
402  <p class="hint">Move it to your own account or an organization you administer. Clone URLs change.</p>
403  <input type="text" id="new-owner" name="new-owner" value="{{index .Submitted "new-owner"}}" placeholder="new owner" autocomplete="off" spellcheck="false">
404  <p>{{template "confirmfield" $path}} <button type="submit" class="danger">Transfer</button></p>
405</form>
406<form method="post" action="{{$base}}" class="setform stack">
407  <input type="hidden" name="field" value="delete">
408  <span class="fieldname">Delete</span>
409  <p class="hint">Removes the repository, its issues and merge requests. Cannot be undone.</p>
410  <p>{{template "confirmfield" $path}} <button type="submit" class="danger">Delete repository</button></p>
411</form>
412</section>
413</div>
414</div>
415{{end}}