50 lines
2.1 KiB
Bash
50 lines
2.1 KiB
Bash
#!/bin/bash
|
|
export SHELL="/bin/bash"
|
|
|
|
cd /opt
|
|
ls
|
|
unzip pleroma.zip
|
|
mv release/* pleroma/
|
|
chown -R pleroma /opt/pleroma
|
|
mkdir -p /var/lib/pleroma/uploads
|
|
mkdir -p /var/lib/pleroma/static
|
|
chown -R pleroma /var/lib/pleroma
|
|
|
|
sed -i "s/replaceME/${ENDPOINT}/g" /etc/pleroma/config.exs
|
|
|
|
#Nginx and SSL
|
|
sed -i "s/replaceME/${ENDPOINT}/g" /etc/nginx/conf.d/default.conf
|
|
openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=CO/L=Denver/O=$ENDPOINT/CN=$ENDPOINT" -keyout /etc/ssl/certs/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
|
|
mkdir /var/run/nginx
|
|
|
|
#Database Setup
|
|
sleep 10
|
|
export PGPASSWORD="sql"
|
|
echo "CREATE EXTENSION IF NOT EXISTS citext;"| PGPASSWORD=sql psql -h postgresql -U root pleroma
|
|
echo "CREATE EXTENSION IF NOT EXISTS pg_trgm;" | PGPASSWORD=sql psql -h postgresql -U root pleroma
|
|
echo "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" | PGPASSWORD=sql psql -h postgresql -U root pleroma
|
|
su pleroma -s $SHELL -lc "/opt/pleroma/bin/pleroma_ctl migrate"
|
|
|
|
#su pleroma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/pleroma/config.exs --output-psql /tmp/setup_db.psql --force"
|
|
#su postgres -s $SHELL -lc "/usr/lib/postgresql/12/bin/psql -f /tmp/setup_db.psql"
|
|
|
|
#Start Pleroma
|
|
su pleroma -s $SHELL -lc "/opt/pleroma/bin/pleroma daemon"
|
|
|
|
#Install Soapbox
|
|
#curl https://gitlab.com/`curl https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs | grep 'build-production' | cut -d "\"" -f4 | head -1`/artifacts/download -o soapbox-fe.zip
|
|
#curl -L https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs/1734223607/artifacts/download -o soapbox-fe.zip
|
|
busybox unzip /tmp/soapbox-fe.zip -o -d /var/lib/pleroma/
|
|
mv /var/lib/pleroma/static/instance/about.example /var/lib/pleroma/static/instance/about
|
|
cp -f /tmp//terms-of-service.html /var/lib/pleroma/static/instance/about/tos.html
|
|
cp -f /tmp/terms-of-service.html /var/lib/pleroma/static/instance/about/index.html
|
|
|
|
|
|
#Create an Admin User
|
|
echo;echo;echo "Sleeping for 40 seconds so Pleroma starts.........."
|
|
sleep 40
|
|
echo;echo;echo "Create and Admin User:"
|
|
su pleroma -s $SHELL -lc "echo y | ./bin/pleroma_ctl user new admin admin@$ENDPOINT --admin"
|
|
|
|
touch /configured.txt
|