diff --git a/tools/configure-scodoc9.sh b/tools/configure-scodoc9.sh index c40c8b30..4952cb9d 100755 --- a/tools/configure-scodoc9.sh +++ b/tools/configure-scodoc9.sh @@ -15,10 +15,10 @@ source "$SCRIPT_DIR/utils.sh" cd /opt/scodoc || die "Error: chdir to /opt/scodoc" check_uid_root -# ------------ VERIF SYSTEME +# ------------ VERIF SYSTEME if [ -e /etc/debian_version ] -then +then debian_version=$(cat /etc/debian_version) debian_version=${debian_version%%.*} echo "Detected Debian version: ${debian_version}" @@ -36,7 +36,7 @@ fi echo "--- Configuration de ScoDoc pour Debian 12" # ------------ CONFIG FIREWALL OPTIONNELLE -echo +echo echo "Le firewall aide a proteger votre serveur d'intrusions indesirables." echo -n "Voulez vous configurer un firewall minimal (ufw) ? (y/n) [n] " read -r ans @@ -44,6 +44,7 @@ if [ "$(norm_ans "$ans")" = 'Y' ] then echo 'Installation du firewall IP ufw (voir documentation Debian)' echo ' on autorise les connexions ssh et https' + apt-get install ufw ufw default deny incoming ufw default allow outgoing ufw allow ssh @@ -57,7 +58,7 @@ fi # ------------ CONFIG NGINX # --- CERTIFICATS AUTO-SIGNES -echo +echo echo "Le serveur Web utilisé par ScoDoc et nginx" echo "Il est possible d'utiliser des certificats cryptographiques" echo "auto-signés, qui ne seront pas reconnus comme de confiance" @@ -83,7 +84,7 @@ then echo -n "Adresse mail de l'administrateur du site: " read SCODOC_ADMIN_MAIL SECRET_KEY=$(python3 -c "import uuid; print(uuid.uuid4().hex)") - cat > /opt/scodoc-data/.env < /opt/scodoc-data/.env < Description: ScoDoc 9 Un logiciel pour le suivi de la scolarité universitaire. -Depends: adduser, curl, gcc, graphviz, graphviz-dev, libpq-dev, postfix|exim4, cracklib-runtime, libcrack2-dev, libpango-1.0-0, pango1.0-tools, python3-dev, python3-venv, python3-pip, python3-wheel, nginx, postgresql, libpq-dev, redis, ufw +Depends: adduser, curl, gcc, graphviz, graphviz-dev, libpq-dev, postfix|exim4, cracklib-runtime, libcrack2-dev, libpango-1.0-0, pango1.0-tools, python3-dev, python3-venv, python3-pip, python3-wheel, nginx, postgresql, libpq-dev, redis +Recommends: ufw