From d68c7ee3b9a871417d0ed3c9b9ded06b4ba28cb8 Mon Sep 17 00:00:00 2001 From: Tanishq Dubey Date: Sun, 31 Jul 2022 18:18:40 +0000 Subject: [PATCH] initial commit --- gitea/docker-compose.yml | 31 +++ interdimensionalcable/docker-compose.yml | 23 +++ interdimensionalcable/idc/Dockerfile | 13 ++ interdimensionalcable/idc/main.py | 99 ++++++++++ interdimensionalcable/idc/requirements.txt | 4 + interdimensionalcable/idc/static/favicon.ico | Bin 0 -> 2577 bytes .../idc/templates/index.html | 187 ++++++++++++++++++ jackett/docker-compose.yml | 33 ++++ minecraft/docker-compose.yml | 20 ++ nextcloud/docker-compose.yml | 57 ++++++ overseerr/docker-compose.yml | 28 +++ plex/docker-compose.yml | 34 ++++ radarr/.docker-compose.yml.swo | Bin 0 -> 12288 bytes radarr/docker-compose.yml | 29 +++ sonarr/docker-compose.yml | 29 +++ traefik/traefik.sh | 2 + transmission/docker-compose.yml | 38 ++++ 17 files changed, 627 insertions(+) create mode 100644 gitea/docker-compose.yml create mode 100644 interdimensionalcable/docker-compose.yml create mode 100644 interdimensionalcable/idc/Dockerfile create mode 100644 interdimensionalcable/idc/main.py create mode 100644 interdimensionalcable/idc/requirements.txt create mode 100644 interdimensionalcable/idc/static/favicon.ico create mode 100644 interdimensionalcable/idc/templates/index.html create mode 100644 jackett/docker-compose.yml create mode 100644 minecraft/docker-compose.yml create mode 100644 nextcloud/docker-compose.yml create mode 100644 overseerr/docker-compose.yml create mode 100644 plex/docker-compose.yml create mode 100644 radarr/.docker-compose.yml.swo create mode 100644 radarr/docker-compose.yml create mode 100644 sonarr/docker-compose.yml create mode 100755 traefik/traefik.sh create mode 100644 transmission/docker-compose.yml diff --git a/gitea/docker-compose.yml b/gitea/docker-compose.yml new file mode 100644 index 0000000..548a0fb --- /dev/null +++ b/gitea/docker-compose.yml @@ -0,0 +1,31 @@ +version: "3" + +networks: + web: + external: true + gitea: + external: false + +services: + server: + image: gitea/gitea:1.16.9 + container_name: gitea + environment: + - USER_UID=1000 + - USER_GID=1000 + - PROTOCOL=http + - DOMAIN=git.dws.rip + restart: always + labels: + - traefik.http.routers.gitea.rule=Host(`git.dws.rip`) + - traefik.http.routers.gitea.tls=true + - traefik.http.routers.gitea.tls.certresolver=lets-encrypt + - traefik.http.services.gitea.loadbalancer.server.port=3000 + - traefik.port=3000 + networks: + - gitea + - web + volumes: + - /dws/otherdata/gitea:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro diff --git a/interdimensionalcable/docker-compose.yml b/interdimensionalcable/docker-compose.yml new file mode 100644 index 0000000..bfb5a97 --- /dev/null +++ b/interdimensionalcable/docker-compose.yml @@ -0,0 +1,23 @@ +--- +version: '3.3' + +networks: + web: + external: true + internal: + external: false + +services: + idc: + image: dws/idc + build: ./idc + networks: + - internal + - web + labels: + - traefik.http.routers.idc.rule=Host(`idc.dws.rip`) + - traefik.http.routers.idc.tls=true + - traefik.http.routers.idc.tls.certresolver=lets-encrypt + - traefik.port=4269 + container_name: idc + restart: always diff --git a/interdimensionalcable/idc/Dockerfile b/interdimensionalcable/idc/Dockerfile new file mode 100644 index 0000000..4a3452d --- /dev/null +++ b/interdimensionalcable/idc/Dockerfile @@ -0,0 +1,13 @@ +FROM python:buster + +WORKDIR /usr/src/app + +COPY requirements.txt ./ + +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +EXPOSE 4269 + +CMD ["python", "./main.py"] diff --git a/interdimensionalcable/idc/main.py b/interdimensionalcable/idc/main.py new file mode 100644 index 0000000..f461f35 --- /dev/null +++ b/interdimensionalcable/idc/main.py @@ -0,0 +1,99 @@ +import json +import os.path +import random +import time + +import requests +from flask import Flask, render_template +from flask_apscheduler import APScheduler + +URL = "https://www.reddit.com/r/InterdimensionalCable/top.json?limit=100&t=week" +scheduler = APScheduler() +v = [] + + +def getRedditData(url): + resp = requests.get(url) + text = resp.text + code = resp.status_code + while code == 429: + print("waiting for timeout to end ...") + time.sleep(2) + resp = requests.get(url) + text = resp.text + code = resp.status_code + + data = json.loads(text) + token = data["data"]["after"] + ret = [] + for post in data["data"]["children"]: + turl = post["data"]["url_overridden_by_dest"] + if "youtu.be" in turl: + turl = turl.replace("https://youtu.be/", "https://www.youtube.com/watch?v=") + if "m.youtube.com" in turl: + turl = turl.replace( + "https://m.youtube.com/embed", "https://www.youtube.com/watch?v=" + ) + turl = turl.replace("watch?v=", "embed/") + turl = turl + "?autoplay=1&enablejsapi=1" + ret.append(turl) + + return ret, token + + +def doPages(numPages): + token = "" + vids = [] + for i in range(numPages): + if i == 0: + v, t = getRedditData(URL) + vids = vids + v + token = t + time.sleep(2) + v, t = getRedditData(URL + f"&after={token}") + vids = vids + v + print(f"got page {i}...") + return vids + + +@scheduler.task("interval", id="do_job_1", minutes=60, misfire_grace_time=900) +def job1(): + global v + doFetch = False + pexist = os.path.exists("temp.json") + + if pexist: + print("temp.json exists") + sec = os.path.getmtime("temp.json") + now = time.time() + if now - sec > 600: + doFetch = True + else: + doFetch = True + + if doFetch: + print("stale or no file, fetching...") + v = doPages(2) + with open("temp.json", "w") as f: + json.dump(v, f) + else: + print("fresh file, not fetching...") + with open("temp.json", "r") as f: + v = json.load(f) + + +app = Flask(__name__) +scheduler.init_app(app) +scheduler.start() +job1() + + +@app.route("/") +def hello_world(): + global v + random.shuffle(v) + return render_template("index.html", vids=json.dumps(v)) + + +if __name__ == "__main__": + app.run(host="0.0.0.0", port=4269) diff --git a/interdimensionalcable/idc/requirements.txt b/interdimensionalcable/idc/requirements.txt new file mode 100644 index 0000000..3df6a2e --- /dev/null +++ b/interdimensionalcable/idc/requirements.txt @@ -0,0 +1,4 @@ +APScheduler==3.9.1 +requests==2.26.0 +Flask==2.0.3 +Flask-APScheduler==1.12.4 diff --git a/interdimensionalcable/idc/static/favicon.ico b/interdimensionalcable/idc/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..e413ba88e71055300a67970de8290de860b0a830 GIT binary patch literal 2577 zcmbVO2~-nj9uF>5Ksh8;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X)_Z>=@eEC!cQaZb6O5IV1V@G|g|1|G^8DA@XzIo3TYRd9$&$q8jRXj-Aw1-_0 z;FH+#H$x|Dhp5)&rT&wqh2xJxE1RWQT!W)%hJKNw+pb2($ja)zWKLIoOQ^k*za^Xs u@O+B0Eyr^#dgX4z*c)3S948LeoPIm$-Jgyd*I(k=e%c}>3iL>LLe?+o%ivxB literal 0 HcmV?d00001 diff --git a/interdimensionalcable/idc/templates/index.html b/interdimensionalcable/idc/templates/index.html new file mode 100644 index 0000000..b0bfb7d --- /dev/null +++ b/interdimensionalcable/idc/templates/index.html @@ -0,0 +1,187 @@ + + + + InterdimensionalCable + + + + + + + +
+ + + +
+ + diff --git a/jackett/docker-compose.yml b/jackett/docker-compose.yml new file mode 100644 index 0000000..8c6ca85 --- /dev/null +++ b/jackett/docker-compose.yml @@ -0,0 +1,33 @@ +--- +version: "3" + +networks: + web: + external: true + internal: + external: false + +services: + jackett: + networks: + - internal + - web + labels: + - traefik.http.routers.jackett.rule=Host(`jackett.dws.rip`) + - traefik.http.routers.jackett.tls=true + - traefik.http.routers.jackett.tls.certresolver=lets-encrypt + - traefik.port=9117 + image: lscr.io/linuxserver/jackett + container_name: jackett + networks: + - internal + - web + environment: + - PUID=1000 + - PGID=1000 + - TZ=America/New_York + - AUTO_UPDATE=true #optional + volumes: + - /dws/config/jackett:/config + - /dws/otherdata/jackett:/downloads + restart: unless-stopped diff --git a/minecraft/docker-compose.yml b/minecraft/docker-compose.yml new file mode 100644 index 0000000..2b63272 --- /dev/null +++ b/minecraft/docker-compose.yml @@ -0,0 +1,20 @@ +version: "3" +services: + mc: + image: itzg/minecraft-server + container_name: paper + environment: + EULA: "true" + TYPE: PAPER + VIEW_DISTANCE: 30 + MEMORY: 3G + CONSOLE: "false" + MOTD: "§8D§cW§8S§a§oEMS§r - dws.rip" + SEED: "mmmm....minecraft_makes_me_hungry" + VERSION: 1.19 + OPS: dubmiester,RicecakeSMS,pZ_aeriaL + ports: + - 25565:25565 + volumes: + - /dws/otherdata/minecraft:/data + restart: always diff --git a/nextcloud/docker-compose.yml b/nextcloud/docker-compose.yml new file mode 100644 index 0000000..0922892 --- /dev/null +++ b/nextcloud/docker-compose.yml @@ -0,0 +1,57 @@ +version: '3' + +networks: + web: + external: true + internal: + external: false + +services: + db: + image: mariadb + networks: + - internal + labels: + - traefik.enable=false + restart: always + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + volumes: + - /dws/systemdata/nextclouddb:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=${MSQLROOTPASS} + - MYSQL_PASSWORD=${MSQLPASS} + - MYSQL_DATABASE=nextcloud + - MYSQL_USER=nextcloud + + app: + image: nextcloud + restart: always + labels: + - traefik.http.routers.nextcloud.middlewares=nextcloud,nextcloud_redirect + - traefik.http.routers.nextcloud.tls=true + - traefik.http.routers.nextcloud.tls.certresolver=lets-encrypt + - traefik.http.routers.nextcloud.rule=Host(`cloud.dws.rip`) + - traefik.http.middlewares.nextcloud.headers.customFrameOptionsValue=ALLOW-FROM https://dws.rip + - traefik.http.middlewares.nextcloud.headers.contentSecurityPolicy=frame-ancestors 'self' dws.rip *.dws.rip + - traefik.http.middlewares.nextcloud.headers.stsSeconds=155520011 + - traefik.http.middlewares.nextcloud.headers.stsIncludeSubdomains=true + - traefik.http.middlewares.nextcloud.headers.stsPreload=true + - traefik.http.middlewares.nextcloud.headers.customresponseheaders.X-Frame-Options=SAMEORIGIN + - traefik.http.middlewares.nextcloud_redirect.redirectregex.permanent=true + - traefik.http.middlewares.nextcloud_redirect.redirectregex.regex=https://(.*)/.well-known/(card|cal)dav + - traefik.http.middlewares.nextcloud_redirect.redirectregex.replacement=https://$${1}/remote.php/dav/ + - traefik.port=8080 + networks: + - internal + - web + links: + - db + volumes: + - /dws/data/:/var/www/html + - /dws/otherdata/:/otherdata + environment: + - MYSQL_PASSWORD=${MSQLPASS} + - MYSQL_DATABASE=nextcloud + - MYSQL_USER=nextcloud + - MYSQL_HOST=db + - TRUSTED_PROXIES=172.22.0.4 diff --git a/overseerr/docker-compose.yml b/overseerr/docker-compose.yml new file mode 100644 index 0000000..2f52095 --- /dev/null +++ b/overseerr/docker-compose.yml @@ -0,0 +1,28 @@ +--- +version: "3" + +networks: + web: + external: true + internal: + external: false + +services: + overseerr: + image: lscr.io/linuxserver/overseerr + container_name: overseerr + networks: + - internal + - web + labels: + - traefik.http.routers.overseerr.rule=Host(`requests.dws.rip`) + - traefik.http.routers.overseerr.tls=true + - traefik.http.routers.overseerr.tls.certresolver=lets-encrypt + - traefik.port=5055 + environment: + - PUID=1000 + - PGID=1000 + - TZ=America/New_York + volumes: + - /dws/config/overseerr:/config + restart: unless-stopped diff --git a/plex/docker-compose.yml b/plex/docker-compose.yml new file mode 100644 index 0000000..992f224 --- /dev/null +++ b/plex/docker-compose.yml @@ -0,0 +1,34 @@ +--- +version: "3" + +networks: + web: + external: true + internal: + external: false + +services: + plex: + image: lscr.io/linuxserver/plex:version-1.24.5.5173-8dcc73a59 + container_name: plex + labels: + - traefik.http.routers.plex.rule=Host(`media.dws.rip`) + - traefik.http.routers.plex.tls=true + - traefik.http.routers.plex.tls.certresolver=lets-encrypt + - traefik.http.services.plex.loadbalancer.server.port=32400 + - traefik.port=32400 + - traefik.protocol=https + networks: + - internal + - web + environment: + - PUID=1000 + - PGID=1000 + - VERSION=docker + - PLEX_CLAIM=claim-gdJqTrZn-t7MFun-dNE6 + - DOMAINNAME=media.dws.rip + - ADVERTISE_IP=https://media.dws.rip:443 + volumes: + - /dws/config/plex:/config + - /dws/otherdata/:/data + restart: unless-stopped diff --git a/radarr/.docker-compose.yml.swo b/radarr/.docker-compose.yml.swo new file mode 100644 index 0000000000000000000000000000000000000000..a8454b0cfb738e1a0268fe80b395a5b52eafa48a GIT binary patch literal 12288 zcmeI2F>ll`6oB8shEzZ>Bf_!3kmQaIJw>_!wGwmyb!d^w()yBjZB)mOZ0D|>7?}70 z46wio6B8pp07hoS!VF?T3>|pBq<0kzJ$0*imcFxWzvt(CnWFQc^Jw)!(2Kf2?J~f- z*PDZ%PXP|Uwjdi@KYL=EH!h~YIMeAKn%Ia;7}JcxR2QYT7#$Sy#A+PC2H3#q3@pIn zoo>hH-fZ6pu3p(V-8P)X2G{@_U;}J`4X^<=zy{dBnKa<~18m?78W0)4g$00@g#Z8l===Zh62K4QJMoS9LVP4X z5O0Y$#4F-Cp$S2(5i3NG_c8-3;Kl~n02^Qf zY=8~00XDz}*Z>>&?+gUg3|c3QOM*&Cv^KO(mnCN4*McAnCO4|J+eMQJCz9Czf?t|0 zrdkd2o#wiA64yiU0V6G|0&OxG`1tk5{ksL4JQeXn9B*xEvo~E^ySKX1?{+$!+04fA z8C0X(XjPzc^@dc)iCm%CQlh{lsPB7Evz-w*%=e;F8`odzE%p9c*>$drjIJCS8`as7 zlQv4xIMSl!2u)w2vmvU~9F%U}9s15xI9IT#B=+xX>uzl~2cQe=k;%*L+mn1L1}KjS z9OGcRZ?5RzO32BCLN_LxO=w<-9Wo+qYNA}nGFR2UMMKZiye7)2>m}gl^VGkk$ws(e m@0tWdA+3LkqdK+q*?RMkbfg4k<$;RWT&pB#FSa2JL-+$ijP5J| literal 0 HcmV?d00001 diff --git a/radarr/docker-compose.yml b/radarr/docker-compose.yml new file mode 100644 index 0000000..f670130 --- /dev/null +++ b/radarr/docker-compose.yml @@ -0,0 +1,29 @@ +--- +version: "3" + +networks: + web: + external: true + internal: + external: false + +services: + radarr: + image: lscr.io/linuxserver/radarr + networks: + - internal + - web + labels: + - traefik.http.routers.radarr.rule=Host(`radarr.dws.rip`) + - traefik.http.routers.radarr.tls=true + - traefik.http.routers.radarr.tls.certresolver=lets-encrypt + - traefik.port=7878 + container_name: radarr + environment: + - PUID=1000 + - PGID=1000 + - TZ=America/New_York + volumes: + - /dws/config/radarr:/config + - /dws/otherdata:/data + restart: unless-stopped diff --git a/sonarr/docker-compose.yml b/sonarr/docker-compose.yml new file mode 100644 index 0000000..febcc7f --- /dev/null +++ b/sonarr/docker-compose.yml @@ -0,0 +1,29 @@ +--- +version: "3" + +networks: + web: + external: true + internal: + external: false + +services: + sonarr: + image: lscr.io/linuxserver/sonarr + container_name: sonarr + networks: + - internal + - web + labels: + - traefik.http.routers.sonarr.rule=Host(`sonarr.dws.rip`) + - traefik.http.routers.sonarr.tls=true + - traefik.http.routers.sonarr.tls.certresolver=lets-encrypt + - traefik.port=8989 + environment: + - PUID=1000 + - PGID=1000 + - TZ=America/New_York + volumes: + - /dws/config/sonarr:/config + - /dws/otherdata:/data + restart: unless-stopped diff --git a/traefik/traefik.sh b/traefik/traefik.sh new file mode 100755 index 0000000..bf6324f --- /dev/null +++ b/traefik/traefik.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/traefik.toml:/traefik.toml -v $PWD/traefik_dynamic.toml:/traefik_dynamic.toml -v $PWD/acme.json:/acme.json -p 80:80 -p 443:443 --network web --name traefik --restart always traefik:v2.2 diff --git a/transmission/docker-compose.yml b/transmission/docker-compose.yml new file mode 100644 index 0000000..fc166d2 --- /dev/null +++ b/transmission/docker-compose.yml @@ -0,0 +1,38 @@ +--- +version: '3.3' + +networks: + web: + external: true + internal: + external: false + +services: + alpine-qbittorrent-openvpn: + restart: always + networks: + - internal + - web + labels: + - traefik.http.routers.transmission.rule=Host(`downloads.dws.rip`) + - traefik.http.routers.transmission.tls=true + - traefik.http.routers.transmission.tls.certresolver=lets-encrypt + - traefik.port=8080 + volumes: + - '/dws/otherdata:/data' + - "/dws/config/torrent:/config" + - "/etc/localtime:/etc/localtime:ro" + environment: + - PUID=1000 + - PGID=1000 + - LAN=192.168.0.0/16 + - OPENVPN_PROVIDER=NORDVPN + - NORDVPN_CATEGORY=legacy_p2p + - NORDVPN_COUNTRY=US + - NORDVPN_PROTOCOL=tcp + - OPENVPN_USERNAME=tanishq.dubey@gmail.com + - OPENVPN_PASSWORD=${OPENVPNPASS} + - OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60 --dhcp-option DNS 8.8.8.8 + cap_add: + - NET_ADMIN + image: guillaumedsde/alpine-qbittorrent-openvpn:latest