From dbe79657dfe6329c92d1c5cca1f4093efb66494e Mon Sep 17 00:00:00 2001 From: chamunks Date: Tue, 9 Oct 2018 14:33:47 -0400 Subject: [PATCH] Updated networking for exposing a web front end. --- chainquery/.env | 4 ++-- chainquery/chainqueryconfig.toml | 6 +++--- chainquery/docker-compose.yml | 16 ++++++++-------- lbrycrd/.env | 2 +- lbrycrd/docker-compose.yml | 6 +++--- lbrycrd/start.sh | 8 ++++---- lbrynet-daemon/Dockerfile | 2 +- lbrynet-daemon/docker-compose.yml | 8 ++++---- reflector.go/compile/docker-compose.yml | 14 +++++++------- traefik/docker-compose.yml | 6 +++--- traefik/network-up.sh | 2 +- www.spee.ch/.env | 2 +- www.spee.ch/advanced-docker-compose.yml | 18 +++++++++--------- www.spee.ch/docker-compose.yml | 12 ++++++------ 14 files changed, 53 insertions(+), 53 deletions(-) diff --git a/chainquery/.env b/chainquery/.env index 40da1bc..d587e71 100644 --- a/chainquery/.env +++ b/chainquery/.env @@ -2,8 +2,8 @@ COMPOSE_PROJECT_NAME=chainquery RPC_USER=${RPC_USER=lbryrpc} RPC_PASSWORD=${RPC_PASSWORD:-changeme} ## This should be the internal container IP from which you'll be calling the RPC for Lbrycrdd from. -RPC_ALLOW_IP=${RPC_ALLOW_IP:-10.10.0.3} -MYSQL_SERVER=${MYSQL_SERVER:-10.10.0.10} +RPC_ALLOW_IP=${RPC_ALLOW_IP:-10.5.1.3} +MYSQL_SERVER=${MYSQL_SERVER:-10.5.1.10} MYSQL_USER=${MYSQL_USER:-changeme} MYSQL_PASSWORD=${MYSQL_PASSWORD:-changeme} MYSQL_DATABASE=${MYSQL_DATABASE:-chainquery} diff --git a/chainquery/chainqueryconfig.toml b/chainquery/chainqueryconfig.toml index a19ddb9..7bceed5 100644 --- a/chainquery/chainqueryconfig.toml +++ b/chainquery/chainqueryconfig.toml @@ -2,13 +2,13 @@ debugmode=false #LBRYcrd URL is required for chainquery to query the blockchain -lbrycrdurl="rpc://lbryrpc:changeme@10.10.0.3:9245" +lbrycrdurl="rpc://lbryrpc:changeme@10.5.1.3:9245" #MySQL DSN is required for chainquery to store information. -mysqldsn="changeme:changeme@tcp(10.10.0.10:3306)/chainquery" +mysqldsn="changeme:changeme@tcp(10.5.1.10:3306)/chainquery" #API MySQL DSN is required for chainquery to expose a SQL query service -apimysqldsn="changeme:changeme@tcp(10.10.0.10:3306)/chainquery" +apimysqldsn="changeme:changeme@tcp(10.5.1.10:3306)/chainquery" #The command that should be executed to trigger a self update of the software. For linux, for example, `.sh` #DEFAULT-autoupdatecommand=[unset] diff --git a/chainquery/docker-compose.yml b/chainquery/docker-compose.yml index 0670ba9..eaadb49 100644 --- a/chainquery/docker-compose.yml +++ b/chainquery/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.4' networks: - lbrynet: + traefik: external: true services: @@ -14,14 +14,14 @@ services: image: mysql:5.7.23 restart: always networks: - lbrynet: - ipv4_address: 10.10.0.10 + traefik: + ipv4_address: 10.5.1.10 aliases: - mysql environment: ## These variables are stored in the .env file next to this docker-compose.yml file. ## I will include a default .env file and .gitignore the ".env" pattern so you should be able to just git pull in the future if you need to. - MYSQL_SERVER: ${MYSQL_SERVER:-10.10.0.10} + MYSQL_SERVER: ${MYSQL_SERVER:-10.5.1.10} MYSQL_USER: ${MYSQL_USER:-changeme} MYSQL_PASSWORD: ${MYSQL_PASSWORD:-changeme} MYSQL_DATABASE: ${MYSQL_DATABASE:-chainquery} @@ -52,8 +52,8 @@ services: # healthcheck: # test: ["CMD", "curl", "--fail", "http://localhost:8080/", "||", "exit", "1"] networks: - lbrynet: - ipv4_address: 10.10.0.19 + traefik: + ipv4_address: 10.5.1.19 aliases: - adminer @@ -64,8 +64,8 @@ services: build: . restart: always networks: - lbrynet: - ipv4_address: 10.10.0.2 + traefik: + ipv4_address: 10.5.1.2 labels: - "traefik.expose=false" expose: diff --git a/lbrycrd/.env b/lbrycrd/.env index a3e61c1..ea606c6 100644 --- a/lbrycrd/.env +++ b/lbrycrd/.env @@ -2,4 +2,4 @@ COMPOSE_PROJECT_NAME=lbrycrd RPC_USER=${RPC_USER=lbryrpc} RPC_PASSWORD=${RPC_PASSWORD:-changeme} ## This should be the internal container IP from which you'll be calling the RPC for Lbrycrdd from. -RPC_ALLOW_IP=${RPC_ALLOW_IP:-10.10.0.2} +RPC_ALLOW_IP=${RPC_ALLOW_IP:-10.5.1.2} diff --git a/lbrycrd/docker-compose.yml b/lbrycrd/docker-compose.yml index b1ca3ca..8e49fa6 100644 --- a/lbrycrd/docker-compose.yml +++ b/lbrycrd/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.4' networks: - lbrynet: + traefik: external: true services: @@ -12,8 +12,8 @@ services: build: . restart: always networks: - lbrynet: - ipv4_address: 10.10.0.3 + traefik: + ipv4_address: 10.5.1.3 labels: - "traefik.expose=false" user: "${UID:-1000}:${GID:-1000}" diff --git a/lbrycrd/start.sh b/lbrycrd/start.sh index 93f517a..c23525c 100755 --- a/lbrycrd/start.sh +++ b/lbrycrd/start.sh @@ -24,7 +24,7 @@ # # -rpcport=${RPC_PORT:-9245} \ # # -rpcpassword=${RPC_PASSWORD:-changeme} \ # # -rpcuser=${RPC_USER:-lbryrpc} \ -# # -rpcallowip=${RPC_ALLOW_IP:-10.10.0.2} \ +# # -rpcallowip=${RPC_ALLOW_IP:-10.5.1.2} \ # # -reindex \ # # -txindex # @@ -38,7 +38,7 @@ # -rpcport=${RPC_PORT:-9245} \ # -rpcpassword=${RPC_PASSWORD:-changeme} \ # -rpcuser=${RPC_USER:-lbryrpc} \ -# -rpcallowip=${RPC_ALLOW_IP:-10.10.0.2} \ +# -rpcallowip=${RPC_ALLOW_IP:-10.5.1.2} \ # -txindex #!/bin/bash @@ -52,7 +52,7 @@ mkdir -p ~/.lbrycrd ## Set config params echo -e "rpcuser=lbryrpc\nrpcpassword=${RPC_PASSWORD:-changeme}" > ~/.lbrycrd/lbrycrd.conf -echo -e "rpcallowip=${RPC_ALLOW_IP:-10.10.0.2}" >> ~/.lbrycrd/lbrycrd.conf +echo -e "rpcallowip=${RPC_ALLOW_IP:-10.5.1.2}" >> ~/.lbrycrd/lbrycrd.conf echo -e "rpcuser=${RPC_USER:-lbryrpc}" >> ~/.lbrycrd/lbrycrd.conf ## For now keeping this simple. Potentially eventually add all command args as envvars for the Dockerfile or use safe way to add args via docker-compose.yml @@ -70,4 +70,4 @@ lbrycrdd \ # -rpcport=${RPC_PORT:-9245} \ # -rpcpassword=${RPC_PASSWORD:-changeme} \ # -rpcuser=${RPC_USER:-lbryrpc} \ -# -rpcallowip=${RPC_ALLOW_IP:-10.10.0.2} +# -rpcallowip=${RPC_ALLOW_IP:-10.5.1.2} diff --git a/lbrynet-daemon/Dockerfile b/lbrynet-daemon/Dockerfile index 5165e44..1a285cc 100644 --- a/lbrynet-daemon/Dockerfile +++ b/lbrynet-daemon/Dockerfile @@ -10,7 +10,7 @@ RUN adduser lbrynet --gecos GECOS --shell /bin/bash/ --disabled-password --home ADD https://lbry.io/get/lbrynet.linux.zip /data/lbrynet.linux.zip RUN unzip /data/lbrynet.linux.zip -d /data/ && \ rm /data/lbrynet.linux.zip && \ - chown -Rv lbrynet:lbrynet /data + chown -Rv traefik:lbrynet /data RUN wget -quiet -O /usr/bin/debugpaste https://github.com/nixc-us/debugpaste-it/raw/master/bin/debugpaste_64 && \ chmod +x /usr/bin/debugpaste diff --git a/lbrynet-daemon/docker-compose.yml b/lbrynet-daemon/docker-compose.yml index 9b04e61..c990553 100644 --- a/lbrynet-daemon/docker-compose.yml +++ b/lbrynet-daemon/docker-compose.yml @@ -1,19 +1,19 @@ version: '3.4' networks: - lbrynet: + traefik: external: true services: ############# ## Lbrynet ## ############# - lbrynet: + traefik: build: . restart: always networks: - lbrynet: - ipv4_address: 10.10.0.4 + traefik: + ipv4_address: 10.5.1.4 labels: - "traefik.expose=false" ports: diff --git a/reflector.go/compile/docker-compose.yml b/reflector.go/compile/docker-compose.yml index bd0e42c..6b88d4e 100644 --- a/reflector.go/compile/docker-compose.yml +++ b/reflector.go/compile/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.4' networks: - lbrynet: + traefik: external: true services: @@ -14,14 +14,14 @@ services: image: mysql.5.7.23 restart: always networks: - lbrynet: - ipv4_address: 10.10.0.11 + traefik: + ipv4_address: 10.5.1.11 aliases: - mysql environment: ## These variables are stored in the .env file next to this docker-compose.yml file. ## I will include a default .env file and .gitignore the ".env" pattern so you should be able to just git pull in the future if you need to. - MYSQL_SERVER: ${MYSQL_SERVER:-10.10.0.11} + MYSQL_SERVER: ${MYSQL_SERVER:-10.5.1.11} MYSQL_USER: ${MYSQL_USER:-changeme} MYSQL_PASSWORD: ${MYSQL_PASSWORD:-changeme} MYSQL_DATABASE: ${MYSQL_DATABASE:-reflector} @@ -38,8 +38,8 @@ services: build: . restart: always networks: - lbrynet: - ipv4_address: 10.10.0.20 + traefik: + ipv4_address: 10.5.1.20 environment: AWS_ID: ${AWS_ID:-default} AWS_SECRET: ${AWS_SECRET:-default} @@ -47,7 +47,7 @@ services: BUCKET_NAME: ${BUCKET_NAME:-default} DB_USER: ${MYSQL_USER:-changeme} DB_PASSWORD: ${MYSQL_PASSWORD:-changeme} - DB_HOSTIP: ${MYSQL_SERVER:-10.10.0.11} + DB_HOSTIP: ${MYSQL_SERVER:-10.5.1.11} DB_PORT: ${DB_PORT:-3306} DB_NAME: ${MYSQL_DATABASE:-reflector} labels: diff --git a/traefik/docker-compose.yml b/traefik/docker-compose.yml index 04dce6e..107028a 100644 --- a/traefik/docker-compose.yml +++ b/traefik/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.4' networks: - lbrynet: + traefik: external: true services: @@ -14,8 +14,8 @@ services: image: traefik:alpine command: --api --docker --docker.domain=docker.localhost --logLevel=DEBUG networks: - lbrynet: - ipv4_address: 10.10.0.100 + traefik: + ipv4_address: 10.5.1.100 ports: - target: 80 published: 80 diff --git a/traefik/network-up.sh b/traefik/network-up.sh index 1a5fe6f..3f36d16 100644 --- a/traefik/network-up.sh +++ b/traefik/network-up.sh @@ -1,2 +1,2 @@ #!/bin/bash -docker network create -d bridge --subnet=10.10.0.0/16 lbrynet +docker network create -d bridge --subnet=10.5.1.0/16 lbrynet diff --git a/www.spee.ch/.env b/www.spee.ch/.env index 129b3bd..ec5b4ec 100644 --- a/www.spee.ch/.env +++ b/www.spee.ch/.env @@ -1,6 +1,6 @@ COMPOSE_PROJECT_NAME=speech ## This value can generally be left alone in a default setup. -MYSQL_SERVER=10.10.0.8 +MYSQL_SERVER=10.5.1.8 ## Update the rest of these if possible. MYSQL_USER=replaceme MYSQL_PASSWORD=REPLACEME diff --git a/www.spee.ch/advanced-docker-compose.yml b/www.spee.ch/advanced-docker-compose.yml index 5c0322e..02672e9 100644 --- a/www.spee.ch/advanced-docker-compose.yml +++ b/www.spee.ch/advanced-docker-compose.yml @@ -23,14 +23,14 @@ services: - "traefik.port=3000" networks: green: - ipv4_address: 10.10.0.6 + ipv4_address: 10.5.1.6 aliases: - speech ############# ## Lbrynet ## ############# - lbrynet: + traefik: build: context: ../lbrynet-daemon/ dockerfile: Dockerfile @@ -40,12 +40,12 @@ services: - 50001 ## host volumes for persistent data such as wallet private keys. volumes: - - ../data/lbrynet:/data + - ../data/traefik:/data labels: test: traefik.enable=false networks: green: - ipv4_address: 10.10.0.7 + ipv4_address: 10.5.1.7 aliases: - lbrynet @@ -57,7 +57,7 @@ services: image: mariadb # restart: always environment: - MYSQL_SERVER: 10.10.0.8 + MYSQL_SERVER: 10.5.1.8 MYSQL_USER: replaceme MYSQL_PASSWORD: REPLACEME MYSQL_DATABASE: speech @@ -70,7 +70,7 @@ services: test: traefik.enable=false networks: green: - ipv4_address: 10.10.0.8 + ipv4_address: 10.5.1.8 aliases: - mysql @@ -95,7 +95,7 @@ services: # test: ["CMD", "curl", "--fail", "http://localhost:8080/", "||", "exit", "1"] networks: green: - ipv4_address: 10.10.0.9 + ipv4_address: 10.5.1.9 aliases: - adminer @@ -139,7 +139,7 @@ services: retries: 3 networks: green: - ipv4_address: 10.10.0.10 + ipv4_address: 10.5.1.10 aliases: - traefik @@ -151,4 +151,4 @@ networks: driver: bridge ipam: config: - - subnet: 10.10.0.0/16 + - subnet: 10.5.1.0/16 diff --git a/www.spee.ch/docker-compose.yml b/www.spee.ch/docker-compose.yml index 7be904b..8875fb6 100644 --- a/www.spee.ch/docker-compose.yml +++ b/www.spee.ch/docker-compose.yml @@ -19,14 +19,14 @@ services: - ./data/speech:/data networks: green: - ipv4_address: 10.10.0.6 + ipv4_address: 10.5.1.6 aliases: - speech ############# ## Lbrynet ## ############# - lbrynet: + traefik: build: context: ../lbrynet-daemon/ dockerfile: Dockerfile @@ -44,10 +44,10 @@ services: - 50001:50001 ## host volumes for persistent data such as wallet private keys. volumes: - - ./data/lbrynet:/data + - ./data/traefik:/data networks: green: - ipv4_address: 10.10.0.7 + ipv4_address: 10.5.1.7 aliases: - lbrynet @@ -74,7 +74,7 @@ services: - ./data/db:/var/lib/mysql networks: green: - ipv4_address: 10.10.0.8 + ipv4_address: 10.5.1.8 aliases: - mysql @@ -86,4 +86,4 @@ networks: driver: bridge ipam: config: - - subnet: 10.10.0.0/16 + - subnet: 10.5.1.0/16