| 1 |
{% macro panel(base, s, csrf, what) %} |
| 2 |
<section class="panel" id="secrets"> |
| 3 |
<h2>Secrets</h2> |
| 4 |
<p class="small mute">{{ what }} A job gets only the secrets its pipeline declares, as <code>secret "name" { mount-path "/run/secrets/name" }</code>, written there as a file before it starts; never in the environment, and masked in its log. Values are kept sealed and never shown again.</p> |
| 5 |
{% if !s.inherited.is_empty() %} |
| 6 |
<h3>Inherited</h3> |
| 7 |
<div class="table"><table> |
| 8 |
<tr><th>Name</th><th>Set</th><th>From</th></tr> |
| 9 |
{% for i in s.inherited %}<tr{% if i.overridden %} class="mute"{% endif %}><td><code>{{ i.secret.name }}</code></td><td class="small">{{ i.secret.updated_ms|ago_i }}</td><td class="small">{{ i.from }}{% if i.overridden %} · <span title="A level below sets the same name">overridden</span>{% endif %}</td></tr>{% endfor %} |
| 10 |
</table></div> |
| 11 |
{% endif %} |
| 12 |
{% if s.own.is_empty() %}<p class="mute small">{% if s.inherited.is_empty() %}None.{% else %}None of its own.{% endif %}</p>{% else %} |
| 13 |
<div class="table"><table> |
| 14 |
<tr><th>Name</th><th>Set</th><th></th></tr> |
| 15 |
{% for o in s.own %}<tr><td><code>{{ o.secret.name }}</code></td><td class="small">{{ o.secret.updated_ms|ago_i }}</td> |
| 16 |
<td><form class="tiny" method="post" action="{{ base }}/secrets"><input type="hidden" name="_csrf" value="{{ csrf }}"><input type="hidden" name="name" value="{{ o.secret.name }}"><button name="action" value="delete" class="danger-btn">remove</button></form></td></tr>{% endfor %} |
| 17 |
</table></div>{% endif %} |
| 18 |
<form class="card" method="post" action="{{ base }}/secrets"> |
| 19 |
<input type="hidden" name="_csrf" value="{{ csrf }}"><input type="hidden" name="action" value="set"> |
| 20 |
<h3>Set a secret</h3> |
| 21 |
<label for="sname">Name</label><input type="text" id="sname" name="name" placeholder="deploy-token" required autocomplete="off"> |
| 22 |
<label for="svalue">Value</label><textarea id="svalue" name="value" rows="2" autocomplete="off"></textarea> |
| 23 |
<p class="small mute">An existing name takes the new value; a name set above is overridden here.</p> |
| 24 |
<button type="submit">SET</button> |
| 25 |
</form> |
| 26 |
</section> |
| 27 |
{% endmacro %} |