From 97ae1a8fd98c6bf8499bdc6e17010b2d0b2f051e Mon Sep 17 00:00:00 2001 From: kexkey Date: Sun, 23 Feb 2020 22:14:33 +0000 Subject: [PATCH] Added QR Code of Onion address at the end of startup when Tor activated (#166) * Added QR Code of Onion address at the end of startup when Tor activated * Indentation fix --- cyphernodeconf_docker/Dockerfile | 24 +++++++++++++++++-- cyphernodeconf_docker/lib/app.js | 1 + .../templates/installer/testdeployment.sh | 7 +++++- dist/setup.sh | 1 + 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/cyphernodeconf_docker/Dockerfile b/cyphernodeconf_docker/Dockerfile index aefacdc..554438f 100644 --- a/cyphernodeconf_docker/Dockerfile +++ b/cyphernodeconf_docker/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.13-alpine3.10 as builder +FROM golang:1.13-alpine3.10 as builder-torgen RUN apk add git build-base @@ -13,12 +13,32 @@ RUN go get RUN go build torgen.go RUN chmod +x /go/src/torgen/torgen +FROM alpine:3.11.0 as builder-qrencode + +RUN apk add --update --no-cache \ + autoconf \ + automake \ + build-base \ + libtool \ + git \ + pkgconfig + +RUN git clone https://github.com/fukuchi/libqrencode.git \ + && cd libqrencode \ + && ./autogen.sh \ + && ./configure \ + && make \ + && make install + FROM node:12.2.0-alpine ENV EDITOR=/usr/bin/nano COPY . /app -COPY --from=builder /go/src/torgen/torgen /app/torgen +COPY --from=builder-torgen /go/src/torgen/torgen /app/torgen +COPY --from=builder-qrencode /usr/local/bin/qrencode /usr/local/bin/ +COPY --from=builder-qrencode /usr/local/lib/libqrencode.so.4.1.0 /usr/local/lib/libqrencode.so.4 + WORKDIR /app RUN mkdir /data && \ diff --git a/cyphernodeconf_docker/lib/app.js b/cyphernodeconf_docker/lib/app.js index 05e2301..cca90dc 100644 --- a/cyphernodeconf_docker/lib/app.js +++ b/cyphernodeconf_docker/lib/app.js @@ -93,6 +93,7 @@ module.exports = class App { bitcoin_version: process.env.BITCOIN_VERSION, lightning_version: process.env.LIGHTNING_VERSION, notifier_version: process.env.NOTIFIER_VERSION, + conf_version: process.env.CONF_VERSION, setup_version: process.env.SETUP_VERSION, noWizard: !!options.noWizard, noSplashScreen: !!options.noSplashScreen, diff --git a/cyphernodeconf_docker/templates/installer/testdeployment.sh b/cyphernodeconf_docker/templates/installer/testdeployment.sh index 8b15eb2..cb3a963 100644 --- a/cyphernodeconf_docker/templates/installer/testdeployment.sh +++ b/cyphernodeconf_docker/templates/installer/testdeployment.sh @@ -80,7 +80,12 @@ printf "\r\n\033[0;92mDepending on your current location and DNS settings, point printf "\r\n" printf "\033[0;95m<% cns.forEach(cn => { %><%= ('https://' + cn + ':' + traefik_https_port + '/welcome\\r\\n') %><% }) %>\033[0m\r\n" <% if ( features.indexOf('tor') !== -1 && torifyables && torifyables.indexOf('tor_traefik') !== -1 ) { %> -printf "\033[0;92mYou can also use Tor Browser and navigate to your onion address:\r\n" +printf "\033[0;92mYou can also use Tor Browser and navigate to your onion address:\r\n\r\n" printf "\033[0;95mhttps://${TOR_TRAEFIK_HOSTNAME}:<%= traefik_https_port %>/welcome\033[0m\r\n\r\n" + +printf "\033[0;92mTor Browser on mobile? We got you:\r\n\r\n\033[0m" +docker run --rm -it cyphernode/cyphernodeconf:<%= conf_version %> $USER qrencode -t UTF8 "https://${TOR_TRAEFIK_HOSTNAME}:443/welcome" +printf "\r\n" + <% } %> printf "\033[0;92mUse 'admin' as the username with the configuration password you selected at the beginning of the configuration process.\r\n\r\n\033[0m" diff --git a/dist/setup.sh b/dist/setup.sh index a61fe9d..e01d16b 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -195,6 +195,7 @@ configure() { -e PYCOIN_VERSION=$PYCOIN_VERSION \ -e BITCOIN_VERSION=$BITCOIN_VERSION \ -e LIGHTNING_VERSION=$LIGHTNING_VERSION \ + -e CONF_VERSION=$CONF_VERSION \ -e SETUP_VERSION=$SETUP_VERSION \ --log-driver=none$pw_env \ --network none \