From d31a9c626de8a649d13178865c32efa776ba7194 Mon Sep 17 00:00:00 2001 From: akshay Date: Fri, 29 Mar 2024 15:28:03 +0530 Subject: [PATCH] Push authentik install script --- authentik_install.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 authentik_install.sh diff --git a/authentik_install.sh b/authentik_install.sh new file mode 100644 index 0000000..aa36d71 --- /dev/null +++ b/authentik_install.sh @@ -0,0 +1,40 @@ +#! /bin/bash + + +if [ "$(whoami)" != "root" ]; then + SUDO=sudo +fi + +DIR="/usr/local/src/authentik" +if [ -d "$DIR" ]; then + ${SUDO} mkdir $DIR + ${SUDO} $DIR +fi + +${SUDO} wget https://goauthentik.io/docker-compose.yml +${SUDO} echo "PG_PASS=$(openssl rand -base64 36)" >> .envecho "PG_PASS=$(openssl rand -base64 36)" >> .env +${SUDO} echo "AUTHENTIK_SECRET_KEY=$(openssl rand -base64 36)" >> .env +${SUDO} echo "AUTHENTIK_ERROR_REPORTING__ENABLED=true" >> .env + +${SUDO} read -p "Enable email notification[y/N]: " -ei 'N' EMAIL + +if [ "$EMAIL" == "y" -o $EMAIL == "Y" ]; then + # SMTP Host Emails are sent to + read -p "Email host: " -ei 'localhost' E_HOST + read -p "Email port: " -ei '25' E_PORT + read -p "Username: " -e E_USER + read -p "Password: " -e E_PASS + read -p "ENABLE TLS[true/false]: " -ei 'false' E_TLS + read -p "Email address: " -e E_FROM + + ${SUDO} echo "AUTHENTIK_EMAIL__HOST=$E_HOST" >> .env + ${SUDO} echo "AUTHENTIK_EMAIL__PORT=$E_PORT" >> .env + ${SUDO} echo "AUTHENTIK_EMAIL__USERNAME=$E_USER" >> .env + ${SUDO} echo "AUTHENTIK_EMAIL__PASSWORD=$E_PASS" >> .env + ${SUDO} echo "AUTHENTIK_EMAIL__USE_TLS=$E_TLS" >> .env + ${SUDO} echo "AUTHENTIK_EMAIL__FROM=$E_FROM" >> .env +fi + +${SUDO} docker-compose pull +${SUDO} docker-compose up +