From 7ce3c4f6a91573a2748b31deabbd7a4291a8c78d Mon Sep 17 00:00:00 2001 From: willemserruys Date: Thu, 17 Nov 2022 23:45:11 +0100 Subject: [PATCH] refactoring --- VPN/openvpn/readme.md | 6 + VPN/unify-vpn/login.sh | 14 --- VPN/unify-vpn/logout.sh | 7 -- VPN/unify-vpn/readme.md | 111 ------------------ VPN/wireguard-vpn/readme.md | 5 - home-server/.docker-compose.yml.swp | Bin 12288 -> 0 bytes home-server/docker-compose.yml | 6 - {VPS => home-server}/readme.md | 0 rabbitmq/Dockerfile | 2 - rabbitmq/push.sh | 2 - .../docker-compose.yml | 0 11 files changed, 6 insertions(+), 147 deletions(-) create mode 100644 VPN/openvpn/readme.md delete mode 100755 VPN/unify-vpn/login.sh delete mode 100755 VPN/unify-vpn/logout.sh delete mode 100644 VPN/unify-vpn/readme.md delete mode 100644 VPN/wireguard-vpn/readme.md delete mode 100644 home-server/.docker-compose.yml.swp rename {VPS => home-server}/readme.md (100%) delete mode 100644 rabbitmq/Dockerfile delete mode 100755 rabbitmq/push.sh rename {VPN/wireguard-vpn => raspberrypi}/docker-compose.yml (100%) diff --git a/VPN/openvpn/readme.md b/VPN/openvpn/readme.md new file mode 100644 index 0000000..fe4389a --- /dev/null +++ b/VPN/openvpn/readme.md @@ -0,0 +1,6 @@ +# Setup OpenVPN + +OpenVPN is used for the connection between the home-server and the home network. + +It can be easily set up using [this link](https://pivpn.io/) + diff --git a/VPN/unify-vpn/login.sh b/VPN/unify-vpn/login.sh deleted file mode 100755 index e5cef03..0000000 --- a/VPN/unify-vpn/login.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -echo "Connecting to VPN..." - -echo "c HOMESERVER" > /var/run/xl2tpd/l2tp-control - -sleep 10 - -# To have all internet traffic routed through the VPN uncomment: -#ip route add default dev ppp0 - -# To only have a remote subnet routed through the VPN uncomment -# (this line assumes the remote subnet you want routed is 192.168.0.0/24 and the remote VPN end is 10.11.0.1: -ip route add 192.168.2.0/24 via dev ppp0 onlink diff --git a/VPN/unify-vpn/logout.sh b/VPN/unify-vpn/logout.sh deleted file mode 100755 index b8803b5..0000000 --- a/VPN/unify-vpn/logout.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -ip route del default dev ppp0 -ip route del 192.168.2.0/24 dev ppp0 - -echo "d HOMESERVER" > /var/run/xl2tpd/l2tp-control -service xl2tpd restart diff --git a/VPN/unify-vpn/readme.md b/VPN/unify-vpn/readme.md deleted file mode 100644 index a04314f..0000000 --- a/VPN/unify-vpn/readme.md +++ /dev/null @@ -1,111 +0,0 @@ -# VPN setup - -## Intro - -This is a manual to set up the Unify VPN server on an ubuntu machine. Note that this is quite difficult to set up, and I was not able to complete the set up on my VPN. This is why I still use a WireGuard VPN next to this one. - -The advantages of this VPN however are that Ubiquity has quite a nice app (android/iOS/windows) to connect to the local network. That is why the main use of this VPN will be to connect to the home network from the outside. - -## Installation on linux - -See [this github thread](https://gist.github.com/nahall/6b23603ce9df2500a4053b280071d1ad) - -- In Debian install the "xl2tpd" and "strongswan" packages. - -- Edit /etc/ipsec.conf to add the connection: - - conn YOURVPNCONNECTIONNAME - authby=secret - pfs=no - auto=start - keyexchange=ikev1 - keyingtries=3 - dpddelay=15 - dpdtimeout=45 - dpdaction=clear - rekey=no - ikelifetime=3600 - keylife=3600 - type=transport - left=%defaultroute - leftprotoport=17/1701 - # Replace IP address with your VPN server's IP - right=IPADDRESSOFVPNSERVER - rightprotoport=17/%any - ike=aes128-sha1-modp2048,aes256-sha1-modp4096,aes128-sha1-modp1536,aes256-sha1-modp2048,aes128-sha1-modp1024,aes256-sha1-modp1536,aes256-sha1-modp1024,3des-sha1-modp1024! - esp=aes128-sha1-modp2048,aes256-sha1-modp4096,aes128-sha1-modp1536,aes256-sha1-modp2048,aes128-sha1-modp1024,aes256-sha1-modp1536,aes256-sha1-modp1024! - - -- Edit /etc/ipsec.secrets to add the secret key for this connection: - - IPADDRESSOFVPNSERVER : PSK "SECRETPRESHAREDKEY" - - -- Edit /etc/xl2tpd/xl2tpd.conf to add this connection: - - [lac YOURVPNCONNECTIONNAME] - lns = IPADDRESSOFVPNSERVER - ppp debug = yes - pppoptfile = /etc/ppp/options.l2tpd.client-YOURVPNCONNECTIONNAME - length bit = yes - - -- Create the file /etc/ppp/options.l2tpd.client-YOURVPNCONNECTIONNAME: - - ipcp-accept-local - ipcp-accept-remote - noccp - refuse-eap - refuse-chap - noauth - idle 1800 - mtu 1410 - mru 1410 - defaultroute - - # Uncomment if you want to use the DNS servers of the VPN host: - #usepeerdns - - debug - logfile /var/log/xl2tpd.log - connect-delay 5000 - proxyarp - name VPNUSERNAME - password "VPNPASSWORD" - - -- Now to connect to the VPN create a script: - - #!/bin/bash - - echo "Connecting to VPN..." - - echo "c YOURVPNCONNECTIONNAME" > /var/run/xl2tpd/l2tp-control - - sleep 10 - - # To have all internet traffic routed through the VPN uncomment: - #ip route add default dev ppp0 - - # To only have a remote subnet routed through the VPN uncomment - # (this line assumes the remote subnet you want routed is 192.168.0.0/24 and the remote VPN end is 10.11.0.1: - ip route add 192.168.0.0/24 via 10.11.0.1 dev ppp0 uplink - -> Script above didn't work exacly. I had to add `onlink` at the end - -```bash -/etc/init.d/ipsec restart -/etc/init.d/xl2tpd restart -``` - - -- And to disconnect to the VPN create a script: - - #!/bin/bash - - ip route del default dev ppp0 - ip route del 192.168.0.0/24 dev ppp0 - - echo "d YOURVPNCONNECTIONNAME" > /var/run/xl2tpd/l2tp-control - service xl2tpd restart - diff --git a/VPN/wireguard-vpn/readme.md b/VPN/wireguard-vpn/readme.md deleted file mode 100644 index 0e76198..0000000 --- a/VPN/wireguard-vpn/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# WireGuard VPN - -## Intro - -This VPN is meant to connect the VPS with the home network. This folder also contains a docker-compose with a traefik setup. This traefik setup connects the home network with the VPS. diff --git a/home-server/.docker-compose.yml.swp b/home-server/.docker-compose.yml.swp deleted file mode 100644 index 9276187781b9c5cacae0976d85b80c5ca920c455..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2zi$&U6vtgABxpfJh>;`AxnCje)lvr#sHy}K17%>Kx?D_h;?6#7Umy~Ki5WIJ zu`nU=7qGG;MkM|K76zDLk&!ONe|k zO6Y|ZvbIIY<21`yZa&O!m9MRs95Fe^`m8c~k`+RELy@zqr51UtQ^DV{fZAHfCP{L5yt5cdiBeTtA* zry+Ux|9}7Y|Iagod;@(2y#?)oo`UX!u7Lv3uN6YRgFb^kg7!cG=sf5o=*u!8A3*Ow zuR$+B8E6-@0dhgBpdYaIC(wJ4$>Svm8xlYQNB{{S0VIF~kN^@u0>__#15GleW2vcA z@{B3fR$3GV>l5?MaoSGcyWOrExg83{jNy9Kdu6{M)-dY`ecz{{=@)S5nedna2=|%e~!koM*HiJK$3TU}hOpGTsE- zpKY!GFrM6zCjpsnhDX8!hq&OEEu{ diff --git a/home-server/docker-compose.yml b/home-server/docker-compose.yml index d7f11c3..87092a0 100644 --- a/home-server/docker-compose.yml +++ b/home-server/docker-compose.yml @@ -1,11 +1,5 @@ version: "3.9" services: - rabbitmq: - image: "registry.willemserruys.com/rabbitmq:latest" - ports: - - 10.55.8.3:1883:1883 - - 10.55.8.3:15672:15672 - restart: unless-stopped homeassistant: image: "ghcr.io/home-assistant/home-assistant:stable" ports: diff --git a/VPS/readme.md b/home-server/readme.md similarity index 100% rename from VPS/readme.md rename to home-server/readme.md diff --git a/rabbitmq/Dockerfile b/rabbitmq/Dockerfile deleted file mode 100644 index a19716d..0000000 --- a/rabbitmq/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM rabbitmq:management -RUN rabbitmq-plugins enable --offline rabbitmq_mqtt \ No newline at end of file diff --git a/rabbitmq/push.sh b/rabbitmq/push.sh deleted file mode 100755 index 743a7e8..0000000 --- a/rabbitmq/push.sh +++ /dev/null @@ -1,2 +0,0 @@ -docker build -t registry.willemserruys.com/rabbitmq . -docker push registry.willemserruys.com/rabbitmq:latest \ No newline at end of file diff --git a/VPN/wireguard-vpn/docker-compose.yml b/raspberrypi/docker-compose.yml similarity index 100% rename from VPN/wireguard-vpn/docker-compose.yml rename to raspberrypi/docker-compose.yml