commit
This commit is contained in:
parent
04e0294529
commit
783ca7fb32
|
@ -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
|
||||
|
24
README.md
24
README.md
|
@ -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>
|
||||
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue