#!/bin/bash # This install script requires the minimum requirements already installed. # How to do this is described in detail in [setup.md](./setup.md) # Load .env or .env.dist if not present set -o allexport if [ -f ".env" ]; then source .env else source .env.dist fi set +o allexport # Install mariadb sudo apt-get install -y mariadb-server sudo mysql_secure_installation # Enter current password for root (enter for none): enter # Switch to unix_socket authentication [Y/n] Y # Change the root password? [Y/n] n # Remove anonymous users? [Y/n] Y # Disallow root login remotely? [Y/n] Y # Remove test database and access to it? [Y/n] Y # Reload privilege tables now? [Y/n] Y # create db user DB_USER=gradido DB_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo); # create table #create database gradido_community # DEFAULT CHARACTER SET utf8mb4 # DEFAULT COLLATE utf8mb4_unicode_ci; # GRANT ALL PRIVILEGES ON gradido_community.* TO '$DB_USER'@'localhost'; sudo mysql < Enter email address (used for urgent renewal and security notices) > support@gradido.net > Please read the Terms of Service at > Y > Would you be willing, once your first certificate is successfully issued, to > N > No names were found in your configuration files. Please enter in your domain > stage1.gradido.net # Generate gradido.conf from template # TODO order - first certbot, then nginx setup case "$NGINX_SSL" in true) TEMPLATE_FILE="gradido.conf.ssl.template" ;; *) TEMPLATE_FILE="gradido.conf.template" ;; esac envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $TEMPLATE_FILE > gradido.conf # Generate update-page.conf from template case "$NGINX_SSL" in true) TEMPLATE_FILE="update-page.conf.ssl.template" ;; *) TEMPLATE_FILE="update-page.conf.template" ;; esac envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $TEMPLATE_FILE > update-page.conf git config pull.ff only