My own modifications. Enjoy!

- Bronze
This commit is contained in:
2023-08-13 01:50:00 -04:00
parent 8fb03c885c
commit 3e64b4b2dd
13 changed files with 224 additions and 182 deletions

5
scripts/db-dump.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
docker compose down
docker compose up db -d
docker exec -u pleroma pleroma_db pg_dump -Fc pleroma > db.dump
docker compose down

4
scripts/db-restore.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
docker compose pull db
docker compose up db -d
docker exec -i -u pleroma pleroma_db pg_restore -C -d postgres < db.dump

5
scripts/db-vacuum.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
docker compose down
docker compose up db -d
docker exec -it pleroma_db psql -U pleroma -d pleroma -c 'vacuum(full,analyse,verbose);'
docker compose up web -d

6
scripts/rebuild.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
docker compose down
docker compose pull db
#docker build -t pleroma . --build-arg PLEROMA_VER=develop --no-cache
docker compose build web --no-cache
docker compose up -d

28
scripts/setup.sh Normal file
View File

@ -0,0 +1,28 @@
#!/bin/sh
read -p "Enter the domain your instance will run from: " PL_DOMAIN
read -p "Enter the name of your instance: " PL_INSTANCE_NAME
read -p "Enter the admin email: " PL_ADMIN_EMAIL
read -p "Enter the notify email: " PL_NOTIFY_EMAIL
PL_DB_PASS=`strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 48 | tr -d '\n'; echo`
sed -i -e "s/CHANGETHEDATABASEPASSWORD!/${PL_DB_PASS}/g" \
-e "s/admin@example.com/${PL_ADMIN_EMAIL}/g" \
-e "s/notify@example.com/${PL_NOTIFY_EMAIL}/g" \
-e "s/Pleroma/${PL_INSTANCE_NAME}/g" \
-e "s/example.com/${PL_DOMAIN}/g" \
docker-compose.yml
chmod o= config.exs
docker compose up -d db
sleep 10
docker exec -i pleroma_db psql -U pleroma -c "CREATE EXTENSION IF NOT EXISTS citext;"
docker compose down
docker compose build web --no-cache
docker compose up -d
sleep 10
echo "The docker container for your instance should be up and ready, but there is no admin account..."
read -p "Enter the admin username: " PL_ADMIN_USERNAME
docker exec -it pleroma_web sh ./bin/pleroma_ctl user new "${PL_ADMIN_USERNAME}" "${PL_ADMIN_EMAIL}" --admin
echo "Please copy the reset link above and save it, and make sure to set up your reverse proxy so you can access your new instance!"

6
scripts/update-plfe.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
rm -rf static/frontends/pleroma-fe
FRONTEND_LINK=`curl -sS https://git.pleroma.social/pleroma/pleroma-fe/-/jobs/artifacts/develop/download?job=build | grep -io '<a href=['"'"'"][^"'"'"']*['"'"'"]' | sed -e 's/^<a href=["'"'"']//i' -e 's/["'"'"']$//i'`
echo "The download link for pleroma-fe is:"
echo "${FRONTEND_LINK}"
docker exec -it pl_web sh ./bin/pleroma_ctl frontend install pleroma-fe --ref develop --build-url "${FRONTEND_LINK}"