starting to setup i2p

This commit is contained in:
lza_menace 2020-11-21 21:13:45 -08:00
parent 69262619fe
commit 67ee504e5d
4 changed files with 32 additions and 0 deletions

16
Dockerfile-i2p Normal file
View File

@ -0,0 +1,16 @@
FROM ubuntu:20.04
RUN apt-get -y update && \
apt-get -y install \
wget unzip && \
apt-get clean
RUN useradd -m -d /home/i2pz i2pz
USER i2pz
RUN cd ~/ && \
wget https://github.com/i2p-zero/i2p-zero/releases/download/v1.18/i2p-zero-linux.v1.18.zip -O i2p-zero.zip && \
unzip i2p-zero.zip
ENTRYPOINT ["/home/i2pz/i2p-zero-linux.v1.18/router/bin/tunnel-control.sh", "socks.create", "48080"]

View File

@ -8,3 +8,11 @@ services:
restart: unless-stopped
ports:
- 127.0.0.1:9050:9050
i2p:
container_name: i2p
build:
context: .
dockerfile: Dockerfile-i2p
restart: unless-stopped
ports:
- 127.0.0.1:4444:4444

View File

@ -188,6 +188,12 @@ def import_():
pass
logging.info(f"{len(all_nodes)} node urls imported and ready to be validated")
@app.cli.command("i2p")
def i2p():
proxies = {"http": f"socks5h://{config.I2P_HOST}:{config.I2P_PORT}"}
r = requests.get("http://vkohxr7ealm23uacawcjpbxi3smas2wajr5ne6sgmmw42ygvjikq.b32.i2p", proxies=proxies)
print(r.content)
@app.template_filter("humanize")
def humanize(d):
t = arrow.get(d, "UTC")

View File

@ -4,3 +4,5 @@ SECRET_KEY = os.environ.get('SECRET_KEY', 'xxxx')
DATA_DIR = os.environ.get('DATA_DIR', './data')
TOR_HOST = os.environ.get('TOR_HOST', '127.0.0.1')
TOR_PORT = os.environ.get('TOR_PORT', 9050)
I2P_HOST = os.environ.get('I2P_HOST', '127.0.0.1')
I2P_PORT = os.environ.get('I2P_PORT', 4444)