diff --git a/Dockerfile b/Dockerfile
index 915bdd4..0a07d3c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,8 +16,9 @@ FROM golang:1.22-bookworm AS backend
WORKDIR /app
COPY server/go.mod server/go.sum* ./
COPY server/ .
+COPY VERSION ./
RUN go mod download && go mod tidy && go mod verify
-RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /bin/switchboard .
+RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=$(cat VERSION)" -o /bin/switchboard .
# ── Stage 2: Vendor JS libs ─────────────────
FROM node:20-alpine AS vendor
@@ -43,6 +44,11 @@ COPY --from=backend /bin/switchboard /usr/local/bin/switchboard
# Frontend static files
COPY src/ /usr/share/nginx/html/
+COPY VERSION /VERSION
+
+# Inject version into index.html at build time
+RUN APP_VERSION=$(cat /VERSION | tr -d '[:space:]') && \
+ sed -i "s|%%APP_VERSION%%|${APP_VERSION}|g" /usr/share/nginx/html/index.html
# Vendor libs (overwrite any existing copies in src/vendor/)
COPY --from=vendor /vendor/marked.min.js /usr/share/nginx/html/vendor/marked.min.js
diff --git a/Dockerfile.frontend b/Dockerfile.frontend
index 0489064..eeffb03 100644
--- a/Dockerfile.frontend
+++ b/Dockerfile.frontend
@@ -31,6 +31,7 @@ RUN rm -f /etc/nginx/conf.d/default.conf
COPY src/ /usr/share/nginx/html/
COPY --from=vendor /vendor/ /usr/share/nginx/html/vendor/
+COPY VERSION /VERSION
COPY docker-entrypoint-fe.sh /docker-entrypoint-fe.sh
RUN chmod +x /docker-entrypoint-fe.sh
diff --git a/docker-entrypoint-fe.sh b/docker-entrypoint-fe.sh
index e354cf1..0d2d18c 100644
--- a/docker-entrypoint-fe.sh
+++ b/docker-entrypoint-fe.sh
@@ -13,6 +13,12 @@ set -e
BASE_PATH="${BASE_PATH:-}"
+# Read version from VERSION file (baked in at build time)
+APP_VERSION="dev"
+if [ -f /VERSION ]; then
+ APP_VERSION=$(cat /VERSION | tr -d '[:space:]')
+fi
+
# Compute base href (needs trailing slash for tag)
if [ -z "${BASE_PATH}" ]; then
BASE_HREF="/"
@@ -24,9 +30,10 @@ fi
sed -i \
-e "s|%%BASE_PATH%%|${BASE_PATH}|g" \
-e "s|%%BASE_HREF%%|${BASE_HREF}|g" \
+ -e "s|%%APP_VERSION%%|${APP_VERSION}|g" \
/usr/share/nginx/html/index.html
-echo "✅ Frontend configured: BASE_PATH=${BASE_PATH:-/}"
+echo "✅ Frontend configured: BASE_PATH=${BASE_PATH:-/} VERSION=${APP_VERSION}"
# ── Generate nginx config ───────────────────
# If BASE_PATH is set, serve under that prefix with alias.
diff --git a/server/Dockerfile b/server/Dockerfile
index 4a43a41..0eec876 100644
--- a/server/Dockerfile
+++ b/server/Dockerfile
@@ -8,6 +8,8 @@
# Build stage
FROM golang:1.22-bookworm AS builder
+ARG APP_VERSION=dev
+
WORKDIR /app
# Copy module files and download deps
@@ -17,7 +19,7 @@ RUN go mod download
# Copy source and tidy (resolves any go.sum gaps)
COPY . .
RUN go mod tidy
-RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /bin/switchboard .
+RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=${APP_VERSION}" -o /bin/switchboard .
# Runtime stage
FROM debian:bookworm-slim
diff --git a/src/css/styles.css b/src/css/styles.css
index 3023cae..63712d5 100644
--- a/src/css/styles.css
+++ b/src/css/styles.css
@@ -1,7 +1,7 @@
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');
/* ==========================================
- Chat Switchboard v0.6.1
+ Chat Switchboard
Clean utility layout · Open WebUI inspired
========================================== */
@@ -67,8 +67,9 @@ a:hover { text-decoration: underline; }
padding: 2px 0; line-height: 1.4;
background: var(--banner-bg); color: var(--banner-fg);
flex-shrink: 0; z-index: 9999;
+ min-height: 22px; box-sizing: border-box;
}
-.banner.active { display: block; }
+.banner.active { display: flex; align-items: center; justify-content: center; }
.banner-top { order: -1; }
.banner-bottom { order: 999; }
diff --git a/src/index.html b/src/index.html
index b66bae4..08e7249 100644
--- a/src/index.html
+++ b/src/index.html
@@ -5,11 +5,12 @@
+
Chat Switchboard
-
+
@@ -161,7 +162,7 @@
✈️ Air-gap ready
🧠 Thinking blocks
- v0.6.2
+ v%%APP_VERSION%%
@@ -240,13 +241,13 @@
Display
@@ -440,10 +441,10 @@
-
-
-
-
-
+
+
+
+
+