Add auto-incrementing version display to web UI footer

Exposes GET /version endpoint in the web container (reads APP_VERSION env var).
CI computes the version as 1.0.<git-commit-count> and passes it via --build-arg at build time.
Both index.html and cv-matcher/index.html show the version in the footer via a JS fetch.
docker-compose passes APP_VERSION through to the running container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-22 20:18:31 +03:00
parent eced9531bc
commit 0154b56881
9 changed files with 30 additions and 1 deletions
+2
View File
@@ -13,6 +13,8 @@ FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
WORKDIR /app
EXPOSE 8080
ENV ASPNETCORE_URLS=http://0.0.0.0:8080
ARG APP_VERSION=1.0.0
ENV APP_VERSION=${APP_VERSION}
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "web.dll"]
+3
View File
@@ -14,6 +14,9 @@ var app = builder.Build();
app.UseMiddleware<SiteModeMiddleware>();
app.MapGet("/version", (IConfiguration config) =>
Results.Json(new { version = config["APP_VERSION"] ?? "unknown" }));
// Static site
app.UseDefaultFiles();
app.UseStaticFiles();
+7
View File
@@ -607,6 +607,13 @@ img {
flex-wrap: wrap
}
.app-version {
font-size: .7rem;
color: var(--muted);
opacity: .5;
font-family: monospace
}
.cookie-overlay {
position: fixed;
left: 0;
+1
View File
@@ -186,6 +186,7 @@
<a data-legal="privacy" href="/legal/privacy-en.html" target="_blank" data-i18n="legal.privacy">Privacy</a>
<a data-legal="cookies" href="/legal/cookies-en.html" target="_blank" data-i18n="legal.cookies">Cookies</a>
</div>
<span id="app-version" class="app-version"></span>
<a href="#top" class="back-to-top btn btn-dark btn-sm shadow" data-i18n="footer.top">Back to top</a>
</div>
</footer>
+1
View File
@@ -189,6 +189,7 @@
<a data-legal="privacy" href="/legal/privacy-en.html" target="_blank" data-i18n="legal.privacy">Privacy</a>
<a data-legal="cookies" href="/legal/cookies-en.html" target="_blank" data-i18n="legal.cookies">Cookies</a>
</div>
<span id="app-version" class="app-version"></span>
<a href="#top" class="back-to-top btn btn-dark btn-sm shadow" data-i18n="footer.top">Back to top</a>
</div>
</footer>
+7
View File
@@ -262,6 +262,13 @@
}
$('#year').text(new Date().getFullYear());
$.getJSON('/version').done(function (data) {
if (data && data.version) {
$('#app-version').text('v' + data.version);
}
});
applyLanguage(currentLang());
$('.lang-flag').on('click', function () {
applyLanguage($(this).data('lang'));