From 4d0b4ebae44b4da81a438e7298eb7c29dd898cfd Mon Sep 17 00:00:00 2001 From: Chris Frankland-Wright Date: Tue, 12 Aug 2025 16:27:44 +0100 Subject: [PATCH] docs: Detail `setup.sh` installation process in README Co-authored-by: aider (gemini/gemini-2.5-pro) --- README.md | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 40c9127..6a46e29 100644 --- a/README.md +++ b/README.md @@ -48,19 +48,42 @@ When running as a background daemon, TimeTurner provides a web interface for mon --- -## 🚀 Installation (to update) +## 🚀 Installation -For Rust install you can do -```bash -cargo install --git https://github.com/cjfranko/NTP-Timeturner -``` -Clone and run the installer: +The `setup.sh` script is provided to compile and install the TimeTurner application and its systemd service on a Debian-based system like Raspberry Pi OS. -```bash -wget https://raw.githubusercontent.com/cjfranko/NTP-Timeturner/master/setup.sh -chmod +x setup.sh -./setup.sh -``` +### Prerequisites + +- **Rust and Cargo**: The script requires the Rust programming language toolchain. If you don't have it, install it from [rustup.rs](https://rustup.rs/). + +### Running the Installer + +1. First, clone the repository: + ```bash + git clone https://github.com/cjfranko/NTP-Timeturner.git + cd NTP-Timeturner + ``` +2. Make the script executable and run it. The script will use `sudo` for commands that require root privileges, so it may ask for your password. + ```bash + chmod +x setup.sh + ./setup.sh + ``` + +### What the Script Does + +The installation script automates the following steps: + +1. **Compiles the Binary**: Runs `cargo build --release` to create an optimised executable. +2. **Creates Directories**: Creates `/opt/timeturner` to store the application files. +3. **Installs Files**: + - The compiled binary is copied to `/opt/timeturner/timeturner`. + - The web interface assets from the `static/` directory are copied to `/opt/timeturner/static`. + - A symbolic link is created from `/usr/local/bin/timeturner` to the binary, allowing it to be run from any location. +4. **Sets up Systemd Service**: + - Copies the `timeturner.service` file to `/etc/systemd/system/`. + - Enables the service to start automatically on system boot. + +After installation is complete, the script will provide instructions to start the service manually or to run the application in its interactive terminal mode. --- ## 🕰️ Chrony NTP