diff --git a/aniworld/Dockerfile b/aniworld/Dockerfile index ba43a84..6d4252c 100644 --- a/aniworld/Dockerfile +++ b/aniworld/Dockerfile @@ -1,24 +1,13 @@ FROM alpine:3.20 AS base -ARG PROXY_SERVER -ARG PROXY_PORT - RUN apk add --no-cache \ - python3 \ - iptables + python3 -ADD https://github.com/semigodking/redsocks/releases/download/release-0.71/redsocks2-x86_64-release-0.71 /bin/redsocks2 -RUN chmod +x /bin/redsocks2 -COPY redsocks.conf /etc/redsocks.conf -RUN sed -i "s/vPROXY-SERVER/${PROXY_SERVER}/g" /etc/redsocks.conf && \ - sed -i "s/vPROXY-PORT/${PROXY_PORT}/g" /etc/redsocks.conf -RUN mkdir -p /services /var/aniworld -WORKDIR /services - -RUN python3 -m venv aniworlddownloader_venv && \ - aniworlddownloader_venv/bin/pip install --no-cache-dir aniworld +RUN mkdir services +RUN python3 -m venv services/aniworlddownloader_venv && \ + services/aniworlddownloader_venv/bin/pip install --no-cache-dir aniworld WORKDIR / COPY entrypoint.sh /entrypoint.sh diff --git a/aniworld/Dockerfile.i2p b/aniworld/Dockerfile.i2p new file mode 100644 index 0000000..568ca3e --- /dev/null +++ b/aniworld/Dockerfile.i2p @@ -0,0 +1,25 @@ +FROM alpine:3.20 AS base + +ARG PROXY_SERVER +ARG PROXY_PORT + +RUN apk add --no-cache \ + python3 \ + iptables + +ADD https://github.com/semigodking/redsocks/releases/download/release-0.71/redsocks2-x86_64-release-0.71 /bin/redsocks2 +RUN chmod +x /bin/redsocks2 + +COPY redsocks.conf /etc/redsocks.conf +RUN sed -i "s/vPROXY-SERVER/${PROXY_SERVER}/g" /etc/redsocks.conf && \ + sed -i "s/vPROXY-PORT/${PROXY_PORT}/g" /etc/redsocks.conf + +RUN mkdir -p /services /var/aniworld +WORKDIR /services + +RUN python3 -m venv aniworlddownloader_venv && \ + aniworlddownloader_venv/bin/pip install --no-cache-dir aniworld + +WORKDIR / +COPY entrypoint.sh.i2p /entrypoint.sh +ENTRYPOINT ["sh", "/entrypoint.sh"] diff --git a/aniworld/entrypoint.sh b/aniworld/entrypoint.sh index cc2bb49..a2c8eda 100755 --- a/aniworld/entrypoint.sh +++ b/aniworld/entrypoint.sh @@ -1,8 +1,6 @@ #!/usr/share/env bash -iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-port 12345 -iptables -t nat -A OUTPUT -p tcp --dport 443 -j REDIRECT --to-port 12345 -redsocks2 -c /etc/redsocks.conf -/services/aniworlddownloader_venv/bin//aniworld --web-ui --no-browser --web-expose --web-port 3000 --output-dir /var/aniworld/downloads & + +/services/aniworlddownloader_venv/bin/aniworld --web-ui --no-browser --web-expose --web-port 3000 --output-dir /var/aniworld/downloads & while true; do sleep 1000; done \ No newline at end of file diff --git a/aniworld/entrypoint.sh.i2p b/aniworld/entrypoint.sh.i2p new file mode 100755 index 0000000..cc2bb49 --- /dev/null +++ b/aniworld/entrypoint.sh.i2p @@ -0,0 +1,8 @@ +#!/usr/share/env bash +iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-port 12345 +iptables -t nat -A OUTPUT -p tcp --dport 443 -j REDIRECT --to-port 12345 + +redsocks2 -c /etc/redsocks.conf +/services/aniworlddownloader_venv/bin//aniworld --web-ui --no-browser --web-expose --web-port 3000 --output-dir /var/aniworld/downloads & + +while true; do sleep 1000; done \ No newline at end of file diff --git a/aniworld/wg0.conf b/aniworld/wg0.conf new file mode 100644 index 0000000..878d3c0 --- /dev/null +++ b/aniworld/wg0.conf @@ -0,0 +1,15 @@ +[Interface] +# Key for proxmoxADS +# Bouncing = 2 +# NAT-PMP (Port Forwarding) = off +# VPN Accelerator = on +# Table = off +PrivateKey = uPGxlIrs0+erepQsbnkld/aBde7qd7HwwsMrGaNtGUg= +Address = 10.2.0.2/32 +DNS = 10.2.0.1 + +[Peer] +# NL-FREE#136 +PublicKey = 8xx8LqTpTHCEWou3Wu43p2CaEqnO9kcKQrLb+C8fZw8= +AllowedIPs = 0.0.0.0/0, ::/0 +Endpoint = 169.150.218.70:51820 \ No newline at end of file diff --git a/compose.yml b/compose.yml index d4fa46a..19752f3 100644 --- a/compose.yml +++ b/compose.yml @@ -1,25 +1,28 @@ -services: - aniworld: - build: - context: aniworld - dockerfile: Dockerfile - target: base - args: - - "PROXY_SERVER=i2pendpoint.arpa" - - "PROXY_PORT=4444" - pull_policy: build - user: "0:0" - image: katzenkralle/aniworld_served:latest +version: "3.8" + +configs: + wg0_conf: + file: ./aniworld/wg0.conf + +services: + wireguard: + image: linuxserver/wireguard + cap_add: + - NET_ADMIN # Required for networking changes + - SYS_MODULE # Optional for WireGuard modules + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/Berlin + restart: unless-stopped + sysctls: + - net.ipv4.conf.all.src_valid_mark=1 + configs: + - source: wg0_conf + target: /config/wg0.conf networks: - proxy - - cap_add: - - NET_ADMIN - - volumes: - - data_aniworld:/var/aniworld/downloads - labels: traefik.enable: true traefik.http.routers.aniworld.service: aniworld @@ -29,6 +32,19 @@ services: traefik.http.services.aniworld.loadbalancer.server.port: 3000 traefik.http.routers.aniworld.middlewares: traefik-auth + + aniworld: + build: + context: ./aniworld + dockerfile: Dockerfile + target: base + image: katzenkralle/aniworld_served:latest + user: "0:0" + network_mode: "service:wireguard" + restart: unless-stopped + volumes: + - data_aniworld:/var/aniworld/downloads + bittorrent: image: linuxserver/qbittorrent:5.1.4 networks: