From 180631989a5dc313b5cb0dd345b92e61e2d366ff Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Thu, 11 Jun 2026 09:03:37 -0400 Subject: [PATCH] fix(panel): real auto-updating version + remove fake agent footer; rename companion -> Corrosion host agent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Version badge: was hardcoded '1.0.8' — now single-sourced from frontend/package.json (1.0.0) via Vite define __APP_VERSION__, so it auto-updates on release. Sidebar agent footer: removed the FABRICATED 'asgard-01' host name and the fake 'Agent v1.0.8' line — now shows real server.connection data, or an honest 'No host agent connected' empty state when nothing is deployed (the operator's actual state). Renamed 'Companion agent' -> 'Corrosion host agent' across the UI (ServerView/SetupWizard/Dashboard/Plugins), the binary names (corrosion-host-agent--) + CDN path (/host-agent/), the Go Makefile build output, and the Gitea CI workflow — frontend download links and CI output now match. Marketing hero mock host names neutralized (asgard-01 -> rust-host/dune-host/conan-host). DB column names (companion_last_seen) left intact. Build green; zero 'asgard'/'1.0.8' remain in frontend/src. Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/build-companion.yml | 54 +++++++++---------- companion-agent/Makefile | 8 +-- frontend/package.json | 2 +- frontend/src/app-version.d.ts | 1 + .../src/components/layout/DashboardLayout.vue | 42 +++++++++++---- frontend/src/views/admin/DashboardView.vue | 6 +-- frontend/src/views/admin/PluginsView.vue | 2 +- frontend/src/views/admin/ServerView.vue | 40 +++++++------- frontend/src/views/auth/SetupWizardView.vue | 8 +-- frontend/src/views/marketing/LandingView.vue | 6 +-- frontend/vite.config.ts | 6 +++ 11 files changed, 103 insertions(+), 72 deletions(-) create mode 100644 frontend/src/app-version.d.ts diff --git a/.gitea/workflows/build-companion.yml b/.gitea/workflows/build-companion.yml index 0bec254..d008c8f 100644 --- a/.gitea/workflows/build-companion.yml +++ b/.gitea/workflows/build-companion.yml @@ -1,4 +1,4 @@ -name: Build Companion Agent +name: Build Host Agent on: push: @@ -26,19 +26,19 @@ jobs: run: | cd companion-agent mkdir -p bin - GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.version=${{ steps.version.outputs.VERSION }}" -o bin/corrosion-companion-linux-amd64 ./cmd/agent - chmod +x bin/corrosion-companion-linux-amd64 + GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.version=${{ steps.version.outputs.VERSION }}" -o bin/corrosion-host-agent-linux-amd64 ./cmd/agent + chmod +x bin/corrosion-host-agent-linux-amd64 - name: Build Windows AMD64 run: | cd companion-agent - GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.version=${{ steps.version.outputs.VERSION }}" -o bin/corrosion-companion-windows-amd64.exe ./cmd/agent + GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.version=${{ steps.version.outputs.VERSION }}" -o bin/corrosion-host-agent-windows-amd64.exe ./cmd/agent - name: Generate checksums run: | cd companion-agent/bin - sha256sum corrosion-companion-linux-amd64 > checksums.txt - sha256sum corrosion-companion-windows-amd64.exe >> checksums.txt + sha256sum corrosion-host-agent-linux-amd64 > checksums.txt + sha256sum corrosion-host-agent-windows-amd64.exe >> checksums.txt cat checksums.txt - name: Create Release @@ -53,7 +53,7 @@ jobs: RESPONSE=$(curl -s -X POST \ -H "Authorization: token ${RELEASE_TOKEN}" \ -H "Content-Type: application/json" \ - -d "{\"tag_name\": \"${VERSION}\", \"name\": \"Companion Agent ${VERSION}\", \"body\": \"Companion Agent release ${VERSION}\", \"draft\": false, \"prerelease\": false}" \ + -d "{\"tag_name\": \"${VERSION}\", \"name\": \"Corrosion Host Agent ${VERSION}\", \"body\": \"Corrosion Host Agent release ${VERSION}\", \"draft\": false, \"prerelease\": false}" \ "${API_URL}/repos/${REPO}/releases") RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*') @@ -68,15 +68,15 @@ jobs: curl -s -X POST \ -H "Authorization: token ${RELEASE_TOKEN}" \ -H "Content-Type: application/octet-stream" \ - --data-binary @companion-agent/bin/corrosion-companion-linux-amd64 \ - "${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=corrosion-companion-linux-amd64" + --data-binary @companion-agent/bin/corrosion-host-agent-linux-amd64 \ + "${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=corrosion-host-agent-linux-amd64" # Upload Windows binary curl -s -X POST \ -H "Authorization: token ${RELEASE_TOKEN}" \ -H "Content-Type: application/octet-stream" \ - --data-binary @companion-agent/bin/corrosion-companion-windows-amd64.exe \ - "${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=corrosion-companion-windows-amd64.exe" + --data-binary @companion-agent/bin/corrosion-host-agent-windows-amd64.exe \ + "${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=corrosion-host-agent-windows-amd64.exe" # Upload checksums curl -s -X POST \ @@ -89,43 +89,43 @@ jobs: run: | CDN_URL="https://cdn.corrosionmgmt.com" - # Upload Linux binary to /companion/latest/ + # Upload Linux binary to /host-agent/latest/ curl -s -X POST \ - -F "file=@companion-agent/bin/corrosion-companion-linux-amd64" \ - "${CDN_URL}/companion/latest/corrosion-companion-linux-amd64" + -F "file=@companion-agent/bin/corrosion-host-agent-linux-amd64" \ + "${CDN_URL}/host-agent/latest/corrosion-host-agent-linux-amd64" - # Upload Windows binary to /companion/latest/ + # Upload Windows binary to /host-agent/latest/ curl -s -X POST \ - -F "file=@companion-agent/bin/corrosion-companion-windows-amd64.exe" \ - "${CDN_URL}/companion/latest/corrosion-companion-windows-amd64.exe" + -F "file=@companion-agent/bin/corrosion-host-agent-windows-amd64.exe" \ + "${CDN_URL}/host-agent/latest/corrosion-host-agent-windows-amd64.exe" # Upload checksums curl -s -X POST \ -F "file=@companion-agent/bin/checksums.txt" \ - "${CDN_URL}/companion/latest/checksums.txt" + "${CDN_URL}/host-agent/latest/checksums.txt" # Also upload versioned copies VERSION=${{ steps.version.outputs.VERSION }} curl -s -X POST \ - -F "file=@companion-agent/bin/corrosion-companion-linux-amd64" \ - "${CDN_URL}/companion/${VERSION}/corrosion-companion-linux-amd64" + -F "file=@companion-agent/bin/corrosion-host-agent-linux-amd64" \ + "${CDN_URL}/host-agent/${VERSION}/corrosion-host-agent-linux-amd64" curl -s -X POST \ - -F "file=@companion-agent/bin/corrosion-companion-windows-amd64.exe" \ - "${CDN_URL}/companion/${VERSION}/corrosion-companion-windows-amd64.exe" + -F "file=@companion-agent/bin/corrosion-host-agent-windows-amd64.exe" \ + "${CDN_URL}/host-agent/${VERSION}/corrosion-host-agent-windows-amd64.exe" curl -s -X POST \ -F "file=@companion-agent/bin/checksums.txt" \ - "${CDN_URL}/companion/${VERSION}/checksums.txt" + "${CDN_URL}/host-agent/${VERSION}/checksums.txt" - echo "CDN upload complete: ${CDN_URL}/companion/latest/" + echo "CDN upload complete: ${CDN_URL}/host-agent/latest/" - name: Build Summary run: | - echo "## Companion Agent Build Complete" >> $GITHUB_STEP_SUMMARY + echo "## Corrosion Host Agent Build Complete" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "**Version:** ${{ steps.version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY echo "**Commit:** ${GITHUB_SHA:0:7}" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### Built Artifacts:" >> $GITHUB_STEP_SUMMARY - echo "- Linux AMD64 ($(stat -c%s companion-agent/bin/corrosion-companion-linux-amd64) bytes)" >> $GITHUB_STEP_SUMMARY - echo "- Windows AMD64 ($(stat -c%s companion-agent/bin/corrosion-companion-windows-amd64.exe) bytes)" >> $GITHUB_STEP_SUMMARY + echo "- Linux AMD64 ($(stat -c%s companion-agent/bin/corrosion-host-agent-linux-amd64) bytes)" >> $GITHUB_STEP_SUMMARY + echo "- Windows AMD64 ($(stat -c%s companion-agent/bin/corrosion-host-agent-windows-amd64.exe) bytes)" >> $GITHUB_STEP_SUMMARY echo "- SHA256 checksums" >> $GITHUB_STEP_SUMMARY diff --git a/companion-agent/Makefile b/companion-agent/Makefile index a908753..5e30776 100644 --- a/companion-agent/Makefile +++ b/companion-agent/Makefile @@ -1,7 +1,7 @@ .PHONY: all build build-linux build-windows clean test run # Binary names -BINARY_NAME=corrosion-companion +BINARY_NAME=corrosion-host-agent BINARY_LINUX=$(BINARY_NAME)-linux-amd64 BINARY_WINDOWS=$(BINARY_NAME)-windows-amd64.exe @@ -66,10 +66,10 @@ run: build-local install-service: @echo "Installing systemd service..." @sudo cp $(BUILD_DIR)/$(BINARY_LINUX) /usr/local/bin/$(BINARY_NAME) - @sudo cp deployment/corrosion-companion.service /etc/systemd/system/ + @sudo cp deployment/corrosion-host-agent.service /etc/systemd/system/ @sudo systemctl daemon-reload - @sudo systemctl enable corrosion-companion - @echo "Service installed. Configure /etc/corrosion-companion/.env then start with: sudo systemctl start corrosion-companion" + @sudo systemctl enable corrosion-host-agent + @echo "Service installed. Configure /etc/corrosion-host-agent/.env then start with: sudo systemctl start corrosion-host-agent" # Development helpers dev: build-local diff --git a/frontend/package.json b/frontend/package.json index 2155338..2e2d288 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "frontend", "private": true, - "version": "0.0.0", + "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/app-version.d.ts b/frontend/src/app-version.d.ts new file mode 100644 index 0000000..e042dcc --- /dev/null +++ b/frontend/src/app-version.d.ts @@ -0,0 +1 @@ +declare const __APP_VERSION__: string diff --git a/frontend/src/components/layout/DashboardLayout.vue b/frontend/src/components/layout/DashboardLayout.vue index 2ec0f3a..23ec642 100644 --- a/frontend/src/components/layout/DashboardLayout.vue +++ b/frontend/src/components/layout/DashboardLayout.vue @@ -13,6 +13,7 @@ import { useServerStore } from '@/stores/server' import { useThemeGame } from '@/composables/useThemeGame' import { useGameProfile } from '@/config/gameProfiles' import type { NavSection, NavItemDef } from '@/config/gameProfiles' +import { safeDate } from '@/utils/formatters' import Logo from '@/components/ds/brand/Logo.vue' import Badge from '@/components/ds/core/Badge.vue' import StatusDot from '@/components/ds/core/StatusDot.vue' @@ -36,7 +37,7 @@ const sidebarOpen = ref(false) function closeSidebar() { sidebarOpen.value = false } // ---- App version ---- -const APP_VERSION = '1.0.8' +const APP_VERSION = __APP_VERSION__ // ---- Game switcher ---- const GAME_OPTIONS: GameOption[] = [ @@ -94,6 +95,8 @@ function hasVisibleItems(section: NavSection): boolean { } // ---- Agent health ---- +const hasAgent = computed(() => server.connection !== null) + const agentTone = computed(() => { const cs = server.connection?.connection_status if (cs === 'connected') return 'online' as const @@ -106,9 +109,17 @@ const agentLabel = computed(() => { if (cs === 'degraded') return 'Degraded' return 'Offline' }) -const agentName = computed(() => { - const ip = server.connection?.server_ip - return ip ?? 'asgard-01' +const agentName = computed(() => server.connection?.server_ip ?? 'Host agent') + +const agentMetaLine = computed(() => { + const cs = server.connection?.connection_status + let line = cs === 'connected' ? 'Connected' : server.connection?.companion_last_seen + ? `Last seen ${safeDate(server.connection.companion_last_seen)}` + : 'Awaiting first heartbeat' + if (server.stats) { + line += ` · ${server.stats.player_count}/${server.stats.max_players} players` + } + return line }) // ---- Topbar ---- @@ -184,18 +195,24 @@ const themeIcon = computed(() => theme.value === 'dark' ? 'sun' : 'moon') - +
-
+ +
{{ agentName }} {{ agentLabel }}
-
- Agent v{{ APP_VERSION }} - +
{{ agentMetaLine }}
+
+ +
+
+ + No host agent connected
+
Install the Corrosion host agent from the Server page
@@ -373,6 +390,13 @@ body { margin: 0; overflow: hidden; } padding-left: 16px; } +.agent--empty { opacity: 0.7; } + +.agent__name--muted { + color: var(--text-tertiary); + font-style: italic; +} + .side__user { display: flex; align-items: center; diff --git a/frontend/src/views/admin/DashboardView.vue b/frontend/src/views/admin/DashboardView.vue index 67bbda5..6edb7fa 100644 --- a/frontend/src/views/admin/DashboardView.vue +++ b/frontend/src/views/admin/DashboardView.vue @@ -259,7 +259,7 @@ function navServer() { router.push('/server') }