add service and update readme

This commit is contained in:
Bevan Hunt 2021-03-21 22:12:39 -07:00
parent d4d42a1b37
commit 7cb0941b6c
4 changed files with 18 additions and 2 deletions

2
Cargo.lock generated
View File

@ -451,7 +451,7 @@ dependencies = [
[[package]]
name = "broker"
version = "6.1.1"
version = "6.1.2"
dependencies = [
"anyhow",
"async-std",

View File

@ -1,6 +1,6 @@
[package]
name = "broker"
version = "6.1.1"
version = "6.1.2"
authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
edition = "2018"
license = "MIT"

View File

@ -118,6 +118,9 @@ will return: `200` or `500` or `400` or `401`
- the db can be passed in as a flag where the embedded database will be saved - default tmp
- example: `./broker --db="tmp" --port="443" --secure="true" --origin="*" --jwt_expiry="86400" --jwt_secret="secret" --key_path="broker.rsa" --cert_path="broker.pem"`
### Service
There is an example `systemctl` service for Ubuntu called `broker.service` in the code
### TechStack

13
broker.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=Broker
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/root/broker
[Install]
WantedBy=multi-user.target