From 3fd4fc1857a80c5808d00f365d130a0fa56cf308 Mon Sep 17 00:00:00 2001 From: Hoai Viet Nguyen <viet.nguyen@th-koeln.de> Date: Fri, 25 Apr 2025 22:36:29 +0200 Subject: [PATCH 1/2] add forward proxy authentication --- docker-compose.yml | 3 ++- httpforwardproxy/.htpasswd | 1 + httpforwardproxy/Dockerfile | 4 ++++ httpforwardproxy/httpforwardproxy.docker-compose.yml | 7 +++++++ httpforwardproxy/nginx.conf | 12 ++++++++++++ 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 httpforwardproxy/.htpasswd create mode 100644 httpforwardproxy/Dockerfile create mode 100644 httpforwardproxy/httpforwardproxy.docker-compose.yml create mode 100644 httpforwardproxy/nginx.conf diff --git a/docker-compose.yml b/docker-compose.yml index fec8224..c6d2c01 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,4 +7,5 @@ include: - caddy/caddy.docker-compose.yml - ftp/ftp.docker-compose.yml - nginx/nginx.docker-compose.yml - - apache/apache.docker-compose.yml \ No newline at end of file + - apache/apache.docker-compose.yml + - httpforwardproxy/httpforwardproxy.docker-compose.yml \ No newline at end of file diff --git a/httpforwardproxy/.htpasswd b/httpforwardproxy/.htpasswd new file mode 100644 index 0000000..5acfe8d --- /dev/null +++ b/httpforwardproxy/.htpasswd @@ -0,0 +1 @@ +viet:$apr1$z385Ast0$zCDKRE.F.ozWRDft0wElb. diff --git a/httpforwardproxy/Dockerfile b/httpforwardproxy/Dockerfile new file mode 100644 index 0000000..7c2def0 --- /dev/null +++ b/httpforwardproxy/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:stable-alpine + +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY .htpasswd /etc/nginx/.htpasswd \ No newline at end of file diff --git a/httpforwardproxy/httpforwardproxy.docker-compose.yml b/httpforwardproxy/httpforwardproxy.docker-compose.yml new file mode 100644 index 0000000..b48aeb2 --- /dev/null +++ b/httpforwardproxy/httpforwardproxy.docker-compose.yml @@ -0,0 +1,7 @@ +services: + httpforwardproxy: + build: . + ports: + - 8888:8888 + networks: + - intranet \ No newline at end of file diff --git a/httpforwardproxy/nginx.conf b/httpforwardproxy/nginx.conf new file mode 100644 index 0000000..276fdf5 --- /dev/null +++ b/httpforwardproxy/nginx.conf @@ -0,0 +1,12 @@ +server { + listen 8888; + + location / { + resolver 127.0.0.11; + + proxy_pass http://$http_host$uri$is_args$args; + + auth_basic "Intranet"; + auth_basic_user_file /etc/nginx/.htpasswd; + } +} \ No newline at end of file -- GitLab From e4ecf3ba36b820ad7ccac993f093acc41836f9e5 Mon Sep 17 00:00:00 2001 From: Hoai Viet Nguyen <viet.nguyen@th-koeln.de> Date: Fri, 25 Apr 2025 23:38:05 +0200 Subject: [PATCH 2/2] add VPVN --- .gitignore | 3 ++- docker-compose.yml | 3 ++- vpn/vpn.docker-compose.yml | 25 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 vpn/vpn.docker-compose.yml diff --git a/.gitignore b/.gitignore index 791f730..7216b1f 100644 --- a/.gitignore +++ b/.gitignore @@ -192,4 +192,5 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk -# End of https://www.toptal.com/developers/gitignore/api/macos,visualstudiocode,intellij,windows \ No newline at end of file +# End of https://www.toptal.com/developers/gitignore/api/macos,visualstudiocode,intellij,windows +vpn/config \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c6d2c01..82090a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,4 +8,5 @@ include: - ftp/ftp.docker-compose.yml - nginx/nginx.docker-compose.yml - apache/apache.docker-compose.yml - - httpforwardproxy/httpforwardproxy.docker-compose.yml \ No newline at end of file + - httpforwardproxy/httpforwardproxy.docker-compose.yml + - vpn/vpn.docker-compose.yml \ No newline at end of file diff --git a/vpn/vpn.docker-compose.yml b/vpn/vpn.docker-compose.yml new file mode 100644 index 0000000..7ce120a --- /dev/null +++ b/vpn/vpn.docker-compose.yml @@ -0,0 +1,25 @@ +services: + vpn: + image: linuxserver/wireguard + cap_add: + - NET_ADMIN + - SYS_MODULE + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/Berlin + - SERVERURL=localhost #optional + - SERVERPORT=51820 #optional + - PEERS=1 #optional + - PEERDNS=auto #optional + - INTERNAL_SUBNET=10.13.13.0 #optional + volumes: + - ./config:/config + #- ./modules:/lib/modules + ports: + - 51820:51820/udp + sysctls: + - net.ipv4.conf.all.src_valid_mark=1 + restart: unless-stopped + networks: + - intranet \ No newline at end of file -- GitLab