Various versioning fixes

This commit is contained in:
kexkey
2018-12-21 12:21:28 -05:00
parent f9e86fd116
commit 9ef48fea2c
14 changed files with 76 additions and 45 deletions

View File

@@ -5,13 +5,13 @@ So all the other containers are in the Docker Swarm and we want to expose a real
## Pull our Cyphernode image
```shell
docker pull cyphernode/gatekeeper:cyphernode-0.05
docker pull cyphernode/gatekeeper:latest
```
## Build yourself the image
```shell
docker build -t cyphernode/gatekeeper:cyphernode-0.05 .
docker build -t cyphernode/gatekeeper:latest .
```
## Run image
@@ -19,7 +19,7 @@ docker build -t cyphernode/gatekeeper:cyphernode-0.05 .
If you are using it independantly from the Docker stack (docker-compose.yml), you can run it like that:
```shell
docker run -d --rm --name gatekeeper -p 80:80 -p 443:443 --network cyphernodenet -v "~/cyphernode-ssl/certs:/etc/ssl/certs" -v "~/cyphernode-ssl/private:/etc/ssl/private" --env-file env.properties cyphernode/gatekeeper:cyphernode-0.05 `id -u cyphernode`:`id -g cyphernode`
docker run -d --rm --name gatekeeper -p 80:80 -p 443:443 --network cyphernodenet -v "~/cyphernode-ssl/certs:/etc/ssl/certs" -v "~/cyphernode-ssl/private:/etc/ssl/private" --env-file env.properties cyphernode/gatekeeper:latest `id -u cyphernode`:`id -g cyphernode`
```
## Prepare

View File

@@ -87,8 +87,8 @@ verify_group()
trace "[verify_group] Verifying group..."
local id=${1}
# REQUEST_URI should look like this: /watch/2blablabla
local action=$(echo "${REQUEST_URI#\/}" | cut -d '/' -f1)
# REQUEST_URI should look like this: /v0/watch/2blablabla
local action=$(echo "${REQUEST_URI#\/}" | cut -d '/' -f2)
trace "[verify_group] action=${action}"
# Check for code injection

View File

@@ -14,9 +14,9 @@ server {
index statuspage.html;
}
location / {
location /v0/ {
auth_request /auth;
proxy_pass http://proxy:8888;
proxy_pass http://proxy:8888/;
}
location /auth {

View File

@@ -4,9 +4,9 @@ server {
#include /etc/nginx/conf.d/ip-whitelist.conf;
location / {
location /v0/ {
auth_request /auth;
proxy_pass http://proxy:8888;
proxy_pass http://proxy:8888/;
}
location /auth {

View File

@@ -48,19 +48,28 @@ build_docker_images() {
fi
trace "Creating cyphernodeconf image"
build_docker_image install/ cyphernode/cyphernodeconf:cyphernode-0.05
build_docker_image install/ cyphernode/cyphernodeconf:$CN_VERSION
trace "Creating SatoshiPortal images"
build_docker_image install/SatoshiPortal/dockers/bitcoin-core cyphernode/bitcoin:cyphernode-0.05 $bitcoin_dockerfile
build_docker_image install/SatoshiPortal/dockers/c-lightning cyphernode/clightning:cyphernode-0.05 $clightning_dockerfile
build_docker_image install/SatoshiPortal/dockers/bitcoin-core cyphernode/bitcoin:$BC_VERSION $bitcoin_dockerfile
build_docker_image install/SatoshiPortal/dockers/c-lightning cyphernode/clightning:$CL_VERSION $clightning_dockerfile
trace "Creating cyphernode images"
build_docker_image api_auth_docker/ cyphernode/gatekeeper:cyphernode-0.05
build_docker_image proxy_docker/ cyphernode/proxy:cyphernode-0.05 $proxy_dockerfile
build_docker_image cron_docker/ cyphernode/proxycron:cyphernode-0.05
build_docker_image pycoin_docker/ cyphernode/pycoin:cyphernode-0.05
build_docker_image otsclient_docker/ cyphernode/otsclient:cyphernode-0.05
build_docker_image api_auth_docker/ cyphernode/gatekeeper:$CN_VERSION
build_docker_image proxy_docker/ cyphernode/proxy:$CN_VERSION $proxy_dockerfile
build_docker_image cron_docker/ cyphernode/proxycron:$CN_VERSION
build_docker_image pycoin_docker/ cyphernode/pycoin:$CN_VERSION
build_docker_image otsclient_docker/ cyphernode/otsclient:$CN_VERSION
}
# CYPHERNODE VERSION
GATEKEEPER_VERSION="latest"
PROXY_VERSION="latest"
PROXYCRON_VERSION="latest"
OTSCLIENT_VERSION="latest"
PYCOIN_VERSION="latest"
BITCOIN_VERSION="latest"
LIGHTNING_VERSION="latest"
build_docker_images

View File

@@ -3,13 +3,13 @@
## Pull our Cyphernode image
```shell
docker pull cyphernode/proxycron:cyphernode-0.05
docker pull cyphernode/proxycron:latest
```
## Build yourself the image
```shell
docker build -t cyphernode/proxycron:cyphernode-0.05 .
docker build -t cyphernode/proxycron:latest .
```
## Run image
@@ -17,7 +17,7 @@ docker build -t cyphernode/proxycron:cyphernode-0.05 .
If you are using it independantly from the Docker stack (docker-compose.yml), you can run it like that:
```shell
docker run --rm -d --network cyphernodenet --env-file env.properties cyphernode/proxycron:cyphernode-0.05
docker run --rm -d --network cyphernodenet --env-file env.properties cyphernode/proxycron:latest
```
## Configure your container by modifying `env.properties` file

19
dist/setup.sh vendored
View File

@@ -184,9 +184,16 @@ configure() {
docker run -v $current_path:/data \
-e DEFAULT_USER=$USER \
-e DEFAULT_CERT_HOSTNAME=$(hostname) \
-e GATEKEEPER_VERSION=$GATEKEEPER_VERSION \
-e PROXY_VERSION=$PROXY_VERSION \
-e PROXYCRON_VERSION=$PROXYCRON_VERSION \
-e OTSCLIENT_VERSION=$OTSCLIENT_VERSION \
-e PYCOIN_VERSION=$PYCOIN_VERSION \
-e BITCOIN_VERSION=$BITCOIN_VERSION \
-e LIGHTNING_VERSION=$LIGHTNING_VERSION \
--log-driver=none$pw_env \
--network none \
--rm$interactive cyphernode/cyphernodeconf:cyphernode-0.05 $user yo --no-insight cyphernode$gen_options $recreate
--rm$interactive cyphernode/cyphernodeconf:$CONF_VERSION $user yo --no-insight cyphernode$gen_options $recreate
if [[ -f $current_path/exitStatus.sh ]]; then
. $current_path/exitStatus.sh
rm $current_path/exitStatus.sh
@@ -625,6 +632,16 @@ ALWAYSYES=0
SUDO_REQUIRED=0
AUTOSTART=0
# CYPHERNODE VERSION "v0.1.0rc1"
CONF_VERSION="v0.1"
GATEKEEPER_VERSION="v0.1"
PROXY_VERSION="v0.1"
PROXYCRON_VERSION="v0.1"
OTSCLIENT_VERSION="v0.1"
PYCOIN_VERSION="v0.1"
BITCOIN_VERSION="v0.17.0"
LIGHTNING_VERSION="v0.6.2"
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT

View File

@@ -404,6 +404,13 @@ module.exports = class extends Generator {
installer_cleanup: false
}, this.props );
this.props.default_username = process.env.DEFAULT_USER || '';
this.props.gatekeeper_version = process.env.GATEKEEPER_VERSION || 'latest';
this.props.proxy_version = process.env.PROXY_VERSION || 'latest';
this.props.proxycron_version = process.env.PROXYCRON_VERSION || 'latest';
this.props.pycoin_version = process.env.PYCOIN_VERSION || 'latest';
this.props.otsclient_version = process.env.OTSCLIENT_VERSION || 'latest';
this.props.bitcoin_version = process.env.BITCOIN_VERSION || 'latest';
this.props.lightning_version = process.env.LIGHTNING_VERSION || 'latest';
}
_isChecked( name, value ) {

View File

@@ -5,7 +5,7 @@ services:
# HTTP authentication API gate
environment:
- "TRACING=1"
image: cyphernode/gatekeeper:cyphernode-0.05
image: cyphernode/gatekeeper:<%= gatekeeper_version %>
ports:
- "443:443"
volumes:
@@ -47,7 +47,7 @@ services:
- "WATCHER_BTC_NODE_PRUNED=<%= bitcoin_prune?'true':'false' %>"
- "OTSCLIENT_CONTAINER=otsclient:6666"
- "OTS_FILES=/proxy/otsfiles"
image: cyphernode/proxy:cyphernode-0.05
image: cyphernode/proxy:<%= proxy_version %>
<% if ( devmode ) { %>
ports:
- "8888:8888"
@@ -70,7 +70,7 @@ services:
proxycron:
environment:
- "PROXY_URL=proxy:8888/executecallbacks"
image: cyphernode/proxycron:cyphernode-0.05
image: cyphernode/proxycron:<%= proxycron_version %>
# deploy:
# placement:
# constraints: [node.hostname==dev]
@@ -80,7 +80,7 @@ services:
pycoin:
# Pycoin
command: $USER ./startpycoin.sh
image: cyphernode/pycoin:cyphernode-0.05
image: cyphernode/pycoin:<%= pycoin_version %>
environment:
- "TRACING=1"
- "PYCOIN_LISTENING_PORT=7777"
@@ -97,7 +97,7 @@ services:
<% if ( features.indexOf('lightning') !== -1 && lightning_implementation === 'c-lightning' ) { %>
lightning:
command: $USER lightningd
image: cyphernode/clightning:v0.6.2
image: cyphernode/clightning:<%= lightning_version %>
<% if( lightning_expose ) { %>
ports:
@@ -118,7 +118,7 @@ services:
environment:
- "TRACING=1"
- "OTSCLIENT_LISTENING_PORT=6666"
image: cyphernode/otsclient:cyphernode-0.05
image: cyphernode/otsclient:<%= otsclient_version %>
# deploy:
# placement:
# constraints: [node.hostname==dev]
@@ -133,7 +133,7 @@ services:
<% if( bitcoin_mode === 'internal' ) { %>
bitcoin:
command: $USER bitcoind
image: cyphernode/bitcoin:v0.17.0
image: cyphernode/bitcoin:<%= bitcoin_version %>
<% if( bitcoin_expose ) { %>
ports:
- "<%= (net === 'mainnet')?'8332:8332':'18332:18332' %>"

View File

@@ -28,8 +28,6 @@ docker-compose -f $current_path/docker-compose.yaml up -d --remove-orphans
# Will test if Cyphernode is fully up and running...
docker run --rm -it -v $current_path/testfeatures.sh:/testfeatures.sh \
-v $current_path/gatekeeper/keys.properties:/keys.properties \
-v $current_path/gatekeeper/cert.pem:/cert.pem \
-v <%= gatekeeper_datapath %>:/gatekeeper \
--network cyphernodenet alpine:3.8 /testfeatures.sh

View File

@@ -2,7 +2,7 @@
apk add --update --no-cache openssl curl jq > /dev/null
. keys.properties
. /gatekeeper/keys.properties
checkgatekeeper() {
echo -e "\r\n\e[1;36mTesting Gatekeeper...\e[0;32m" > /dev/console
@@ -24,7 +24,7 @@ checkgatekeeper() {
sleep 2
echo " Testing expired request... " > /dev/console
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" --cacert /cert.pem https://gatekeeper/getblockinfo)
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" --cacert /gatekeeper/certs/cert.pem https://gatekeeper/v0/getblockinfo)
[ "${rc}" -ne "403" ] && return 10
# Let's test authentication (signature)
@@ -34,7 +34,7 @@ checkgatekeeper() {
token="$h64.$p64.a$s"
echo " Testing bad signature... " > /dev/console
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" --cacert /cert.pem https://gatekeeper/getblockinfo)
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" --cacert /gatekeeper/certs/cert.pem https://gatekeeper/v0/getblockinfo)
[ "${rc}" -ne "403" ] && return 30
# Let's test authorization (action access for groups)
@@ -42,7 +42,7 @@ checkgatekeeper() {
token="$h64.$p64.$s"
echo " Testing watcher trying to do a spender action... " > /dev/console
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" --cacert /cert.pem https://gatekeeper/getbalance)
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" --cacert /gatekeeper/certs/cert.pem https://gatekeeper/v0/getbalance)
[ "${rc}" -ne "403" ] && return 40
id="002"
@@ -52,7 +52,7 @@ checkgatekeeper() {
token="$h64.$p64.$s"
echo " Testing spender trying to do an internal action call... " > /dev/console
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" --cacert /cert.pem https://gatekeeper/conf)
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" --cacert /gatekeeper/certs/cert.pem https://gatekeeper/v0/conf)
[ "${rc}" -ne "403" ] && return 50
@@ -63,7 +63,7 @@ checkgatekeeper() {
token="$h64.$p64.$s"
echo " Testing admin trying to do an internal action call... " > /dev/console
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" --cacert /cert.pem https://gatekeeper/conf)
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" --cacert /gatekeeper/certs/cert.pem https://gatekeeper/v0/conf)
[ "${rc}" -ne "403" ] && return 60
echo -e "\e[1;36mGatekeeper rocks!" > /dev/console

View File

@@ -3,13 +3,13 @@
## Pull our Cyphernode image
```shell
docker pull cyphernode/ots:cyphernode-0.05
docker pull cyphernode/otsclient:latest
```
## Build yourself the image
```shell
docker build -t cyphernode/ots:cyphernode-0.05 .
docker build -t cyphernode/otsclient:latest .
```
## OTS files directory...
@@ -25,7 +25,7 @@ sudo find ~/otsfiles -type d -exec chmod 2775 {} \; ; sudo find ~/otsfiles -type
If you are using it independantly from the Docker stack (docker-compose.yml), you can run it like that:
```shell
docker run --rm -d -p 6666:6666 --network cyphernodenet --env-file env.properties cyphernode/ots:cyphernode-0.05 `id -u cyphernode`:`id -g cyphernode` ./startotsclient.sh
docker run --rm -d -p 6666:6666 --network cyphernodenet --env-file env.properties cyphernode/otsclient:latest `id -u cyphernode`:`id -g cyphernode` ./startotsclient.sh
```
## Usefull examples

View File

@@ -3,13 +3,13 @@
## Pull our Cyphernode image
```shell
docker pull cyphernode/proxy:cyphernode-0.05
docker pull cyphernode/proxy:latest
```
## Build yourself the image
```shell
docker build -t cyphernode/proxy:cyphernode-0.05 .
docker build -t cyphernode/proxy:latest .
```
## Run image
@@ -17,7 +17,7 @@ docker build -t cyphernode/proxy:cyphernode-0.05 .
If you want to run this container independently from Cyphernode:
```shell
docker run --rm -d -p 8888:8888 --network cyphernodenet --env-file env.properties cyphernode/proxy:cyphernode-0.05 `id -u cyphernode`:`id -g cyphernode` ./startproxy.sh
docker run --rm -d -p 8888:8888 --network cyphernodenet --env-file env.properties cyphernode/proxy:latest `id -u cyphernode`:`id -g cyphernode` ./startproxy.sh
```
## Configure your container by modifying `env.properties` file

View File

@@ -3,13 +3,13 @@
## Pull our Cyphernode image
```shell
docker pull cyphernode/pycoin:cyphernode-0.05
docker pull cyphernode/pycoin:latest
```
## Build yourself the image
```shell
docker build -t cyphernode/pycoin:cyphernode-0.05 .
docker build -t cyphernode/pycoin:latest .
```
## Run image
@@ -17,7 +17,7 @@ docker build -t cyphernode/pycoin:cyphernode-0.05 .
If you are using it independantly from the Docker stack (docker-compose.yml), you can run it like that:
```shell
docker run --rm -d -p 7777:7777 --network cyphernodenet --env-file env.properties cyphernode/pycoin:cyphernode-0.05 `id -u cyphernode`:`id -g cyphernode` ./startpycoin.sh
docker run --rm -d -p 7777:7777 --network cyphernodenet --env-file env.properties cyphernode/pycoin:latest `id -u cyphernode`:`id -g cyphernode` ./startpycoin.sh
```
## Usefull examples