Skip to content
Snippets Groups Projects
Commit a4ba2072 authored by Elian Loraux's avatar Elian Loraux
Browse files

add list domain in readme

parent 9d7744fa
No related branches found
No related tags found
No related merge requests found
...@@ -26,3 +26,32 @@ actionunban = cd /home/dockerweb/ban; sed -E "s/,\`<ip>\`//g; s/\`<ip>\`,//g; s/ ...@@ -26,3 +26,32 @@ actionunban = cd /home/dockerweb/ban; sed -E "s/,\`<ip>\`//g; s/\`<ip>\`,//g; s/
Dans `/etc/fail2ban/jail.conf` on doit ajouter `banaction = docker-page` dans la partie traefik Dans `/etc/fail2ban/jail.conf` on doit ajouter `banaction = docker-page` dans la partie traefik
Pour récupere les hosts :
```bash
domain=$(bash $DIR/checks/list_domains.sh | grep -v '===' | sed "s/^/\`/" | sed "s/$/\`/" | paste -sd "," -)
sed -i "s/HOSTS=.*/HOSTS=$domain/" .env
```
list domaine :
```bash
#!/bin/bash
echo "RUN $(basename "$0") ==="
if [ "${WEB_SERVER}" == "apache2" ]; then
apache2ctl -S 2>/dev/null | awk '/namevhost/{print "https://"$4}' | sort -u | grep -v "127.0...1"
elif [ ! -z "${WEB_SERVER}"]; then
awk '/^[ \t]*(server_name|server_alias)/{gsub(/;$/, "", $2); print "https://"$2}' /etc/nginx/*-enabled/* | sort -u
fi
# If traefik module is enable
if id "dockerweb" >/dev/null 2>&1; then
# List all traefik domain
echo "===== list of domain ===="
docker ps -qa | xargs docker inspect | awk '/traefik.http.routers.*.rule/{print $2}' | sed -e 's/^"Host(`//' -e 's/`)",*//' -e 's/`,`/\n/g' | grep -v '!ClientIP' | sort -u
fi
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment