admin-scripts/pi0/justfile
2024-06-20 10:12:41 -05:00

47 lines
1.9 KiB
Makefile

## Justfile (https://github.com/casey/justfile)
##
## pi0 - Orange Pi 5+
##
## Services:
## - gmcapsuled
## - Mastodon
## - Tailscale
## - The Lounge IRC
debian_codename := `grep "VERSION_CODENAME" /etc/os-release | awk -F= '{print $2}'`
gmcapsuled:
pipx install gmcapsule
mkdir -p ~/.config/systemd/user
cp -v "${PWD}/systemd/user/gmcapsuled.service" ~/.config/systemd/user/
cp -v "${PWD}/gmcapsulerc" ~/.gmcapsulerc
mastodon:
sudo mkdir -p /home/mastodon/.config/systemd/user
sudo cp -v "${PWD}/systemd/user/mastodon-db-backup.service" /home/mastodon/.config/systemd/user/
sudo cp -v "${PWD}/systemd/user/mastodon-db-backup.timer" /home/mastodon/.config/systemd/user/
sudo cp -v "${PWD}/systemd/user/mastodon-system-to-minio.service" /home/mastodon/.config/systemd/user/
sudo cp -v "${PWD}/systemd/user/mastodon-system-to-minio.timer" /home/mastodon/.config/systemd/user/
sudo chown -R mastodon:mastodon /home/mastodon/.config
sudo cp -v "${PWD}/bin/mastodon-db-backup" /usr/local/bin
sudo chown -R root:root /usr/local/bin/mastodon-db-backup
sudo loginctl enable-linger
sudo -u mastodon systemctl --user enable --now mastodon-db-backup.timer
sudo -u mastodon systemctl --user enable --now mastodon-system-to-minio.timer
thelounge:
curl -s https://api.github.com/repos/thelounge/thelounge-deb/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
sudo apt install -y ./thelounge*.deb
tailscale:
curl -fsSL https://pkgs.tailscale.com/stable/debian/{{ debian_codename }}.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
curl -fsSL https://pkgs.tailscale.com/stable/debian/{{ debian_codename }}.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
sudo apt update
sudo apt install -y tailscale
sudo systemctl enable --now tailscaled
sudo tailscale up