internal/web/templates/settings.html

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

189 lines · 10017 bytes

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