wip - v1 => It's working !! #1
@@ -5,7 +5,7 @@ services:
 | 
				
			|||||||
    container_name: adguard-cidre
 | 
					    container_name: adguard-cidre
 | 
				
			||||||
    environment:
 | 
					    environment:
 | 
				
			||||||
      - TZ=Europe/Paris # change to your timezone
 | 
					      - TZ=Europe/Paris # change to your timezone
 | 
				
			||||||
      - BLOCK_COUNTRIES=CN,RU,IR # choose countries listed IP to block. Full lists here https://github.com/vulnebify/cidre/tree/main/output/cidr/ipv4
 | 
					      - BLOCK_COUNTRIES=cn,ru,ir # choose countries listed IP to block. Full lists here https://github.com/vulnebify/cidre/tree/main/output/cidr/ipv4
 | 
				
			||||||
      - BLOCKLIST_CRON=0 6 * * * # at 6:00 every days
 | 
					      - BLOCKLIST_CRON=0 6 * * * # at 6:00 every days
 | 
				
			||||||
      - DOCKER_API_URL=http://socket-proxy-adguard:2375 # docker socket proxy
 | 
					      - DOCKER_API_URL=http://socket-proxy-adguard:2375 # docker socket proxy
 | 
				
			||||||
      - ADGUARD_CONTAINER_NAME=adguardhome # adguard container name
 | 
					      - ADGUARD_CONTAINER_NAME=adguardhome # adguard container name
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,8 +21,8 @@ mkdir -p /tmp/cidr
 | 
				
			|||||||
IFS=',' read -ra CODES <<< "$COUNTRIES"
 | 
					IFS=',' read -ra CODES <<< "$COUNTRIES"
 | 
				
			||||||
for CODE in "${CODES[@]}"; do
 | 
					for CODE in "${CODES[@]}"; do
 | 
				
			||||||
  echo "Downloading CIDR list for $CODE..."
 | 
					  echo "Downloading CIDR list for $CODE..."
 | 
				
			||||||
  curl -sf "$CIDR_BASE_URL/${CODE^^}.txt" -o "/tmp/cidr/${CODE}.txt" || continue
 | 
					  curl -sf "$CIDR_BASE_URL/${CODE,,}.cidr" -o "/tmp/cidr/${CODE}.cidr" || continue
 | 
				
			||||||
  cat "/tmp/cidr/${CODE}.txt" >> /tmp/cidr/all.txt
 | 
					  cat "/tmp/cidr/${CODE}.cidr" >> /tmp/cidr/all.txt
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -f "$MANUAL_IPS_FILE" ]; then
 | 
					if [ -f "$MANUAL_IPS_FILE" ]; then
 | 
				
			||||||
@@ -42,7 +42,7 @@ END { if (inside==1) print ips }
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
mv "$TMP_YAML" "$ADGUARD_YAML"
 | 
					mv "$TMP_YAML" "$ADGUARD_YAML"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "Restarting adguard-home container..."
 | 
					echo "Restarting adguard..."
 | 
				
			||||||
curl -s -X POST "$DOCKER_API_URL/containers/$ADGUARD_CONTAINER_NAME/restart" -o /dev/null
 | 
					curl -s -X POST "$DOCKER_API_URL/containers/$ADGUARD_CONTAINER_NAME/restart" -o /dev/null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "Done."
 | 
					echo "Done."
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user