diff --git a/docker-compose.yaml b/docker-compose.yaml index 13d6360..3d61bc9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,3 @@ -version: "3.7" - volumes: grafana: prometheus: @@ -11,20 +9,32 @@ x-log-config: &log-config max-size: "50m" max-file: "20" +networks: + tor_net: + ipam: + driver: default + config: + - subnet: "172.31.255.0/24" + services: prometheus: - image: prom/prometheus:v2.36.0 + image: prom/prometheus:${PROM_TAG:-v2.36.0} command: - --config.file=/etc/prometheus/config.yaml - --storage.tsdb.path=/prometheus - - --storage.tsdb.retention.time=360d + - --storage.tsdb.retention.time=${PROM_RETENTION:-360d} container_name: wownerod_prometheus restart: unless-stopped + depends_on: + exporter: + condition: service_started # ports: # - 127.0.0.1:9090:9090 volumes: - prometheus:/prometheus - ./files/prometheus/config.yaml:/etc/prometheus/config.yaml:ro + networks: + - tor_net <<: *log-config grafana: user: "1000" @@ -32,7 +42,7 @@ services: - -config=/etc/grafana/grafana.ini container_name: wownerod_grafana restart: unless-stopped - image: grafana/grafana:10.1.4 + image: grafana/grafana:${GRAFANA_TAG:-10.1.4} ports: - 127.0.0.1:${GRAF_PORT:-3000}:3000 volumes: @@ -53,41 +63,96 @@ services: GF_AUTH_DISABLE_LOGIN_FORM: "${GF_AUTH_DISABLE_LOGIN_FORM:-true}" GF_SECURITY_ADMIN_PASSWORD: "${GF_SECURITY_ADMIN_PASSWORD}" GF_SECURITY_ADMIN_USER: "${GF_SECURITY_ADMIN_USER}" + networks: + - tor_net <<: *log-config exporter: - command: - - --monero-addr=http://wownerod:34570 container_name: wownerod_exporter + build: + context: . + dockerfile: dockerfiles/exporter restart: unless-stopped + depends_on: + wownerod: + condition: service_started # ports: # - 127.0.0.1:9000:9000 - build: - context: dockerfiles - dockerfile: exporter + command: + - --monero-addr=http://wownerod:34570 + networks: + - tor_net <<: *log-config nodemapper: container_name: wownerod_nodemapper restart: unless-stopped build: - context: dockerfiles - dockerfile: nodemapper + context: . + dockerfile: dockerfiles/nodemapper + depends_on: + wownerod: + condition: service_started environment: NODE_HOST: wownerod NODE_PORT: 34570 # ports: # - 127.0.0.1:${MAPPER_PORT:-5000}:5000 + networks: + - tor_net + <<: *log-config + tor: + container_name: wownerod_tor + build: + context: . + dockerfile: dockerfiles/tor + restart: unless-stopped + # ports: + # - 127.0.0.1:9050:9050 + networks: + tor_net: + ipv4_address: 172.31.255.250 + <<: *log-config + i2p: + container_name: wownerod_i2p + build: + context: . + dockerfile: dockerfiles/i2p + restart: unless-stopped + # ports: + # - 127.0.0.1:4447:4447 + # - 127.0.0.1:4444:4444 + networks: + tor_net: + ipv4_address: 172.31.255.251 + <<: *log-config wownerod: container_name: wownerod_daemon build: - context: dockerfiles - dockerfile: wownerod + context: . + dockerfile: dockerfiles/wownerod restart: unless-stopped volumes: - ${DATA_PATH:-./data}:/data - command: - wownerod --data-dir=/data --rpc-bind-ip=0.0.0.0 --rpc-restricted-bind-ip=0.0.0.0 --confirm-external-bind --non-interactive --public-node --rpc-restricted-bind-port=34568 --rpc-bind-port=34570 --log-level=0 --enforce-dns-checkpointing --add-priority-node 143.198.195.132:34567 --add-priority-node 134.122.53.193:34567 --add-priority-node 204.48.28.218:34567 ports: - 0.0.0.0:34567:34567 - 0.0.0.0:34568:34568 - 127.0.0.1:34570:34570 + command: + - wownerod + - --data-dir=/data + - --p2p-bind-ip=0.0.0.0 + - --rpc-restricted-bind-ip=0.0.0.0 + - --rpc-restricted-bind-port=34568 + - --zmq-rpc-bind-ip=0.0.0.0 + - --rpc-bind-ip=0.0.0.0 + - --rpc-bind-port=34570 + - --non-interactive + - --confirm-external-bind + - --public-node + - --log-level=0 + - --rpc-ssl=disabled + - --proxy=172.31.255.250:9050 + - --tx-proxy=tor,172.31.255.250:9050,disable_noise,24 + - --tx-proxy=i2p,172.31.255.251:4447,disable_noise,24 + networks: + - tor_net <<: *log-config diff --git a/dockerfiles/i2p b/dockerfiles/i2p new file mode 100644 index 0000000..f62fee2 --- /dev/null +++ b/dockerfiles/i2p @@ -0,0 +1,29 @@ +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get install wget sudo -y +RUN wget https://github.com/PurpleI2P/i2pd/releases/download/2.54.0/i2pd_2.54.0-1jammy1_amd64.deb -O i2pd.deb -q +RUN apt install ./i2pd.deb -y +RUN rm -rf i2p.deb && \ + apt clean all && \ + apt autoremove -y + +RUN adduser \ + --system \ + --shell /bin/bash \ + --gecos 'i2p' \ + --group \ + --disabled-password \ + --home /home/i2p \ + --uid 1000 \ + i2p + +COPY dockerfiles/i2p-config /i2p-config + +USER i2p + +EXPOSE 4447 + +ENTRYPOINT ["i2pd", "--conf", "/i2p-config"] diff --git a/dockerfiles/i2p-config b/dockerfiles/i2p-config new file mode 100644 index 0000000..a2d44cc --- /dev/null +++ b/dockerfiles/i2p-config @@ -0,0 +1,15 @@ +datadir = /var/lib/i2pd +log = false +loglevel = none +ipv6 = false +bandwidth = 2048 + +[socksproxy] +enabled = true +address = 0.0.0.0 +port = 4447 + +[httpproxy] +enabled = true +address = 0.0.0.0 +port = 4444 \ No newline at end of file diff --git a/dockerfiles/nodemapper b/dockerfiles/nodemapper index 4ada706..50ba189 100644 --- a/dockerfiles/nodemapper +++ b/dockerfiles/nodemapper @@ -8,6 +8,6 @@ RUN .venv/bin/pip install flask==3.0.0 RUN .venv/bin/pip install geoip2==4.7.0 RUN wget https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb -qO ./geoip.mmdb -COPY nodemapper.py app.py +COPY dockerfiles/nodemapper.py app.py ENTRYPOINT [ ".venv/bin/flask", "--app", "app", "run", "--host", "0.0.0.0" ] \ No newline at end of file diff --git a/dockerfiles/tor b/dockerfiles/tor new file mode 100644 index 0000000..91c6ff2 --- /dev/null +++ b/dockerfiles/tor @@ -0,0 +1,15 @@ +FROM ubuntu:22.04 + +RUN apt-get update && apt-get install tor -y + +RUN mkdir -p /run/tor \ + && chown -R debian-tor:debian-tor /run/tor \ + && chmod 700 -R /run/tor + +COPY dockerfiles/tor-config /etc/tor/torrc + +USER debian-tor + +EXPOSE 9050 + +ENTRYPOINT ["tor"] diff --git a/dockerfiles/tor-config b/dockerfiles/tor-config new file mode 100644 index 0000000..a89b34b --- /dev/null +++ b/dockerfiles/tor-config @@ -0,0 +1,7 @@ +DataDirectory /var/lib/tor +ExitPolicy reject6 *:*, reject *:* +ExitRelay 0 +IPv6Exit 0 +Log notice stdout +PublishServerDescriptor 0 +SOCKSPort 0.0.0.0:9050