# syncthing-relaysrv-ctl **Repository Path**: modstart-lib/syncthing-relaysrv-ctl ## Basic Information - **Project Name**: syncthing-relaysrv-ctl - **Description**: syncthing relaysrv installer - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-29 - **Last Updated**: 2026-01-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Syncthing Relay Server Deployment Script English | [简体中文](README_zh.md) Bash script for automated deployment of [Syncthing Relay Server v2.0.13](https://github.com/syncthing/relaysrv/releases/tag/v2.0.13), supporting multiple Linux distributions. ## Features - ✅ Auto-detect system architecture (amd64, arm64, arm, 386) - ✅ Support multiple Linux distributions (Ubuntu, Debian, CentOS, Fedora, Rocky Linux, AlmaLinux, Arch, Manjaro, openSUSE, Alpine) - ✅ Support systemd and OpenRC service management - ✅ One-click install and uninstall - ✅ Optional relay token configuration (auto-generate 32-char token if empty) - ✅ Auto-create systemd/OpenRC service - ✅ Auto-start on boot - ✅ Log management ## Requirements - Linux operating system - Root privileges (use sudo) - systemd or OpenRC service manager - Network connection (for downloading files) ## Usage ### Installation 1. Download the script: ```bash wget https://raw.githubusercontent.com/your-repo/syncthing-relaysrv-ctl/main/relaysrv-ctl.sh chmod +x relaysrv-ctl.sh ``` 2. Run the install command: ```bash sudo ./relaysrv-ctl.sh install ``` 3. Enter relay token when prompted (optional, leave empty to auto-generate a 32-char random token) ### Uninstallation ```bash sudo ./relaysrv-ctl.sh uninstall ``` During uninstallation, you'll be asked whether to delete configuration files and logs. The script itself will not be deleted. ### Help ```bash ./relaysrv-ctl.sh help ``` ## Installed File Locations | File/Directory | Path | | --------------- | ------------------------------------------------- | | Binary file | `/usr/local/bin/strelaysrv` | | Symlink | `/usr/local/bin/relaysrv` | | systemd service | `/etc/systemd/system/syncthing-relaysrv.service` | | Config dir | `/etc/syncthing-relaysrv/` | | Config file | `/etc/syncthing-relaysrv/config` | | Log dir | `/var/log/syncthing-relaysrv/` | ## Common Commands ### systemd Systems (Most modern Linux distributions) ```bash # Check service status sudo systemctl status syncthing-relaysrv # View real-time logs sudo journalctl -u syncthing-relaysrv -f # Restart service sudo systemctl restart syncthing-relaysrv # Stop service sudo systemctl stop syncthing-relaysrv # Start service sudo systemctl start syncthing-relaysrv # Disable auto-start on boot sudo systemctl disable syncthing-relaysrv # Enable auto-start on boot sudo systemctl enable syncthing-relaysrv ``` ### OpenRC Systems (Alpine Linux) ```bash # Check service status sudo rc-service syncthing-relaysrv status # Restart service sudo rc-service syncthing-relaysrv restart # Stop service sudo rc-service syncthing-relaysrv stop # Start service sudo rc-service syncthing-relaysrv start ``` ## Configuration ### Modify Token Edit the configuration file: ```bash sudo nano /etc/syncthing-relaysrv/config ``` Modify the TOKEN value, then restart the service: ```bash sudo systemctl restart syncthing-relaysrv ``` ### View Logs ```bash # View real-time logs (systemd) sudo journalctl -u syncthing-relaysrv -f # View log files sudo tail -f /var/log/syncthing-relaysrv/relaysrv.log sudo tail -f /var/log/syncthing-relaysrv/relaysrv-error.log ``` ## Supported Architectures - x86_64 (amd64) - aarch64/arm64 - armv7l (arm) - i386/i686 (386) ## Supported Linux Distributions - Ubuntu / Debian - CentOS / RHEL / Rocky Linux / AlmaLinux - Fedora - Arch Linux / Manjaro - openSUSE - Alpine Linux ## Security Features The service is configured with the following security restrictions: - `NoNewPrivileges=true` - Prevent privilege escalation - `PrivateTmp=true` - Private temporary directory - `ProtectSystem=strict` - Read-only system directories - `ProtectHome=true` - Protect home directories - Configuration file permissions set to 600 ## Troubleshooting ### Service Fails to Start 1. Check service status: ```bash sudo systemctl status syncthing-relaysrv ``` 2. View detailed logs: ```bash sudo journalctl -u syncthing-relaysrv -n 100 --no-pager ``` ### Port Already in Use By default, the relay server uses port 22067. If the port is already in use: ```bash sudo lsof -i :22067 ``` ### Download Failed If the download fails, it may be due to network issues or restricted GitHub releases access. You can try: 1. Check network connection 2. Use a proxy 3. Manually download the file and place it in `/usr/local/bin/strelaysrv` ## License MIT License ## Related Links - [Syncthing Relay Server](https://github.com/syncthing/relaysrv) - [Syncthing Official Website](https://syncthing.net/) - [Release v2.0.13](https://github.com/syncthing/relaysrv/releases/tag/v2.0.13)