This commit is contained in:
firebadnofire 2024-04-17 13:37:22 -04:00
parent 04e0294529
commit 783ca7fb32
Signed by: firebadnofire
GPG Key ID: EF6539F1FA16DEB7
3 changed files with 68 additions and 0 deletions

33
Makefile Normal file
View File

@ -0,0 +1,33 @@
# Variables
BIN_NAME = rms-server
SERVICE_FILE = rms-server.service
BIN_DEST = /usr/local/bin/$(BIN_NAME)
SERVICE_DEST = /etc/systemd/system/$(SERVICE_FILE)
# Targets
all:
@echo "Usage:"
@echo ""
@echo "make compile: only compile"
@echo "make install_bin: only move the bin to /usr/local/bin"
@echo "make install_service: only install the service file to /etc/systemd/system"
@echo "make install: compile, then install both the service file and bin"
@echo "make uninstall: remove the bin and service file"
install: compile install_bin install_service
compile:
cargo build --release
install_bin:
sudo cp target/release/$(BIN_NAME) $(BIN_DEST)
install_service:
sudo cp $(SERVICE_FILE) $(SERVICE_DEST)
sudo systemctl daemon-reload
uninstall:
sudo systemctl stop rms-server
sudo rm -r $(SERVICE_DEST) $(BIN_DEST) target
sudo systemctl daemon-reload

View File

@ -2,6 +2,30 @@
Rust Messenger Service - Server
Usage:
```
-p PORT: set port
-l /path/to/dir: set log dir (defaults to /var/log/RMS-server)
-h: print help info
```
## Build instructions:
Install rust: <a href="https://www.rust-lang.org/tools/install">rust-lang.org/tools/install</a>
Optional: edit rms-server.service to your liking
Run make: `make install`
## Uninstal:
Run make: `make uninstall`
## other
Check out: <a href="/firebadnofire/RMS-client">RMS-client</a>

11
rms-server.service Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=RMS Server
After=network-online.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/rms-server
[Install]
WantedBy=multi-user.target