diff --git a/tvheadend/.gitignore b/tvheadend/.gitignore new file mode 100644 index 0000000..8a8e84a --- /dev/null +++ b/tvheadend/.gitignore @@ -0,0 +1,2 @@ +recordings/ + diff --git a/tvheadend/README.md b/tvheadend/README.md new file mode 100644 index 0000000..19e539a --- /dev/null +++ b/tvheadend/README.md @@ -0,0 +1 @@ +tvheadend setup diff --git a/tvheadend/docker-compose.yml b/tvheadend/docker-compose.yml new file mode 100644 index 0000000..4b368f7 --- /dev/null +++ b/tvheadend/docker-compose.yml @@ -0,0 +1,19 @@ +--- +version: "2.1" +services: + tvheadend: + image: lscr.io/linuxserver/tvheadend + container_name: tvheadend + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/London + volumes: + - ./config:/config + - ./recordings:/recordings + ports: + - 9981:9981 + - 9982:9982 + devices: + - /dev/dvb:/dev/dvb #optional + restart: unless-stopped diff --git a/wireguard/.gitignore b/wireguard/.gitignore new file mode 100644 index 0000000..94f7b77 --- /dev/null +++ b/wireguard/.gitignore @@ -0,0 +1 @@ +# ignore diff --git a/wireguard/README.md b/wireguard/README.md new file mode 100644 index 0000000..bb6d2d5 --- /dev/null +++ b/wireguard/README.md @@ -0,0 +1 @@ +wireguard setup diff --git a/wireguard/config/.donoteditthisfile b/wireguard/config/.donoteditthisfile new file mode 100644 index 0000000..9e36d87 --- /dev/null +++ b/wireguard/config/.donoteditthisfile @@ -0,0 +1,6 @@ +ORIG_SERVERURL="80.229.26.80" +ORIG_SERVERPORT="51820" +ORIG_PEERDNS="10.13.13.1" +ORIG_PEERS="1" +ORIG_INTERFACE="10.13.13" +ORIG_ALLOWEDIPS="0.0.0.0/0, ::/0" diff --git a/wireguard/config/coredns/Corefile b/wireguard/config/coredns/Corefile new file mode 100644 index 0000000..c8e2152 --- /dev/null +++ b/wireguard/config/coredns/Corefile @@ -0,0 +1,4 @@ +. { + loop + forward . /etc/resolv.conf +} \ No newline at end of file diff --git a/wireguard/config/peer1/peer1.conf b/wireguard/config/peer1/peer1.conf new file mode 100644 index 0000000..92fbec0 --- /dev/null +++ b/wireguard/config/peer1/peer1.conf @@ -0,0 +1,10 @@ +[Interface] +Address = 10.13.13.2 +PrivateKey = GO6r2NZq0UgkB/u3S6oV6k+CxYDQg+xYvlhjFC34Tnk= +ListenPort = 51820 +DNS = 10.13.13.1 + +[Peer] +PublicKey = a7bifNDAdLCYuJCELsMCZzVntp1xujOzXYLSCQ1TF0o= +Endpoint = 80.229.26.80:51820 +AllowedIPs = 0.0.0.0/0, ::/0 diff --git a/wireguard/config/peer1/peer1.png b/wireguard/config/peer1/peer1.png new file mode 100644 index 0000000..dbc8488 Binary files /dev/null and b/wireguard/config/peer1/peer1.png differ diff --git a/wireguard/config/peer1/privatekey-peer1 b/wireguard/config/peer1/privatekey-peer1 new file mode 100644 index 0000000..ed7bfac --- /dev/null +++ b/wireguard/config/peer1/privatekey-peer1 @@ -0,0 +1 @@ +GO6r2NZq0UgkB/u3S6oV6k+CxYDQg+xYvlhjFC34Tnk= diff --git a/wireguard/config/peer1/publickey-peer1 b/wireguard/config/peer1/publickey-peer1 new file mode 100644 index 0000000..e1d5f3b --- /dev/null +++ b/wireguard/config/peer1/publickey-peer1 @@ -0,0 +1 @@ +UmxCFo8f/TxObdyEbwuUgw/9yTJ4teMQZoSQiySwfG4= diff --git a/wireguard/config/server/privatekey-server b/wireguard/config/server/privatekey-server new file mode 100644 index 0000000..419c479 --- /dev/null +++ b/wireguard/config/server/privatekey-server @@ -0,0 +1 @@ +ICVV/aXsTdYg5Y44F6j8a7rO8rNZGtLxoOmsb0B+12c= diff --git a/wireguard/config/server/publickey-server b/wireguard/config/server/publickey-server new file mode 100644 index 0000000..4542359 --- /dev/null +++ b/wireguard/config/server/publickey-server @@ -0,0 +1 @@ +a7bifNDAdLCYuJCELsMCZzVntp1xujOzXYLSCQ1TF0o= diff --git a/wireguard/config/templates/peer.conf b/wireguard/config/templates/peer.conf new file mode 100644 index 0000000..205a1bd --- /dev/null +++ b/wireguard/config/templates/peer.conf @@ -0,0 +1,10 @@ +[Interface] +Address = ${CLIENT_IP} +PrivateKey = $(cat /config/${PEER_ID}/privatekey-${PEER_ID}) +ListenPort = 51820 +DNS = ${PEERDNS} + +[Peer] +PublicKey = $(cat /config/server/publickey-server) +Endpoint = ${SERVERURL}:${SERVERPORT} +AllowedIPs = ${ALLOWEDIPS} \ No newline at end of file diff --git a/wireguard/config/templates/server.conf b/wireguard/config/templates/server.conf new file mode 100644 index 0000000..9255d38 --- /dev/null +++ b/wireguard/config/templates/server.conf @@ -0,0 +1,6 @@ +[Interface] +Address = ${INTERFACE}.1 +ListenPort = 51820 +PrivateKey = $(cat /config/server/privatekey-server) +PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE +PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE diff --git a/wireguard/config/wg0.conf b/wireguard/config/wg0.conf new file mode 100644 index 0000000..222709d --- /dev/null +++ b/wireguard/config/wg0.conf @@ -0,0 +1,12 @@ +[Interface] +Address = 10.13.13.1 +ListenPort = 51820 +PrivateKey = ICVV/aXsTdYg5Y44F6j8a7rO8rNZGtLxoOmsb0B+12c= +PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE +PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE + +[Peer] +# peer1 +PublicKey = UmxCFo8f/TxObdyEbwuUgw/9yTJ4teMQZoSQiySwfG4= +AllowedIPs = 10.13.13.2/32 + diff --git a/wireguard/docker-compose.yml b/wireguard/docker-compose.yml new file mode 100644 index 0000000..b27e1c5 --- /dev/null +++ b/wireguard/docker-compose.yml @@ -0,0 +1,25 @@ +version: "2.1" +services: + wireguard: + image: linuxserver/wireguard + container_name: wireguard + cap_add: + - NET_ADMIN + - SYS_MODULE + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/London + - SERVERURL=80.229.26.80 #optional + - SERVERPORT=51820 #optional + - PEERS=1 #optional + - PEERDNS=auto #optional + - INTERNAL_SUBNET=10.13.13.0 #optional + volumes: + - ./config:/config + - /lib/modules:/lib/modules + ports: + - 51820:51820/udp + sysctls: + - net.ipv4.conf.all.src_valid_mark=1 + restart: unless-stopped