add systemd and improve env.template

This commit is contained in:
2025-01-18 18:48:43 +01:00
parent de15b67115
commit 2ae6d49b72
3 changed files with 81 additions and 9 deletions

View File

@ -1,10 +1,18 @@
# Database
DB_NAME=""
DB_USER=""
DB_PASSWORD=""
DB_HOST=""
DB_DIALECT=""
DB_PORT=""
DB_HOST="localhost"
DB_DIALECT="mariadb"
DB_PORT="3306"
# Server
PORT="3000" #Port the server runs on, match with your reverse proxy config
# TTN Webhook
WEBHOOK_TOKEN="" #Token that is placed a the TTN Webhook auth
# Wigle API
WIGLE_TOKEN="" # Go to account and generate token "Encoded for use"
WIGLE_BASE_URL="https://api.wigle.net"
WIGLE_NETWORK_SEARCH="/api/v2/network/search"

View File

@ -0,0 +1,22 @@
[Unit]
Description=LocationHub
After=network.target systemd-networkd-wait-online.service mysqld.service
[Service]
Type=simple
User=locationhub
WorkingDirectory=/home/locationhub/git/LocationHub/server/
ExecStart=/usr/bin/npm run dev
Restart=on-failure
StandardOutput=append:/var/log/LocationHub.log
StandardError=append:/var/log/LocationHub.log
[Install]
WantedBy=multi-user.target
```
Activate Systemd Job
```
systemctl daemon-reload
systemctl enable locationhub.service
systemctl start locationhub.service
systemctl status locationhub.service