Scripts to setup shell and install base packages
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB

  1. #! /bin/bash
  2. if [ "$(whoami)" != "root" ]; then
  3. SUDO=sudo
  4. fi
  5. DIR="/usr/local/src/authentik"
  6. if [ -d "$DIR" ]; then
  7. ${SUDO} mkdir $DIR
  8. ${SUDO} $DIR
  9. fi
  10. ${SUDO} wget https://goauthentik.io/docker-compose.yml
  11. ${SUDO} echo "PG_PASS=$(openssl rand -base64 36)" >> .envecho "PG_PASS=$(openssl rand -base64 36)" >> .env
  12. ${SUDO} echo "AUTHENTIK_SECRET_KEY=$(openssl rand -base64 36)" >> .env
  13. ${SUDO} echo "AUTHENTIK_ERROR_REPORTING__ENABLED=true" >> .env
  14. ${SUDO} read -p "Enable email notification[y/N]: " -ei 'N' EMAIL
  15. if [ "$EMAIL" == "y" -o $EMAIL == "Y" ]; then
  16. # SMTP Host Emails are sent to
  17. read -p "Email host: " -ei 'localhost' E_HOST
  18. read -p "Email port: " -ei '25' E_PORT
  19. read -p "Username: " -e E_USER
  20. read -p "Password: " -e E_PASS
  21. read -p "ENABLE TLS[true/false]: " -ei 'false' E_TLS
  22. read -p "Email address: " -e E_FROM
  23. ${SUDO} echo "AUTHENTIK_EMAIL__HOST=$E_HOST" >> .env
  24. ${SUDO} echo "AUTHENTIK_EMAIL__PORT=$E_PORT" >> .env
  25. ${SUDO} echo "AUTHENTIK_EMAIL__USERNAME=$E_USER" >> .env
  26. ${SUDO} echo "AUTHENTIK_EMAIL__PASSWORD=$E_PASS" >> .env
  27. ${SUDO} echo "AUTHENTIK_EMAIL__USE_TLS=$E_TLS" >> .env
  28. ${SUDO} echo "AUTHENTIK_EMAIL__FROM=$E_FROM" >> .env
  29. fi
  30. ${SUDO} docker-compose pull
  31. ${SUDO} docker-compose up