Skip to content

Instantly share code, notes, and snippets.

@gdamjan
Last active December 15, 2022 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdamjan/d67f0f7591a52c74e17b37b301e38abe to your computer and use it in GitHub Desktop.
Save gdamjan/d67f0f7591a52c74e17b37b301e38abe to your computer and use it in GitHub Desktop.
pleroma setup
# /etc/systemd/system/pleroma.service
[Unit]
Description=Pleroma is a federated social networking platform
Documentation=https://docs-develop.pleroma.social/
After=network.target
[Service]
Type=simple
DynamicUser=yes
StateDirectory=pleroma
ConfigurationDirectory=pleroma
NoNewPrivileges=yes
ProtectHome=yes
Environment=RELEASE_TMP=/tmp
Environment=MIX_ENV=prod
Environment=HOME=/opt/pleroma/latest
WorkingDirectory=/opt/pleroma/latest
ExecStartPre=/opt/pleroma/latest/bin/pleroma_ctl migrate
ExecStart=/opt/pleroma/latest/bin/pleroma start
ExecStop=/opt/pleroma/latest/bin/pleroma stop
[Install]
WantedBy=multi-user.target
#! /bin/bash
set -euo pipefail
VER=2.4.5
ARCH=amd64
URL="https://git.pleroma.social/pleroma/pleroma/-/jobs/artifacts/v$VER/download?job=$ARCH"
DESTDIR=/opt/pleroma/$VER
SYMLINK=/opt/pleroma/latest
sudo mkdir $DESTDIR
TMPFILE=`mktemp --suffix=.zip pleroma-$VER-XXXXXX`
curl -L "$URL" -o $TMPFILE
sudo bsdtar -xopvf $TMPFILE --strip-components 1 -C $DESTDIR
# fixup permissions, ie. make sure executables are other-executable, not just owner executable
sudo chmod -R +X $DESTDIR
sudo ln -sfT $DESTDIR $SYMLINK
sudo systemctl restart pleroma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment