Installation

1. Installation aus den Quellen

mkdir -p ~/projects
cd ~/projects
git clone git@bitbucket.org:locr/locrmapdistributionserver.git LocrMapDistributionServer
cd LocrMapDistributionServer

Die Datei /etc/locr/lmds.conf hat folgendes Grundgerüst und Standardwerte:

allow_insecure_ssl_connections=false
allowed_referrers=127.0.0.1,localhost,maps1.locr.com
allowed_remote_addresses=123.111.222.123
configuration_file=/var/lib/locr/lmds/configuration.xml
lmds_host_name=127.0.0.1
mail_recipient=entwicklung@locr.com
max_concurrent_user_tasks=50
port=2048
smtp_host=
smtp_password=
smtp_username=
update_to_remotes=
virtual_websocket_port=8080
virtual_websocket_secure_port=8000
websocket_handler=websocket_sharp
websocket_location=localhost
websocket_port=8080
server_check_time=
time_to_kill=

1.1. Systemd Services installieren

1.1.1. /usr/local/lib/systemd/system/lmds.service anlegen!

[Unit]
Description=LocrMapDistributionServer

[Install]
WantedBy = multi-user.target

[Service]
Type=simple
Environment=DOTNET_CLI_HOME=/home/serverconnect/LocrMapDistributionServer/LocrMapDistributionServer
WorkingDirectory=/home/serverconnect/LocrMapDistributionServer/LocrMapDistributionServer
ExecStart=/usr/bin/dotnet run --framework=net8.0 --configuration=Release -- --parameters-file=/etc/locr/lmds.conf
Restart=always

1.1.2. /usr/local/lib/systemd/system/lmds-restart.service anlegen!

[Unit]
Description=Restart LocrMapDistributionServer

[Service]
Type=oneshot
ExecStart=/bin/systemctl restart lmds.service

[Install]
WantedBy=multi-user.target

1.1.3. /usr/local/lib/systemd/system/lmds-restart.timer anlegen!

[Unit]
Description=Restart Timer for LocrMapDistributionServer

[Timer]
OnCalendar=*-*-* 12:00:00
Persistent=true
Unit=lmds-restart.service

[Install]
WantedBy=multi-user.target

1.1.4. Systemd Services aktivieren!

sudo systemctl daemon-reload
sudo systemctl enable lmds.service
sudo systemctl enable lmds-restart.service
sudo systemctl enable lmds-restart.timer
sudo systemctl start lmds.service
sudo systemctl start lmds-restart.service
sudo systemctl start lmds-restart.timer

2. Update script im home-Verzeichnis erstellen

cat <<EOF >~/update_lmds.sh
#!/usr/bin/env bash

cd ${PWD}/scripts
./update_service.sh
EOF

chmod +x ~/update_lmds.sh

Der Service ist unter http://localhost:2048/ Verfügbar!