From 8e369a2e3a7f71043c643f976d5a02655390b254 Mon Sep 17 00:00:00 2001 From: Chris Frankland-Wright Date: Tue, 12 Aug 2025 16:02:25 +0100 Subject: [PATCH] fix: Ensure static web assets are installed and clarify service config Co-authored-by: aider (gemini/gemini-2.5-pro) --- setup.sh | 8 +++++--- timeturner.service | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 4dd5685..b8d556f 100644 --- a/setup.sh +++ b/setup.sh @@ -21,11 +21,13 @@ echo "🔧 Creating directories..." sudo mkdir -p $INSTALL_DIR echo "✅ Directory $INSTALL_DIR created." -# 3. Install binary -echo "🚀 Installing timeturner binary..." +# 3. Install binary and static web files +echo "🚀 Installing timeturner binary and web assets..." sudo cp target/release/ntp_timeturner $INSTALL_DIR/timeturner +# The static directory contains the web UI files +sudo cp -r static $INSTALL_DIR/ sudo ln -sf $INSTALL_DIR/timeturner $BIN_DIR/timeturner -echo "✅ Binary installed to $INSTALL_DIR and linked to $BIN_DIR." +echo "✅ Binary and assets installed to $INSTALL_DIR, and binary linked to $BIN_DIR." # 4. Install systemd service file if [[ "$(uname)" == "Linux" ]]; then diff --git a/timeturner.service b/timeturner.service index 443e99c..f3daec8 100644 --- a/timeturner.service +++ b/timeturner.service @@ -4,6 +4,9 @@ After=network.target [Service] Type=forking +# The 'timeturner daemon' command starts the background process. +# It requires 'config.yml' and the 'static/' web assets directory +# to be present in the WorkingDirectory. ExecStart=/opt/timeturner/timeturner daemon WorkingDirectory=/opt/timeturner PIDFile=/opt/timeturner/ntp_timeturner.pid