diff --git a/advisory-circular@.service.conf b/advisory-circular@.service.conf new file mode 100644 index 0000000..8224afc --- /dev/null +++ b/advisory-circular@.service.conf @@ -0,0 +1,10 @@ +[Unit] +Description=Advisory Circular twitter bot +Documentaion=https://gitlab.com/jjwiseman/advisory-circular/ +Wants=network.target +After=network.target + +[Service] +Type=simple +Restart=always +ExecStart=/usr/local/share/advisorycircular/advisorycircular.sh %i diff --git a/config-skel.yaml b/config-skel.yaml new file mode 100644 index 0000000..d584706 --- /dev/null +++ b/config-skel.yaml @@ -0,0 +1,11 @@ +adsbx: + url: https://adsbexchange.com/api/aircraft/json +pelias: + url: http://lockheed.local:4000/v1 +lat: 34.1335 +lon: -118.1924 +radius-km: 30 +basestation-sqb: clean-basestation.sqb +landmarks: + blocklist: + - Johnny.Depp diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..a66d271 --- /dev/null +++ b/install.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -e +install_path=/usr/local/share/advisorycircular +config_path=/etc/advisorycircular +user=advisorycircular + +# Create install and config directories if they doesn't exist. +mkdir -p "$install_path" +mkdir -p "$config_path" + +# Create advisory-circular user if it doesn't exist. +if ! id -u ${user} 2>/dev/null +then + adduser --system --home ${install_path} --no-create-home --quiet ${user} +fi + +# Compile. +npm install +npx shadow-cljs compile script + +# Install +install intervalexec.py advisorycircular "$install_path"/intervalexec +install advisorycircular.sh "$install_path"/advisorycircular +cp -r node_modules "$install_path" +cp -r .shadow-cljs "$install_path" +mkdir -p "$install_path"/out +cp out/advisorycircular.js "$install_path"/out +chown -R "$user" "$install_path" + +cp config-skel.yaml "$config_path" +cp secrets-skel.yaml "$config_path" +chown -R "$user" "$config_path" diff --git a/secrets-skel.yaml b/secrets-skel.yaml new file mode 100644 index 0000000..1de1192 --- /dev/null +++ b/secrets-skel.yaml @@ -0,0 +1,2 @@ +adsbx: + api-key: