====== api2.shackspace.de ====== {{tag> infrastructure computing}} **Funktion**\\ * shack API, space API, ... auf I[[doku:server:host2.shackspace.de|host2.shackspace.de]] * https://api.shackspace.de/ **Zugriff**\\ * auf [[doku:server:host2.shackspace.de]]: ''pct enter 168146103'' ===== Grundinstallation ===== LXC via ansible Ansible ausgeführt, weiter manuell: ufw allow 8081/tcp cd /srv git clone https://github.com/shackspace/api.shackspace.de.git cat <<'EOF' >/srv/api.shackspace.de/live-run.sh #!/bin/bash set -e echo "updating..." git pull echo "building..." go build echo "running..." ./api www/space-api.json www/live-auth-token.txt www/live-last-seen.txt :8081 EOF cat <<'EOF' >/etc/systemd/system/shackapi.service [Unit] Description=shack API After=network-online.target [Service] Type=simple WorkingDirectory=/srv/api.shackspace.de Environment="HOME=/srv/api.shackspace.de" ExecStart=/srv/api.shackspace.de/live-run.sh Restart=always [Install] WantedBy=multi-user.target EOF systemctl daemon-reload systemctl enable shackapi systemctl start shackapi