setup.sh rework and fixes
This commit is contained in:
+23
-6
@@ -1,10 +1,27 @@
|
||||
#!/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`
|
||||
# Check if docker is installed
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "Error: docker command not found. Please install docker before running this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if docker daemon is running
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
echo "Error: docker daemon is not running. Please start docker before running this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
prompt_read() {
|
||||
printf "%s " "$1"
|
||||
read -r "$2"
|
||||
}
|
||||
prompt_read "Enter the domain your instance will run from: " PL_DOMAIN
|
||||
prompt_read "Enter the name of your instance: " PL_INSTANCE_NAME
|
||||
prompt_read "Enter the admin email: " PL_ADMIN_EMAIL
|
||||
prompt_read "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" \
|
||||
@@ -23,6 +40,6 @@ 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
|
||||
prompt_read "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!"
|
||||
Reference in New Issue
Block a user