diff --git a/upfast.service b/upfast.service new file mode 100644 index 0000000..c2843d1 --- /dev/null +++ b/upfast.service @@ -0,0 +1,10 @@ +[Unit] +Description=UpFast service +Documentation=https://code.cronyakatsuki.xyz/crony/upfast + +[Service] +User=upfast +Group=upfast +WorkingDirectory=/usr/local/upfast/ +ExecStart=/usr/local/upfast/env/bin/uvicorn main:app --host 127.0.0.1 --port 8000 --proxy-headers --forwarded-allow-ips='*' +Restart=on-failure diff --git a/upfast.sh b/upfast.sh new file mode 100755 index 0000000..f1838f0 --- /dev/null +++ b/upfast.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# quick install (and run) script for upfast using systemd +if [ $EUID -ne 0] +then + echo "Please run as root" + exit 1 +fi + +cp ./upfast.service /etc/systemd/system/upfast.service + +useradd --shell /bin/sh --system --home-dir /usr/local/upfast upfast +mkdir -p /usr/local/upfast # dodge copying of skeletons + +chown upfast:upfast /usr/local/upfast +chmod 700 /usr/local/upfast + +su upfast -c' +cd +git clone https://git.craftmenners.men/upfast . + +python3 -m venv env +. ./env/bin/activate +pip install -r requirements.txt +mkdir upload' + +systemctl enable --now upfast.service