diff options
Diffstat (limited to 'roles/common/files')
| -rw-r--r-- | roles/common/files/jail.conf | 10 | ||||
| -rw-r--r-- | roles/common/files/jitsi-letsencrypt.sh | 100 | ||||
| -rw-r--r-- | roles/common/files/nftables.conf | 35 | ||||
| -rw-r--r-- | roles/common/files/service-override.conf | 7 |
4 files changed, 0 insertions, 152 deletions
diff --git a/roles/common/files/jail.conf b/roles/common/files/jail.conf deleted file mode 100644 index 5cbf4b7..0000000 --- a/roles/common/files/jail.conf +++ /dev/null @@ -1,10 +0,0 @@ -[DEFAULT] - -backend = systemd -banaction = nftables-multiport - -# 92.154.111.181 - IP des bureaux de nereide -ignoreip = 127.0.0.1 92.154.111.181 -findtime = 1h -bantime = 1d -maxretry = 3
\ No newline at end of file diff --git a/roles/common/files/jitsi-letsencrypt.sh b/roles/common/files/jitsi-letsencrypt.sh deleted file mode 100644 index 13e2968..0000000 --- a/roles/common/files/jitsi-letsencrypt.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash - -set -e - -DEB_CONF_RESULT=`debconf-show jitsi-meet-web-config | grep jvb-hostname` -DOMAIN="${DEB_CONF_RESULT##*:}" -# remove whitespace -DOMAIN="$(echo -e "${DOMAIN}" | tr -d '[:space:]')" - -echo "-------------------------------------------------------------------------" -echo "This script will:" -echo "- Need a working DNS record pointing to this machine(for domain ${DOMAIN})" -echo "- Download certbot-auto from https://dl.eff.org to /usr/local/sbin" -echo "- Install additional dependencies in order to request Let’s Encrypt certificate" -echo "- If running with jetty serving web content, will stop Jitsi Videobridge" -echo "- Configure and reload nginx or apache2, whichever is used" -echo "- Configure the coturn server to use Let's Encrypt certificate and add required deploy hooks" -echo "- Add command in weekly cron job to renew certificates regularly" -echo "" -echo "You need to agree to the ACME server's Subscriber Agreement (https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf) " -echo "by providing an email address for important account notifications" - -#echo -n "Enter your email and press [ENTER]: " -#read EMAIL -EMAIL=supervision@nereide.fr - -cd /usr/local/sbin - -if [ ! -f certbot-auto ] ; then - wget https://dl.eff.org/certbot-auto - chmod a+x ./certbot-auto -fi - -CRON_FILE="/etc/cron.weekly/letsencrypt-renew" -if [ ! -d "/etc/cron.weekly" ] ; then - mkdir "/etc/cron.weekly" -fi -echo "#!/bin/bash" > $CRON_FILE -echo "/usr/local/sbin/certbot-auto renew >> /var/log/le-renew.log" >> $CRON_FILE - -CERT_KEY="/etc/letsencrypt/live/$DOMAIN/privkey.pem" -CERT_CRT="/etc/letsencrypt/live/$DOMAIN/fullchain.pem" - -if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then - - TURN_CONFIG="/etc/turnserver.conf" - TURN_HOOK=/etc/letsencrypt/renewal-hooks/deploy/0000-coturn-certbot-deploy.sh - if [ -f $TURN_CONFIG ] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then - mkdir -p $(dirname $TURN_HOOK) - - cp /usr/share/jitsi-meet-turnserver/coturn-certbot-deploy.sh $TURN_HOOK - chmod u+x $TURN_HOOK - sed -i "s/jitsi-meet.example.com/$DOMAIN/g" $TURN_HOOK - fi - - ./certbot-auto certonly --noninteractive \ - --webroot --webroot-path /usr/share/jitsi-meet \ - -d $DOMAIN \ - --agree-tos --email $EMAIL \ - --deploy-hook $TURN_HOOK - - echo "Configuring nginx" - - CONF_FILE="/etc/nginx/sites-available/$DOMAIN.conf" - CERT_KEY_ESC=$(echo $CERT_KEY | sed 's/\./\\\./g') - CERT_KEY_ESC=$(echo $CERT_KEY_ESC | sed 's/\//\\\//g') - sed -i "s/ssl_certificate_key\ \/etc\/jitsi\/meet\/.*key/ssl_certificate_key\ $CERT_KEY_ESC/g" \ - $CONF_FILE - CERT_CRT_ESC=$(echo $CERT_CRT | sed 's/\./\\\./g') - CERT_CRT_ESC=$(echo $CERT_CRT_ESC | sed 's/\//\\\//g') - sed -i "s/ssl_certificate\ \/etc\/jitsi\/meet\/.*crt/ssl_certificate\ $CERT_CRT_ESC/g" \ - $CONF_FILE - - echo "service nginx reload" >> $CRON_FILE - service nginx reload -elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then - - ./certbot-auto certonly --noninteractive \ - --webroot --webroot-path /usr/share/jitsi-meet \ - -d $DOMAIN \ - --agree-tos --email $EMAIL - - echo "Configuring apache2" - - CONF_FILE="/etc/apache2/sites-available/$DOMAIN.conf" - CERT_KEY_ESC=$(echo $CERT_KEY | sed 's/\./\\\./g') - CERT_KEY_ESC=$(echo $CERT_KEY_ESC | sed 's/\//\\\//g') - sed -i "s/SSLCertificateKeyFile\ \/etc\/jitsi\/meet\/.*key/SSLCertificateKeyFile\ $CERT_KEY_ESC/g" \ - $CONF_FILE - CERT_CRT_ESC=$(echo $CERT_CRT | sed 's/\./\\\./g') - CERT_CRT_ESC=$(echo $CERT_CRT_ESC | sed 's/\//\\\//g') - sed -i "s/SSLCertificateFile\ \/etc\/jitsi\/meet\/.*crt/SSLCertificateFile\ $CERT_CRT_ESC/g" \ - $CONF_FILE - - echo "service apache2 reload" >> $CRON_FILE - service apache2 reload -fi - -# the cron file that will renew certificates -chmod a+x $CRON_FILE
\ No newline at end of file diff --git a/roles/common/files/nftables.conf b/roles/common/files/nftables.conf deleted file mode 100644 index 28f90cf..0000000 --- a/roles/common/files/nftables.conf +++ /dev/null @@ -1,35 +0,0 @@ - -#!/usr/sbin/nftables -f - -flush ruleset - -# family `inet` c'est pour ipv4/ipv6 -table inet myfilter { - chain myglobal { - # par défaut on accepte tous les paquets entrant - type filter hook input priority 0; policy accept; - # accepte les ping (mais pas plus de 1 par seconde) - ip protocol icmp icmp type { echo-request, echo-reply } limit rate 1/second accept - ip protocol icmp icmp type { echo-request, echo-reply } drop - ip6 nexthdr icmpv6 icmpv6 type { echo-request, echo-reply } limit rate 1/second accept - ip6 nexthdr icmpv6 icmpv6 type { echo-request, echo-reply } drop - # on accepte tout le reste du traffic icmp - ip protocol icmp accept - ip6 nexthdr icmpv6 accept - # accepte le traffic qui vient de nous - ct state established,related accept - ct state invalid drop - # accepte le traffic localhost - iif lo accept - # accepte tout le traffic ssh peut importe l'origine - tcp dport 22 accept - # accepte le traffic tcp depuis le reste du monde si la cible est un des ports http, https, smtp - tcp dport {25, 80, 443} accept - # ouvre les port udp I/O 10000 et 44446 pour jitsi - udp dport {10000, 4446} accept - udp sport {10000, 4446} accept - - # count and drop any other traffic - counter drop - } -} diff --git a/roles/common/files/service-override.conf b/roles/common/files/service-override.conf deleted file mode 100644 index 885915e..0000000 --- a/roles/common/files/service-override.conf +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -After=nftables.service -PartOf=nftables.service - -[Service] -ExecStartPre=nft add table inet filter -ExecStartPre=nft add chain inet filter input { type filter hook input priority 0; policy accept; } |
