fix: Ensure static web assets are installed and clarify service config

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
Chris Frankland-Wright 2025-08-12 16:02:25 +01:00
parent af0a512187
commit 8e369a2e3a
2 changed files with 8 additions and 3 deletions

View file

@ -21,11 +21,13 @@ echo "🔧 Creating directories..."
sudo mkdir -p $INSTALL_DIR sudo mkdir -p $INSTALL_DIR
echo "✅ Directory $INSTALL_DIR created." echo "✅ Directory $INSTALL_DIR created."
# 3. Install binary # 3. Install binary and static web files
echo "🚀 Installing timeturner binary..." echo "🚀 Installing timeturner binary and web assets..."
sudo cp target/release/ntp_timeturner $INSTALL_DIR/timeturner 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 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 # 4. Install systemd service file
if [[ "$(uname)" == "Linux" ]]; then if [[ "$(uname)" == "Linux" ]]; then

View file

@ -4,6 +4,9 @@ After=network.target
[Service] [Service]
Type=forking 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 ExecStart=/opt/timeturner/timeturner daemon
WorkingDirectory=/opt/timeturner WorkingDirectory=/opt/timeturner
PIDFile=/opt/timeturner/ntp_timeturner.pid PIDFile=/opt/timeturner/ntp_timeturner.pid