Skip to content

Commit 451caa4

Browse files
danielewoodclaude
andcommitted
Add version tag and repo link to web UI footer
Version is injected at build time via ldflags and displayed in the footer alongside a link to the GitHub repository. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 28b3bca commit 451caa4

7 files changed

Lines changed: 26 additions & 3 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
cache: true
2222

2323
- name: Build WASM
24-
run: make wasm
24+
run: make wasm VERSION=${GITHUB_REF_NAME}
2525

2626
- name: Deploy to Cloudflare Pages
2727
uses: cloudflare/wrangler-action@v3

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Add certificate trust validation against embedded Mozilla root store in WASM UI
1616
- Add selectable export: checkboxes to choose which matched bundles to include in ZIP
1717
- Add UI filters: hide expired, unmatched, non-leaf, and untrusted certificates
18+
- Show version tag and GitHub repo link in web UI footer
1819

1920
## [0.6.0] - 2026-02-14
2021

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ test:
99
vet:
1010
go vet ./...
1111

12+
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
13+
1214
wasm:
13-
GOOS=js GOARCH=wasm go build -trimpath -ldflags="-s -w" \
15+
GOOS=js GOARCH=wasm go build -trimpath \
16+
-ldflags="-s -w -X main.version=$(VERSION)" \
1417
-o web/public/certkit.wasm ./cmd/wasm/
1518
cp "$$(go env GOROOT)/lib/wasm/wasm_exec.js" web/public/wasm_exec.js
1619

cmd/wasm/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import (
1717
"github.com/sensiblebit/certkit"
1818
)
1919

20+
// version is set at build time via -ldflags "-X main.version=v0.6.1".
21+
var version = "dev"
22+
2023
// mozillaRoots is a lazily-initialized Mozilla root certificate pool.
2124
var mozillaRoots *x509.CertPool
2225

@@ -32,6 +35,7 @@ func getMozillaRoots() *x509.CertPool {
3235
var globalStore = newStore()
3336

3437
func main() {
38+
js.Global().Set("certkitVersion", version)
3539
js.Global().Set("certkitAddFiles", js.FuncOf(addFiles))
3640
js.Global().Set("certkitGetState", js.FuncOf(getState))
3741
js.Global().Set("certkitExportBundles", js.FuncOf(exportBundlesJS))

web/public/app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ async function loadWasm() {
7474
go.run(result.instance);
7575
wasmReady = true;
7676
hideStatus();
77+
78+
// Show version from WASM build.
79+
const v = window.certkitVersion;
80+
if (v && v !== "dev") {
81+
document.getElementById("version").textContent = v;
82+
}
7783
}
7884

7985
loadWasm().catch((err) => {

web/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ <h3>Warnings</h3>
9999
</main>
100100

101101
<footer>
102-
<p>certkit — All processing happens locally in your browser. No files are uploaded.</p>
102+
<p><a href="https://github.com/sensiblebit/certkit">certkit</a> <span id="version"></span> — All processing happens locally in your browser. No files are uploaded.</p>
103103
</footer>
104104

105105
<script src="wasm_exec.js"></script>

web/public/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,15 @@ footer {
348348
font-size: 0.75rem;
349349
}
350350

351+
footer a {
352+
color: var(--fg-secondary);
353+
text-decoration: underline;
354+
}
355+
356+
footer a:hover {
357+
color: var(--accent);
358+
}
359+
351360
@media (max-width: 640px) {
352361
body {
353362
padding: 1rem;

0 commit comments

Comments
 (0)