software:rust:server_devuan
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| software:rust:server_devuan [2025/09/18 08:16] – rodolico | software:rust:server_devuan [2025/09/29 16:51] (current) – rodolico | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== RustDesk Server on Devuan ====== | ====== RustDesk Server on Devuan ====== | ||
| - | <WRAP center round alert 60%> | + | <WRAP center round important |
| - | Warning. I am still editing this on 18 Sep 2025. Do not use these instructions until I have finished editing, then tested the procedure. This notice | + | The RustDesk Server must be accessible from any connecting clients |
| </ | </ | ||
| - | |||
| We use [[https:// | We use [[https:// | ||
| - | The Rust Server install script unfortunately assumes SystemD, and will fail halfway through as it is attempting to set up the SystemD service. The same is true of the .deb package which is available. | + | An excellent |
| This article describes how to set up the Rust Server on Devuan, and may be helpful for other systems also. | This article describes how to set up the Rust Server on Devuan, and may be helpful for other systems also. | ||
| + | |||
| + | |||
| + | ===== Open Ports ===== | ||
| + | |||
| + | On your firewall/ | ||
| + | |||
| + | Following table shows what the ports are used for. | ||
| + | |||
| + | ^Port | ||
| + | | 21114 | HBBS (RustDesk server) | TCP | Default port for API (not required) | ||
| + | | 21115 | HBBS (RustDesk server) | TCP/UDP | Default port for the RustDesk server. | ||
| + | | 21116 | HBBS (RustDesk server) | TCP/UDP | Used for client connections to the server. | ||
| + | | 21117 | HBBS (RustDesk server) | TCP/UDP | Additional port for server communication. | ||
| + | | 21118 | HBBS (RustDesk server) | TCP/UDP | Another port for server communication. | ||
| + | | 21119 | HBBS (RustDesk server) | TCP/UDP | Used for additional server functionalities. | | ||
| + | | 80 | HTTP (optional fallback) | TCP | Commonly allowed port for web traffic; can be used for fallback. | | ||
| + | | 443 | HTTPS (optional fallback) | TCP | Secure web traffic; can be used for fallback | ||
| ===== Set up user ===== | ===== Set up user ===== | ||
| Line 28: | Line 44: | ||
| ===== Download Server ===== | ===== Download Server ===== | ||
| - | Open a web browser to https://github.com/ | + | This will download the latest version of RustDesk Server from their github |
| <code bash> | <code bash> | ||
| cd /tmp | cd /tmp | ||
| - | wget ###Paste the URL from above here### | + | LATEST=$(curl https:// |
| + | wget " | ||
| unzip rustdesk-server-linux-amd64.zip | unzip rustdesk-server-linux-amd64.zip | ||
| mv / | mv / | ||
| chown rust:rust / | chown rust:rust / | ||
| + | chmod 755 / | ||
| </ | </ | ||
| - | This will create | + | This will get three binary files in / |
| * hbbr - The relay server. If a direct P2P connection can not be made, this will be used to relay traffic between clients. | * hbbr - The relay server. If a direct P2P connection can not be made, this will be used to relay traffic between clients. | ||
| * hbbs - this is the " | * hbbs - this is the " | ||
| Line 50: | Line 68: | ||
| **Note**: The check is made in the current working directory, so you **must** run hbbs from within it's home directory (/ | **Note**: The check is made in the current working directory, so you **must** run hbbs from within it's home directory (/ | ||
| + | |||
| + | <code bash> | ||
| + | cd / | ||
| + | echo Starting signaling server for testing. Press ^c to exit when you are happy | ||
| + | sudo -u rust ./hbbs | ||
| + | |||
| + | echo Your key for the clients is | ||
| + | cat id_ed25519.pub | ||
| + | echo To find this again at a later date, just run the command cat id_ed25519.pub | ||
| + | |||
| + | </ | ||
| + | ===== Set automatic run ===== | ||
| + | |||
| + | Everything up to this point will work on all Unix systems, and we have done nothing that techahold' | ||
| + | |||
| + | Copy the following two files to /etc/init.d (Devuan), or wherever your init scripts are stored. By the way, I built these starting with the template at [[https:// | ||
| + | |||
| + | Create the file / | ||
| + | |||
| + | <code bash hbbs> | ||
| + | #!/bin/sh | ||
| + | ### BEGIN INIT INFO | ||
| + | # Provides: | ||
| + | # Required-Start: | ||
| + | # Required-Stop: | ||
| + | # Default-Start: | ||
| + | # Default-Stop: | ||
| + | # Short-Description: | ||
| + | # Description: | ||
| + | ### END INIT INFO | ||
| + | |||
| + | dir="/ | ||
| + | cmd="/ | ||
| + | user=" | ||
| + | |||
| + | name=`basename $0` | ||
| + | pid_file="/ | ||
| + | stdout_log="/ | ||
| + | stderr_log="/ | ||
| + | |||
| + | get_pid() { | ||
| + | cat " | ||
| + | } | ||
| + | |||
| + | is_running() { | ||
| + | [ -f " | ||
| + | } | ||
| + | |||
| + | case " | ||
| + | start) | ||
| + | if is_running; then | ||
| + | echo " | ||
| + | else | ||
| + | echo " | ||
| + | cd " | ||
| + | if [ -z " | ||
| + | sudo $cmd >> " | ||
| + | else | ||
| + | sudo -u " | ||
| + | fi | ||
| + | echo $! > " | ||
| + | if ! is_running; then | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | fi | ||
| + | ;; | ||
| + | stop) | ||
| + | if is_running; then | ||
| + | echo -n " | ||
| + | kill `get_pid` | ||
| + | for i in 1 2 3 4 5 6 7 8 9 10 | ||
| + | # for i in `seq 10` | ||
| + | do | ||
| + | if ! is_running; then | ||
| + | break | ||
| + | fi | ||
| + | |||
| + | echo -n " | ||
| + | sleep 1 | ||
| + | done | ||
| + | echo | ||
| + | |||
| + | if is_running; then | ||
| + | echo "Not stopped; may still be shutting down or shutdown may have failed" | ||
| + | exit 1 | ||
| + | else | ||
| + | echo " | ||
| + | if [ -f " | ||
| + | rm " | ||
| + | fi | ||
| + | fi | ||
| + | else | ||
| + | echo "Not running" | ||
| + | fi | ||
| + | ;; | ||
| + | restart) | ||
| + | $0 stop | ||
| + | if is_running; then | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | $0 start | ||
| + | ;; | ||
| + | status) | ||
| + | if is_running; then | ||
| + | echo " | ||
| + | else | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | ;; | ||
| + | *) | ||
| + | echo " | ||
| + | exit 1 | ||
| + | ;; | ||
| + | esac | ||
| + | |||
| + | exit 0 | ||
| + | |||
| + | </ | ||
| + | |||
| + | Create the file / | ||
| + | |||
| + | |||
| + | <code bash hbbr> | ||
| + | #!/bin/sh | ||
| + | ### BEGIN INIT INFO | ||
| + | # Provides: | ||
| + | # Required-Start: | ||
| + | # Required-Stop: | ||
| + | # Default-Start: | ||
| + | # Default-Stop: | ||
| + | # Short-Description: | ||
| + | # Description: | ||
| + | ### END INIT INFO | ||
| + | |||
| + | dir="/ | ||
| + | cmd="/ | ||
| + | user=" | ||
| + | |||
| + | name=`basename $0` | ||
| + | pid_file="/ | ||
| + | stdout_log="/ | ||
| + | stderr_log="/ | ||
| + | |||
| + | get_pid() { | ||
| + | cat " | ||
| + | } | ||
| + | |||
| + | is_running() { | ||
| + | [ -f " | ||
| + | } | ||
| + | |||
| + | case " | ||
| + | start) | ||
| + | if is_running; then | ||
| + | echo " | ||
| + | else | ||
| + | echo " | ||
| + | cd " | ||
| + | if [ -z " | ||
| + | sudo $cmd >> " | ||
| + | else | ||
| + | sudo -u " | ||
| + | fi | ||
| + | echo $! > " | ||
| + | if ! is_running; then | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | fi | ||
| + | ;; | ||
| + | stop) | ||
| + | if is_running; then | ||
| + | echo -n " | ||
| + | kill `get_pid` | ||
| + | for i in 1 2 3 4 5 6 7 8 9 10 | ||
| + | # for i in `seq 10` | ||
| + | do | ||
| + | if ! is_running; then | ||
| + | break | ||
| + | fi | ||
| + | |||
| + | echo -n " | ||
| + | sleep 1 | ||
| + | done | ||
| + | echo | ||
| + | |||
| + | if is_running; then | ||
| + | echo "Not stopped; may still be shutting down or shutdown may have failed" | ||
| + | exit 1 | ||
| + | else | ||
| + | echo " | ||
| + | if [ -f " | ||
| + | rm " | ||
| + | fi | ||
| + | fi | ||
| + | else | ||
| + | echo "Not running" | ||
| + | fi | ||
| + | ;; | ||
| + | restart) | ||
| + | $0 stop | ||
| + | if is_running; then | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | $0 start | ||
| + | ;; | ||
| + | status) | ||
| + | if is_running; then | ||
| + | echo " | ||
| + | else | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | ;; | ||
| + | *) | ||
| + | echo " | ||
| + | exit 1 | ||
| + | ;; | ||
| + | esac | ||
| + | |||
| + | exit 0 | ||
| + | |||
| + | </ | ||
| + | |||
| + | Now (we're almost done), run the following commands to start the both servers up. | ||
| + | |||
| + | <code bash> | ||
| + | chmod 755 / | ||
| + | chmod 755 / | ||
| + | # test hbbs | ||
| + | / | ||
| + | # test hbbr | ||
| + | / | ||
| + | # if both worked correctly, run the following command to automatically start at boot | ||
| + | update-rc.d hbbs defaults | ||
| + | update-rc.d hbbr defaults | ||
| + | </ | ||
| + | |||
| + | If you made it through the last step with no errors, you should now be able to access the server from one of the clients. | ||
| + | |||
| + | ===== Set automatic log rotate ===== | ||
| + | |||
| + | Your logs can get quite large, so it is best to rotate them occassional. Devuan uses the logrotate script to do this for, and it is fairly simple to add a new definition in / | ||
| + | |||
| + | Following command will create the definition. It will rotate the hbbr/hbbs logs daily, keeping two weeks of logs. All logs except for the current one and the previous one will be compressed. | ||
| + | |||
| + | This is just one command. Just copy and paste it anywhere into the server. | ||
| + | |||
| + | <code bash rotatelogs> | ||
| + | cat << EOF > / | ||
| + | / | ||
| + | daily | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | service hbbr restart > /dev/null | ||
| + | service hbbs restart > /dev/null | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | EOF | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Links ===== | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
software/rust/server_devuan.1758201419.txt.gz · Last modified: 2025/09/18 08:16 by rodolico
