mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-11 12:46:05 +00:00
The client switcher built every command as "<client> pull <ref>". That is valid for docker, podman, buildah and nerdctl, but crane requires a destination: $ crane pull seamark.cr/user/bench8x1:v2 Error: requires at least 2 arg(s), only received 1 So selecting crane handed the user a command that cannot run. pullPrefix is a prefix-only helper, which is precisely why it could not express this; add a matching pullPostfix that returns " <image>.tar" for crane and "" for everything else, including "none" (image reference only), which must get neither prefix nor postfix. Both render paths change together, since fixing one leaves the bug visible in the other: the Go template helper paints first, and updatePullCommand in app.js re-renders when the dropdown changes. Repository names may contain slashes, so only the last path segment is used — otherwise the destination would name a subdirectory that does not exist. A name ending in "/" yields no destination at all rather than a bare ".tar", on the grounds that a visibly wrong-arity command beats silently writing a hidden file. That input is not reachable through the real repo-name path. The test asserts the whole command string rather than just the postfix, so it covers the prefix/postfix interaction and the "none" case where both vanish. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PDqoCE1j3njokkZ9b1C5n9
57 lines
2.6 KiB
HTML
57 lines
2.6 KiB
HTML
{{ define "settings-panel-devices" }}
|
|
<section class="card bg-base-200 shadow-sm p-6 space-y-6">
|
|
<div>
|
|
<h2 class="text-xl font-semibold">Authorized Devices</h2>
|
|
<p class="text-base-content/70 mt-1">Devices authorized via <code class="cmd">docker-credential-atcr</code> credential helper.</p>
|
|
</div>
|
|
|
|
<div class="bg-base-200 rounded-lg p-4 space-y-4">
|
|
<h3 class="font-semibold">First Time Setup</h3>
|
|
<ol class="list-decimal list-inside space-y-4 text-sm">
|
|
<li>Install credential helper:
|
|
<pre class="mt-2 p-3 bg-base-300 rounded-lg overflow-x-auto"><code>curl -fsSL {{ .SiteURL }}/static/install.sh | bash</code></pre>
|
|
</li>
|
|
<li>Configure Docker to use the helper. Add to <code class="cmd">~/.docker/config.json</code>:
|
|
<pre class="mt-2 p-3 bg-base-300 rounded-lg overflow-x-auto"><code>{
|
|
"credHelpers": {
|
|
"{{ .RegistryURL }}": "atcr"
|
|
}
|
|
}</code></pre>
|
|
</li>
|
|
<li>Run any Docker command:
|
|
<div class="mt-2">{{ template "docker-command" (print (pullPrefix .OciClient) .RegistryURL "/" .Profile.Handle "/myimage" (pullPostfix .OciClient "myimage")) }}</div>
|
|
</li>
|
|
<li>Browser will open for authorization - click Approve</li>
|
|
<li>Done! Device is automatically authorized</li>
|
|
</ol>
|
|
|
|
<div class="pt-3 border-t border-base-300 text-sm">
|
|
<strong>Fallback:</strong> Use <a href="https://bsky.app/settings/app-passwords" target="_blank" class="link link-primary">app password</a> with <code class="cmd">docker login {{ .RegistryURL }}</code> for quick start (no device tracking)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-y-3">
|
|
<h3 class="font-semibold">Your Authorized Devices</h3>
|
|
<div class="overflow-x-auto">
|
|
<table class="table table-zebra">
|
|
<thead>
|
|
<tr>
|
|
<th>Device Name</th>
|
|
<th>IP Address</th>
|
|
<th>Created</th>
|
|
<th>Last Used</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="devices-table"
|
|
hx-get="/api/devices"
|
|
hx-trigger="load, every 30s, devicesChanged from:body"
|
|
hx-swap="innerHTML">
|
|
<tr><td colspan="5" class="text-center">{{ icon "loader-2" "size-4 animate-spin inline-block" }} Loading...</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{{ end }}
|