forked from gcgarner/IOTstack
-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20220118 networking - master branch - PR 1 of 2
This PR follows on from [Issue 422](#422 (comment)) and the networking scheme proposed therein to support remote WireGuard clients obtaining DNS from ad-blockers (eg PiHole) running in another container on the same RPi as the WireGuard server. This PR implements: 1. Two internal networks: * "default" (`iotstack_default` at runtime). * "nextcloud" (`iotstack_nextcloud` at runtime). 2. Docker allocates all IP addressing, dynamically, from 172.16/12 (reverting from 10/8 subnets). 3. NextCloud *explicitly* joins both internal networks. 4. NextCloud_DB *explicitly* joins "nextcloud". 5. All other containers *implicitly* join "default". 6. No networking differences between old and new menus (full harmonisation). 7. Resolves all remaining new-menu inconsistencies first raised in [Issue 245](#245). Adds `use-container-dns.sh` to WireGuard service template folder to support WireGuard forwarding DNS requests to ad-blockers running on the same RPi. This is based on work done by @ukkopahis. This change is related to the networking changes which deviate from the scheme proposed in Issue 422. Documentation: 1. Adds "significant change to networking" to main README.md. 2. Updates WireGuard to explain how to forward DNS requests to ad-blockers running on the same RPi. Signed-off-by: Phill Kelley <[email protected]>
- Loading branch information
1 parent
f876d33
commit b8597b0
Showing
46 changed files
with
217 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,4 @@ adminer: | |
restart: unless-stopped | ||
ports: | ||
- "9080:8080" | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,4 @@ chronograf: | |
depends_on: | ||
- influxdb | ||
# - kapacitor | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ dashmachine: | |
ports: | ||
- 5000:5000 | ||
restart: unless-stopped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,5 @@ deconz: | |
- DEBUG_ZCL=0 | ||
- DEBUG_ZDP=0 | ||
- DEBUG_OTAU=0 | ||
networks: | ||
- iotstack_nw | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,4 @@ diyhue: | |
volumes: | ||
- ./volumes/diyhue:/opt/hue-emulator/export | ||
restart: unless-stopped | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ domoticz: | |
- PGID=1000 | ||
# - TZ= | ||
# - WEBROOT=domoticz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ dozzle: | |
# - "8888:8080" | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,13 @@ | ||
networks: | ||
iotstack_nw: # Exposed by your host. | ||
# external: true | ||
name: IOTstack_Net | ||
|
||
default: | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 10.77.60.0/24 | ||
# - gateway: 10.77.60.1 | ||
|
||
iotstack_nw_internal: # For interservice communication. No access to outside | ||
name: IOTstack_Net_Internal | ||
nextcloud: | ||
driver: bridge | ||
internal: true | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 10.77.76.0/24 | ||
# - gateway: 10.77.76.1 | ||
|
||
vpn_nw: # Network specifically for VPN | ||
name: IOTstack_VPN | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 10.77.88.0/24 | ||
# - gateway: 192.18.200.1 | ||
|
||
nextcloud_internal: # Network for NextCloud service | ||
name: IOTstack_NextCloud | ||
driver: bridge | ||
internal: true | ||
|
||
# default: | ||
# external: true | ||
# name: iotstack_nw | ||
|
||
# hosts_nw: | ||
# driver: hosts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ espruinohub: | |
network_mode: host | ||
privileged: true | ||
restart: unless-stopped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,4 @@ gitea: | |
volumes: | ||
- ./volumes/gitea/data:/data | ||
- /etc/timezone:/etc/timezone:ro | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ heimdall: | |
- 8880:80 | ||
- 8883:443 | ||
restart: unless-stopped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ home_assistant: | |
volumes: | ||
- /etc/localtime:/etc/localtime:ro | ||
- ./volumes/home_assistant:/config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ homebridge: | |
#ports: | ||
# - "4040:4040" | ||
network_mode: host | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ homer: | |
ports: | ||
- "8881:8080" | ||
restart: unless-stopped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,4 @@ kapacitor: | |
- ./volumes/kapacitor:/var/lib/kapacitor | ||
depends_on: | ||
- influxdb | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,4 @@ mariadb: | |
ports: | ||
- "3306:3306" | ||
restart: unless-stopped | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,4 @@ octoprint: | |
# - /dev/video0:/dev/video0 | ||
volumes: | ||
- ./volumes/octoprint:/octoprint | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ openhab: | |
# options: | ||
# max-size: "5m" | ||
# max-file: "3" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ plex: | |
- ./volumes/plex/config:/config | ||
- ./volumes/plex/transcode:/transcode | ||
restart: unless-stopped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ portainer-ce: | |
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- ./volumes/portainer-ce/data:/data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,4 @@ postgres: | |
- "5432:5432" | ||
volumes: | ||
- ./volumes/postgres/data:/var/lib/postgresql/data | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,4 @@ python: | |
# - "external:internal" | ||
volumes: | ||
- ./volumes/python/app:/usr/src/app | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ | |
- "6881:6881/udp" | ||
- "15080:15080" | ||
- "1080:1080" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,5 @@ rtl_433: | |
- MQTT_TOPIC=RTL_433 | ||
devices: | ||
- /dev/bus/usb | ||
networks: | ||
- iotstack_nw | ||
restart: unless-stopped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,4 @@ tasmoadmin: | |
- "8088:80" | ||
volumes: | ||
- ./volumes/tasmoadmin/data:/data | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,4 @@ telegraf: | |
depends_on: | ||
- influxdb | ||
- mosquitto | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,4 @@ transmission: | |
- "51413:51413" | ||
- "51413:51413/udp" | ||
restart: unless-stopped | ||
networks: | ||
- iotstack_nw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Forward DNS requests from remote WireGuard clients to the default | ||
# gateway on the internal bridged network that the WireGuard container | ||
# is attached to. This results in queries being sent to any other | ||
# container on the same internal bridged network that is listening | ||
# on port 53 (eg PiHole, AdGuardHome or bind9). | ||
# | ||
# Acknowledgement: @ukkopahis | ||
|
||
GW=$(ip route list default | head -1 | cut -d " " -f 3) | ||
echo Creating Corefile to use DNS at $GW | ||
echo "# Generated by use-container-dns.sh | ||
. { | ||
loop | ||
forward . dns://${GW} | ||
}" > /config/coredns/Corefile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.