File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1207,6 +1207,22 @@ else
12071207 ai_warn " Perplexica auto-config skipped -- complete setup at http://localhost:3004"
12081208fi
12091209
1210+ # ── Pre-mark setup wizard complete ──
1211+ # The dashboard-api reads ${INSTALL_DIR}/data/config/setup-complete.json
1212+ # (mounted at /data/config/setup-complete.json inside the container) to
1213+ # decide first_run state. Writing this here prevents the wizard from
1214+ # reappearing on every visit after a fresh install. Non-fatal.
1215+ _setup_config_dir=" ${INSTALL_DIR} /data/config"
1216+ _setup_complete_file=" ${_setup_config_dir} /setup-complete.json"
1217+ _completed_at=$( date -u +%Y-%m-%dT%H:%M:%SZ)
1218+ if mkdir -p " ${_setup_config_dir} " 2> /dev/null \
1219+ && printf ' {"completed_at": "%s", "version": "1.0.0"}\n' " ${_completed_at} " > " ${_setup_complete_file} " 2> /dev/null \
1220+ && chmod 644 " ${_setup_complete_file} " 2> /dev/null; then
1221+ ai_ok " Setup wizard pre-marked complete"
1222+ else
1223+ ai_warn " Could not write ${_setup_complete_file} (non-fatal)"
1224+ fi
1225+
12101226# ── Success card ──
12111227if ! $ALL_HEALTHY ; then
12121228 echo " "
Original file line number Diff line number Diff line change 4747# Show the cinematic success card
4848show_success_card " http://localhost:3000" " http://localhost:3001" " $LOCAL_IP "
4949
50+ # Mark the setup wizard as already completed for fresh installs. The
51+ # dashboard-api reads this file (container path /data/config/setup-complete.json,
52+ # mounted from ${INSTALL_DIR}/data) to decide first_run state; without it the
53+ # wizard reappears on every visit after a fresh install. Non-fatal — if the
54+ # write fails, the wizard simply shows once.
55+ if ! $DRY_RUN ; then
56+ _setup_config_dir=" ${INSTALL_DIR} /data/config"
57+ _setup_complete_file=" ${_setup_config_dir} /setup-complete.json"
58+ _completed_at=$( date -u +%Y-%m-%dT%H:%M:%SZ)
59+ if mkdir -p " ${_setup_config_dir} " 2> /dev/null \
60+ && printf ' {"completed_at": "%s", "version": "1.0.0"}\n' " ${_completed_at} " > " ${_setup_complete_file} " 2> /dev/null \
61+ && chmod 644 " ${_setup_complete_file} " 2> /dev/null; then
62+ log " Setup wizard pre-marked complete at ${_setup_complete_file} "
63+ else
64+ ai_warn " Could not write ${_setup_complete_file} (non-fatal)"
65+ fi
66+ fi
67+
5068# Check background tasks before showing additional info
5169if [[ -f " $SCRIPT_DIR /installers/lib/background-tasks.sh" ]]; then
5270 . " $SCRIPT_DIR /installers/lib/background-tasks.sh"
Original file line number Diff line number Diff line change @@ -891,6 +891,23 @@ if ($allHealthy) {
891891 Write-SuccessCard
892892}
893893
894+ # ── Pre-mark setup wizard complete ────────────────────────────────────────────
895+ # The dashboard-api reads ${INSTALL_DIR}/data/config/setup-complete.json
896+ # (mounted at /data/config/setup-complete.json inside the container) to decide
897+ # first_run state. Writing this here prevents the wizard from reappearing on
898+ # every visit after a fresh install. Non-fatal.
899+ try {
900+ $setupConfigDir = Join-Path $installDir " data\config"
901+ $setupCompleteFile = Join-Path $setupConfigDir " setup-complete.json"
902+ New-Item - Path $setupConfigDir - ItemType Directory - Force | Out-Null
903+ $completedAt = (Get-Date ).ToUniversalTime().ToString(" yyyy-MM-ddTHH:mm:ssZ" )
904+ $payload = @ { completed_at = $completedAt ; version = " 1.0.0" } | ConvertTo-Json - Compress
905+ Set-Content - Path $setupCompleteFile - Value $payload - Encoding UTF8
906+ Write-AISuccess " Setup wizard pre-marked complete"
907+ } catch {
908+ Write-AIWarn " Could not write setup-complete.json (non-fatal): $_ "
909+ }
910+
894911# ── Summary JSON (for CI / automation) ───────────────────────────────────────
895912if ($SummaryJsonPath ) {
896913 $summary = @ {
Original file line number Diff line number Diff line change @@ -67,4 +67,16 @@ if grep -q 'cdn.jsdelivr.net/npm/chart.js\|cdn.jsdelivr.net/npm/chartjs-adapter-
6767 exit 1
6868fi
6969
70+ echo " [contract] installers pre-mark setup wizard complete"
71+ # All three installers must write data/config/setup-complete.json at install time
72+ # so the dashboard wizard doesn't reappear on every visit after a fresh install.
73+ # dashboard-api reads this file (container path /data/config/setup-complete.json,
74+ # mounted from ${INSTALL_DIR}/data) to decide first_run state.
75+ grep -q ' data/config/setup-complete.json' installers/phases/13-summary.sh \
76+ || { echo " [FAIL] Linux phase 13 does not write data/config/setup-complete.json" ; exit 1; }
77+ grep -q ' data/config/setup-complete.json' installers/macos/install-macos.sh \
78+ || { echo " [FAIL] macOS installer does not write data/config/setup-complete.json" ; exit 1; }
79+ grep -q ' data\\\\config\\\\setup-complete.json\|setup-complete.json' installers/windows/install-windows.ps1 \
80+ || { echo " [FAIL] Windows installer does not write setup-complete.json" ; exit 1; }
81+
7082echo " [PASS] installer contracts"
You can’t perform that action at this time.
0 commit comments