docs(reference): import Dune: Awakening server-manager references
Phase 2 references for the host-agent Dune adapter, moved out of volatile /tmp
into docs/reference-repos/ (per Commander). Three upstream projects, .git +
node_modules + compiled binaries stripped (16MB source). Nested AI-instruction
files (.claude/, CLAUDE.md) removed so they don't pollute Corrosion sessions.
- icehunter/ dune-admin (Go+React) — 4 control planes; SETUP_DOCKER.md is the
closest analog to our agent's Dune docker control plane (compose
lifecycle, docker logs, RabbitMQ-via-exec, dune Postgres schema)
- adainrivers/ Rust/Tauri desktop — SSH+k8s BattleGroup control, maintenance
daemon, in-game admin console (Rust idiom reference)
- the4rchangel/ Node web UI replacing battlegroup.bat — matches the Commander's
Hyper-V self-host path + game-config schema
See docs/reference-repos/README.md for the full index + how we use each.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
80
docs/reference-repos/icehunter/deploy/Dockerfile
Normal file
80
docs/reference-repos/icehunter/deploy/Dockerfile
Normal file
@@ -0,0 +1,80 @@
|
||||
ARG BUILDPLATFORM
|
||||
ARG TARGETPLATFORM
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
|
||||
# ── Frontend build ────────────────────────────────────────────────────────────
|
||||
FROM --platform=$BUILDPLATFORM node:22-slim AS web-builder
|
||||
|
||||
WORKDIR /build/web
|
||||
|
||||
# Install pnpm via corepack (matches packageManager field in package.json)
|
||||
RUN corepack enable && corepack prepare pnpm@10.28.1 --activate
|
||||
|
||||
COPY web/package.json web/pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
COPY web/ ./
|
||||
# No VITE_CDN_BASE_URL → isCdnDeploy=false → SPA uses same-origin API base.
|
||||
# VITE_MARKET_BOT_ENABLED=true shows the Bot Control button in the UI.
|
||||
RUN VITE_MARKET_BOT_ENABLED=true pnpm build
|
||||
|
||||
# ── Go build ──────────────────────────────────────────────────────────────────
|
||||
FROM --platform=$BUILDPLATFORM golang:1.26.4 AS go-builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG APP_VERSION=dev
|
||||
ARG GIT_COMMIT=unknown
|
||||
ARG BUILD_TIME=unknown
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} \
|
||||
go build \
|
||||
-ldflags="-s -w -X main.AppVersion=${APP_VERSION} -X main.GitCommit=${GIT_COMMIT} -X main.BuildTime=${BUILD_TIME}" \
|
||||
-o dune-admin ./cmd/dune-admin
|
||||
|
||||
# ── Runtime ───────────────────────────────────────────────────────────────────
|
||||
FROM --platform=$TARGETPLATFORM debian:bookworm-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates kubernetes-client postgresql-client && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Expose build time so the seed-binary init container can stamp the PVC.
|
||||
# BUILD_TIME is set to $(date -u) by deploy.sh on every run, so every deploy
|
||||
# triggers a re-seed regardless of whether version or commit changed.
|
||||
ARG BUILD_TIME=unknown
|
||||
ENV IMAGE_BUILD_TIME=${BUILD_TIME}
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=go-builder /build/dune-admin .
|
||||
COPY --from=go-builder \
|
||||
/build/tags-data.json \
|
||||
/build/item-data.json \
|
||||
/build/quality-data.json \
|
||||
/build/gameplayTags.json \
|
||||
/build/skillModules.json \
|
||||
/build/vehicles.json \
|
||||
/build/cheatScripts.json \
|
||||
./
|
||||
COPY --from=web-builder /build/web/dist ./dist
|
||||
|
||||
# Seed directory for the K8s host-mount pattern. Lives outside /app so that a
|
||||
# PVC mounted at /app doesn't hide it. The init container re-seeds when the
|
||||
# image version differs from the stamp in the PVC, so new image deploys always
|
||||
# update the binary while pod restarts after a self-update keep the newer binary.
|
||||
RUN mkdir -p /usr/local/share/dune-admin-seed && \
|
||||
cp dune-admin \
|
||||
tags-data.json item-data.json quality-data.json \
|
||||
gameplayTags.json skillModules.json vehicles.json cheatScripts.json \
|
||||
/usr/local/share/dune-admin-seed/ && \
|
||||
cp -r dist /usr/local/share/dune-admin-seed/dist
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["./dune-admin"]
|
||||
19
docs/reference-repos/icehunter/deploy/docker-compose.yml
Normal file
19
docs/reference-repos/icehunter/deploy/docker-compose.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
services:
|
||||
dune-admin:
|
||||
container_name: dune-admin
|
||||
restart: unless-stopped
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: deploy/Dockerfile
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
SSH_KEY: /app/sshKey
|
||||
LISTEN_ADDR: :8080
|
||||
volumes:
|
||||
- ../sshKey:/app/sshKey:ro
|
||||
- ${HOME}/.dune-admin:/root/.dune-admin
|
||||
- market-bot-cache:/data
|
||||
|
||||
volumes:
|
||||
market-bot-cache:
|
||||
265
docs/reference-repos/icehunter/deploy/k8s/dune-admin.yaml
Normal file
265
docs/reference-repos/icehunter/deploy/k8s/dune-admin.yaml
Normal file
@@ -0,0 +1,265 @@
|
||||
# Reference template — NOT used directly by deploy.sh.
|
||||
# The deployed manifest is generated by: make render-k8s (render_k8s.go)
|
||||
# Edit render_k8s.go to change the deployed manifest structure.
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: dune-admin
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: dune-admin-config
|
||||
namespace: dune-admin
|
||||
data:
|
||||
DB_HOST: "postgres.default.svc.cluster.local"
|
||||
DB_PORT: "15432"
|
||||
DB_USER: "dune"
|
||||
DB_NAME: "dune"
|
||||
DB_SCHEMA: "dune"
|
||||
LISTEN_ADDR: ":8080"
|
||||
CONTROL: "local"
|
||||
MARKET_BOT_ENABLED: "true"
|
||||
MARKET_BOT_BUY_INTERVAL: "5m"
|
||||
MARKET_BOT_LIST_INTERVAL: "30m"
|
||||
config.yaml: |
|
||||
control: local
|
||||
listen_addr: :8080
|
||||
market_bot_enabled: true
|
||||
market_bot_cache_db: /data/market-bot-cache.db
|
||||
market_bot_state: /data/market-bot-state.json
|
||||
market_bot_item_data: /app/item-data.json
|
||||
market_bot_buy_interval: 5m
|
||||
market_bot_list_interval: 30m
|
||||
market_bot_buy_threshold: 1.05
|
||||
market_bot_max_buys: 50
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: dune-admin-secrets
|
||||
namespace: dune-admin
|
||||
type: Opaque
|
||||
stringData:
|
||||
DB_PASS: "replace-me"
|
||||
BROKER_USER: ""
|
||||
BROKER_PASS: ""
|
||||
BROKER_JWT_SECRET: ""
|
||||
MARKET_BOT_REMOTE_TOKEN: ""
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: market-bot-cache
|
||||
namespace: dune-admin
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
---
|
||||
# Persistent volume for the dune-admin binary and frontend assets.
|
||||
# The init container seeds this from the image on first deploy; subsequent
|
||||
# restarts skip the seed and use whatever binary is in the PVC — including
|
||||
# binaries downloaded by the self-update flow.
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: dune-admin-app
|
||||
namespace: dune-admin
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 500Mi
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: dune-admin
|
||||
namespace: dune-admin
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: dune-admin
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: dune-admin
|
||||
spec:
|
||||
# Two init containers run before the main container:
|
||||
# seed-binary: copies the binary + assets from the image into the app
|
||||
# PVC on first deploy (skipped when the PVC already has a binary,
|
||||
# e.g. after a self-update). Self-update writes to /app/dune-admin
|
||||
# on the PVC; the next restart uses that binary without re-seeding.
|
||||
# seed-config: copies the ConfigMap config.yaml into a writable emptyDir
|
||||
# so that handleSaveConfig can write back. Changes persist within the
|
||||
# pod lifetime; update the ConfigMap for permanent config changes.
|
||||
initContainers:
|
||||
- name: seed-binary
|
||||
image: ghcr.io/icehunter/dune-admin:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
if [ ! -f /app/dune-admin ]; then
|
||||
echo "Seeding dune-admin binary and assets from image..."
|
||||
cp /usr/local/share/dune-admin-seed/dune-admin /app/
|
||||
cp /usr/local/share/dune-admin-seed/tags-data.json /usr/local/share/dune-admin-seed/item-data.json /app/
|
||||
cp -r /usr/local/share/dune-admin-seed/dist /app/dist
|
||||
chmod 0755 /app/dune-admin
|
||||
echo "Seed complete."
|
||||
else
|
||||
echo "Binary already present — skipping seed (self-updated binary in use)."
|
||||
fi
|
||||
volumeMounts:
|
||||
- name: app-rw
|
||||
mountPath: /app
|
||||
- name: seed-config
|
||||
image: busybox:latest
|
||||
command: ['sh', '-c', 'cp /configmap/config.yaml /app-config/config.yaml']
|
||||
volumeMounts:
|
||||
- name: config-source
|
||||
mountPath: /configmap
|
||||
readOnly: true
|
||||
- name: config-rw
|
||||
mountPath: /app-config
|
||||
containers:
|
||||
- name: dune-admin
|
||||
image: ghcr.io/icehunter/dune-admin:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
env:
|
||||
- name: DB_HOST
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: dune-admin-config
|
||||
key: DB_HOST
|
||||
- name: DB_PORT
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: dune-admin-config
|
||||
key: DB_PORT
|
||||
- name: DB_USER
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: dune-admin-config
|
||||
key: DB_USER
|
||||
- name: DB_NAME
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: dune-admin-config
|
||||
key: DB_NAME
|
||||
- name: DB_SCHEMA
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: dune-admin-config
|
||||
key: DB_SCHEMA
|
||||
- name: LISTEN_ADDR
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: dune-admin-config
|
||||
key: LISTEN_ADDR
|
||||
- name: CONTROL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: dune-admin-config
|
||||
key: CONTROL
|
||||
- name: MARKET_BOT_ENABLED
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: dune-admin-config
|
||||
key: MARKET_BOT_ENABLED
|
||||
- name: MARKET_BOT_BUY_INTERVAL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: dune-admin-config
|
||||
key: MARKET_BOT_BUY_INTERVAL
|
||||
- name: MARKET_BOT_LIST_INTERVAL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: dune-admin-config
|
||||
key: MARKET_BOT_LIST_INTERVAL
|
||||
- name: DB_PASS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: dune-admin-secrets
|
||||
key: DB_PASS
|
||||
- name: BROKER_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: dune-admin-secrets
|
||||
key: BROKER_USER
|
||||
- name: BROKER_PASS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: dune-admin-secrets
|
||||
key: BROKER_PASS
|
||||
- name: BROKER_JWT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: dune-admin-secrets
|
||||
key: BROKER_JWT_SECRET
|
||||
- name: MARKET_BOT_REMOTE_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: dune-admin-secrets
|
||||
key: MARKET_BOT_REMOTE_TOKEN
|
||||
optional: true
|
||||
- name: DUNE_ADMIN_SESSIONS_DB
|
||||
value: /data/sessions.db
|
||||
volumeMounts:
|
||||
- name: app-rw
|
||||
mountPath: /app
|
||||
- name: market-bot-cache
|
||||
mountPath: /data
|
||||
- name: config-rw
|
||||
mountPath: /root/.dune-admin
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/v1/status
|
||||
port: http
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /api/v1/status
|
||||
port: http
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 30
|
||||
volumes:
|
||||
- name: app-rw
|
||||
persistentVolumeClaim:
|
||||
claimName: dune-admin-app
|
||||
- name: market-bot-cache
|
||||
persistentVolumeClaim:
|
||||
claimName: market-bot-cache
|
||||
- name: config-source
|
||||
configMap:
|
||||
name: dune-admin-config
|
||||
items:
|
||||
- key: config.yaml
|
||||
path: config.yaml
|
||||
- name: config-rw
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: dune-admin
|
||||
namespace: dune-admin
|
||||
spec:
|
||||
selector:
|
||||
app: dune-admin
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
targetPort: http
|
||||
nodePort: 30080
|
||||
type: NodePort
|
||||
Reference in New Issue
Block a user