Compare commits

...

11 Commits

Author SHA1 Message Date
PorridgePi
5ef0c109bd gitignore: feat: Ignore all data directories 2022-09-20 18:53:01 +08:00
PorridgePi
fcdb9ad534 gitignore: feat: Ignore all Docker env files except examples 2022-09-20 18:51:59 +08:00
PorridgePi
58508082d6 pihole: chore: Standardise data directory naming 2022-09-20 18:45:20 +08:00
PorridgePi
4e5807b5c2 pihole: fix: DNS service not starting 2022-09-20 15:09:09 +08:00
PorridgePi
046321b1ca pihole: feat: Add name to dns_net network 2022-09-20 14:35:06 +08:00
PorridgePi
199ad593c5 traefik: fix: Use default public Docker network 2022-09-20 14:31:33 +08:00
PorridgePi
3a43137e6c traefik: feat: Add HTTP basic authentication 2022-09-20 14:00:29 +08:00
PorridgePi
cd20970ae7 wg-easy: Initial commit 2022-09-15 12:49:19 +01:00
PorridgePi
5663226eb1 ipsec-vpn: feat: Add example vpn.env 2022-09-15 12:40:17 +01:00
PorridgePi
31c419db77 ipsec-vpn: Initial commit 2022-09-15 12:33:41 +01:00
PorridgePi
278bf624fb traefik: feat: Expose Traefik Dashboard to subdomain 2022-09-14 06:42:58 +01:00
7 changed files with 126 additions and 6 deletions

9
.gitignore vendored
View File

@@ -1,5 +1,10 @@
# macOS # macOS
.DS_Store .DS_Store
# Docker # Ignore Docker env files
.env *.env
# excluding example env files
!*.example.env
# Ignore all directories ending with data
*data/

View File

@@ -0,0 +1,22 @@
version: "3.9"
networks:
dns_net:
external: true
services:
ipsec-vpn:
image: hwdsl2/ipsec-vpn-server
container_name: ipsec-vpn
restart: always
env_file:
- ./vpn.env
volumes:
- "./ikev2-vpn-data:/etc/ipsec.d"
- "/lib/modules:/lib/modules:ro"
ports:
- "500:500/udp"
- "4500:4500/udp"
networks:
- dns_net
privileged: true

37
ipsec-vpn/vpn.env.example Executable file
View File

@@ -0,0 +1,37 @@
# Note: All the variables to this image are optional.
# See README for more information.
# To use, uncomment and replace with your own values.
# Define IPsec PSK, VPN username and password
# - DO NOT put "" or '' around values, or add space around =
# - DO NOT use these special characters within values: \ " '
VPN_IPSEC_PSK=psk_goes_here
VPN_USER=username_goes_here
VPN_PASSWORD=password_goes_here
# Define additional VPN users
# - DO NOT put "" or '' around values, or add space around =
# - DO NOT use these special characters within values: \ " '
# - Usernames and passwords must be separated by spaces
# VPN_ADDL_USERS=additional_username_1 additional_username_2
# VPN_ADDL_PASSWORDS=additional_password_1 additional_password_2
# Use a DNS name for the VPN server
# - The DNS name must be a fully qualified domain name (FQDN)
VPN_DNS_NAME=domain_name_goes_here
# Specify a name for the first IKEv2 client
# - Use one word only, no special characters except '-' and '_'
# - The default is 'vpnclient' if not specified
# VPN_CLIENT_NAME=your_client_name
# Use alternative DNS servers
# - By default, clients are set to use Google Public DNS
# - Example below shows Cloudflare's DNS service
VPN_DNS_SRV1=dns_server_goes_here
# VPN_DNS_SRV2=1.1.1.1
# Protect IKEv2 client config files using a password
# - By default, no password is required when importing IKEv2 client configuration
# - Uncomment if you want to protect these files using a random password
# VPN_PROTECT_CONFIG=yes

View File

@@ -2,6 +2,7 @@ version: "3.9"
networks: networks:
dns_net: dns_net:
name: dns_net
driver: bridge driver: bridge
ipam: ipam:
config: config:
@@ -25,16 +26,17 @@ services:
- "WEBPASSWORD=${PIHOLE_PASSWORD}" - "WEBPASSWORD=${PIHOLE_PASSWORD}"
- "DNS1=172.20.0.11#5335" - "DNS1=172.20.0.11#5335"
- "DNS2=no" - "DNS2=no"
- "DNSMASQ_USER=root"
volumes: volumes:
- "./etc-pihole/:/etc/pihole/" - "./pihole-data/:/etc/pihole/"
- "./etc-dnsmasq.d/:/etc/dnsmasq.d/" - "./dnsmasq.d-data/:/etc/dnsmasq.d/"
unbound: unbound:
image: mvance/unbound-rpi:latest image: mvance/unbound-rpi:latest
container_name: unbound container_name: unbound
restart: always restart: always
volumes: volumes:
- "./unbound:/opt/unbound/etc/unbound" - "./unbound-data:/opt/unbound/etc/unbound"
networks: networks:
dns_net: dns_net:
ipv4_address: 172.20.0.11 ipv4_address: 172.20.0.11

12
traefik/docker-compose.yml Normal file → Executable file
View File

@@ -21,7 +21,7 @@ services:
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
- "8080:8080" # - "8080:8080"
networks: networks:
- public - public
command: command:
@@ -29,6 +29,7 @@ services:
- "--api.insecure=true" - "--api.insecure=true"
- "--providers.docker=true" - "--providers.docker=true"
- "--providers.docker.exposedbydefault=false" - "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=public"
- "--entrypoints.web.address=:80" - "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure" - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.websecure.address=:443" - "--entrypoints.websecure.address=:443"
@@ -40,3 +41,12 @@ services:
- "--certificatesresolvers.le.acme.dnschallenge=true" - "--certificatesresolvers.le.acme.dnschallenge=true"
- "--certificatesresolvers.le.acme.dnschallenge.provider=cloudflare" - "--certificatesresolvers.le.acme.dnschallenge.provider=cloudflare"
- "--certificatesresolvers.le.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53" - "--certificatesresolvers.le.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53"
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`${TRAEFIK_DOMAIN}`)"
- "traefik.http.routers.dashboard.service=dashboard-service"
- "traefik.http.services.dashboard-service.loadbalancer.server.port=8080"
- "traefik.http.routers.dashboard.tls=true"
- "traefik.http.routers.dashboard.tls.certresolver=le"
- "traefik.http.middlewares.dashboard-basicauth.basicauth.users=${BASIC_AUTH_CREDENTIALS}"
- "traefik.http.routers.dashboard.middlewares=dashboard-basicauth@docker"

5
wg-easy/.env.example Executable file
View File

@@ -0,0 +1,5 @@
WG_HOST=vpn_domain_goes_here
WG_DOMAIN=web_ui_domain_goes_here
WG_PASSWORD=password_goes_here
WG_PORT=51820
WG_DEFAULT_DNS=dns_servers_go_here

View File

@@ -0,0 +1,39 @@
version: "3.9"
networks:
public:
external: true
dns_net:
external: true
services:
wg-easy:
image: weejewel/wg-easy
container_name: wg-easy
restart: always
environment:
- WG_HOST=${WG_HOST}
- PASSWORD=${WG_PASSWORD}
- WG_PORT=${WG_PORT}
- WG_DEFAULT_DNS=${WG_DEFAULT_DNS}
volumes:
- "./data:/etc/wireguard"
ports:
- "${WG_PORT}:51820/udp"
# - "51821:51821/tcp"
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
networks:
- public
- dns_net
labels:
- "traefik.enable=true"
- "traefik.http.routers.wg.rule=Host(`${WG_DOMAIN}`)"
- "traefik.http.routers.wg.service=wg-service"
- "traefik.http.services.wg-service.loadbalancer.server.port=51821"
- "traefik.http.routers.wg.tls=true"
- "traefik.http.routers.wg.tls.certresolver=le"