6 Commits

Author SHA1 Message Date
Axodouble d30dd5906a Updated exit conditions 2026-05-14 06:00:44 +00:00
Axodouble 40c0d9e5a0 Another attempt at fixing the autoinstall 2026-05-14 05:47:27 +00:00
Axodouble d1913c4278 Added correct build name in script 2026-05-14 05:45:26 +00:00
Axodouble eedd86e571 Updated subshell for release tag 2026-05-14 05:44:35 +00:00
Axodouble c07079497b Added check for used commands 2026-05-14 05:43:42 +00:00
Axodouble 4cfd7159bf Updated install scripts 2026-05-14 05:42:14 +00:00
2 changed files with 92 additions and 46 deletions
+12 -2
View File
@@ -10,6 +10,16 @@ A single static binary contains the daemon, the CLI, and everything in
between. Inter-node traffic is mutual TLS with SSH-style fingerprint between. Inter-node traffic is mutual TLS with SSH-style fingerprint
trust — no central CA, no shared secret. trust — no central CA, no shared secret.
## Installation
### From pre-built binary
This can be done in one step, either by downloading the latest release from
the [Gitea releases page](https://git.cer.sh/axodouble/quptime/releases) or by running the following script:
```sh
curl -fsSL https://git.cer.sh/Axodouble/QUptime/raw/branch/master/install.sh | sudo bash
```
## Why ## Why
Most uptime monitors are either a SaaS or a single box that, by Most uptime monitors are either a SaaS or a single box that, by
@@ -211,7 +221,7 @@ every two seconds.
Keybindings: Keybindings:
| Key | Action | | Key | Action |
|---|---| | ------------------- | --------------------------------------------------------- |
| `↑` / `↓` | move cursor within a tab | | `↑` / `↓` | move cursor within a tab |
| `Tab` / `Shift+Tab` | next / previous tab | | `Tab` / `Shift+Tab` | next / previous tab |
| `1` / `2` / `3` | jump to Peers / Checks / Alerts | | `1` / `2` / `3` | jump to Peers / Checks / Alerts |
@@ -248,7 +258,7 @@ qu alert add smtp ops --host ... --from ... --to ... \
Available template variables: Available template variables:
| Variable | Meaning | | Variable | Meaning |
|---|---| | ----------------------- | ------------------------------------------ |
| `{{.Check.Name}}` | check name | | `{{.Check.Name}}` | check name |
| `{{.Check.Type}}` | `http` / `tcp` / `icmp` | | `{{.Check.Type}}` | `http` / `tcp` / `icmp` |
| `{{.Check.Target}}` | URL or host:port being probed | | `{{.Check.Target}}` | URL or host:port being probed |
+55 -19
View File
@@ -1,24 +1,60 @@
#!/bin/bash #!/bin/bash
# Check if ~/.local/bin exists, if not, create it # Helper function which echo's all commands before executing them in grayscale prefixed with >
if [ ! -d "$HOME/.local/bin" ]; then echo_cmd() {
mkdir -p "$HOME/.local/bin" echo -e "\033[90m> $1\033[0m"
fi eval "$1"
}
# Check if ~/.local/bin is in the PATH, if not, give the user a command to add it # Check if jq and curl are installed, if not, error out and ask the user to install them
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then if ! command -v jq > /dev/null; then
echo "Please add the following line to your shell configuration file (e.g., ~/.bashrc, ~/.zshrc) to include ~/.local/bin in your PATH:" echo "Error: jq is not installed. Please install jq and try again."
echo 'export PATH="$HOME/.local/bin:$PATH"'
echo "After adding the line, please restart your terminal or run 'source ~/.bashrc' (or the appropriate command for your shell) to apply the changes."
fi
# Download the binary from git.cer.sh/axodouble/quptime
# Check whether curl or wget is available
if command -v curl > /dev/null; then
curl -L -o "$HOME/.local/bin/quptime" "https://git.cer.sh/axodouble/quptime/-/raw/main/quptime"
elif command -v wget > /dev/null; then
wget -O "$HOME/.local/bin/quptime" "https://git.cer.sh/axodouble/quptime/-/raw/main/quptime"
else
echo "Error: Neither curl nor wget is installed. Please install one of these tools to download the quptime binary."
exit 1 exit 1
fi fi
if ! command -v curl > /dev/null; then
echo "Error: curl is not installed. Please install curl and try again."
exit 1
fi
# Check if the user is allowed to write to /usr/local/bin, if so, install qu there, else error out and ask the user to install qu manually
if [ -w "/usr/local/bin" ]; then
# Get release tag by $(curl -s https://git.cer.sh/api/v1/repos/axodouble/quptime/releases/latest | jq -r '.tag_name')
RELEASE=$(curl -s https://git.cer.sh/api/v1/repos/axodouble/quptime/releases/latest | jq -r '.tag_name')
# Download the latest release binary from the Git repository and save it to /usr/local/bin/qu
if command -v curl > /dev/null; then
echo_cmd "curl -L -o \"/usr/local/bin/qu\" \"https://git.cer.sh/axodouble/quptime/releases/download/${RELEASE}/qu-${RELEASE}-linux-amd64\""
echo_cmd "chmod +x \"/usr/local/bin/qu\""
echo "> qu has been installed to /usr/local/bin/qu"
else
echo "Error: curl is not installed. Please install curl and try again."
exit 1
fi
else
echo "Error: You are not allowed to write to /usr/local/bin. Please install qu manually, or run this script with sudo."
exit 1
fi
# Check if the user has systemd, if so create a systemd service file for qu serve
if command -v systemctl > /dev/null; then
echo "> Creating systemd service file for qu serve..."
cat <<EOL > /etc/systemd/system/qu-serve.service
[Unit]
Description=QUptime Serve
After=network.target
[Service]
ExecStart=/usr/local/bin/qu serve
Restart=always
User=$(whoami)
[Install]
WantedBy=multi-user.target
EOL
echo_cmd "systemctl daemon-reload"
echo_cmd "systemctl enable qu-serve.service"
echo "> qu serve service has been created and enabled. You can start it with 'systemctl start qu-serve.service'"
else
echo "> Warning: systemd is not available on this system. qu serve will not be automatically started on boot. You can start it manually with '/usr/local/bin/qu serve'"
fi
echo "Installation complete, before starting `qu serve`, make sure to run `qu init` and read the documentation."