Files
loki/scripts/fleetcrown-app.sh
T
Mao NakamotoandClaude Opus 4.7 aaab630bd7 feat(desktop+marketing): web-shell default, multi-OS release pipeline, honest download UX
Desktop:
- Fleet Runner ships in web-shell mode by default — the AppImage loads
  https://fleetcrown.vercel.app (the same React tree the browser serves) so
  desktop and web stay at parity from one codebase. FLEETCROWN_WEB_URL overrides
  for previews/dev; `=local` disables web-shell for IPC dev work.
- Stable artifact naming via `artifactName: Fleet-Runner-${os}-${arch}.${ext}`
  so /releases/latest/download permalinks work; package.json publish target
  corrected from "cockpit" → "fleetcrown".

CI:
- New desktop-release.yml workflow: build matrix on macos-latest, windows-latest,
  ubuntu-latest fires on fleet-runner-v* tag push. Each runner produces signed
  installers via electron-builder --publish always and uploads to a GitHub
  Release. workflow_dispatch with dry_run=true builds-only for pipeline tests.

Download UX:
- Page redesigned for non-technical visitors: hero → web vs desktop comparison
  → platform-aware CTA → 3-step "what happens next" → plain-language prereqs
  with required/optional badges → developer drawer (collapsed).
- mac/Windows surfaces no longer point at the repo as a "download" — they show
  a Coming Soon panel with a release-feed subscription and an honest "Use the
  web app instead" escape hatch. Build-from-source demoted to a dev drawer.
- ~30 new ui-public-download-* semantic classes for the new patterns; design
  guard remains clean.

Navigation:
- /download added to the sidebar Site section so logged-in users have an in-app
  entry point to the desktop app.
- Homepage redirect dropped for signed-in users (onboarding flow preserved);
  hero + footer CTAs now surface "Open FleetCrown →" when authenticated.

Marketing copy:
- Roadmap NOW phase reflects the desktop ship (web-shell, embedded watcher,
  multi-OS pipeline); NEXT phase reframed to "Distribution and auto-update"
  with concrete remaining work (signed mac/Win binaries publicly shipping,
  auto-update, native package channels, IPC bridge polish).
- Investors "what we have built" copy updated to mention the desktop app + CI.

Pre-existing fixes folded in:
- Control surface: AttentionBar deduplicates the "Needs attention" reason chip;
  control-presenter labels the session-with-mtime-but-no-readiness case as Idle.
- Scripts: cockpit → fleetcrown rename sweep across beacon/install/deploy.
- /api/system/daemon route updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 10:37:30 +02:00

40 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# fleetcrown-app.sh — starts the FleetCrown Next.js production server.
#
# Sources .env.local from the project root, then launches the standalone
# server. Intended to be called by the fleetcrown-app.service systemd unit.
#
# Usage: ./scripts/fleetcrown-app.sh
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
STANDALONE="$PROJECT_DIR/.next/standalone"
if [ ! -f "$STANDALONE/server.js" ]; then
echo "[fleetcrown-app] ERROR: standalone build not found at $STANDALONE/server.js" >&2
echo "[fleetcrown-app] Run: npm run build && npm run install-app" >&2
exit 1
fi
# Load all vars from .env.local (set -a exports them to child processes).
if [ -f "$PROJECT_DIR/.env.local" ]; then
set -a
# shellcheck disable=SC1091
source "$PROJECT_DIR/.env.local"
set +a
fi
# Defaults for production server — override in .env.local if needed.
export PORT="${PORT:-3000}"
# HOSTNAME is a bash builtin (set to machine name) — unset it so the standalone
# server defaults to 0.0.0.0 and is reachable at 127.0.0.1 / localhost.
unset HOSTNAME
# NEXTAUTH_URL must match the local URL so auth callbacks work.
export NEXTAUTH_URL="${NEXTAUTH_URL:-http://localhost:${PORT}}"
export NEXTAUTH_SECRET="${NEXTAUTH_SECRET:-${AUTH_SECRET:-}}"
export NODE_ENV="production"
exec node "$STANDALONE/server.js"