Benutzer-Werkzeuge

Webseiten-Werkzeuge


doku:server:api2.shackspace.de

api2.shackspace.de

Funktion

Zugriff

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
doku/server/api2.shackspace.de.txt · Zuletzt geändert: 2023-01-11 20:59 von are