diff --git a/dist/apps/welcome/config.toml b/dist/apps/welcome/config.toml new file mode 100644 index 0000000..9d024b7 --- /dev/null +++ b/dist/apps/welcome/config.toml @@ -0,0 +1,14 @@ +[server] +listen = "0.0.0.0:8080" +index_template = "templates/index.html" +path_prefix = "/welcome" + +[gatekeeper] +status_url = "https://gatekeeper/v0/getblockchaininfo" +installation_info_url = "https://gatekeeper/s/stats/installation.json" +config_archive_url = "https://gatekeeper/s/stats/config.7z" +certs_url = "https://gatekeeper/s/stats/client.7z" + +key_label = "000" +key_file = "/data/keys.properties" +cert_file = "/data/cert.pem" diff --git a/dist/apps/welcome/docker-compose.yaml b/dist/apps/welcome/docker-compose.yaml index 30db232..ed04237 100644 --- a/dist/apps/welcome/docker-compose.yaml +++ b/dist/apps/welcome/docker-compose.yaml @@ -6,7 +6,9 @@ services: - "TRACING=1" image: cyphernode_welcome volumes: - - "~/cyphernode_welcome/data:/data" + - "$GATEKEEPER_DATAPATH/certs/cert.pem:/data/cert.pem" + - "$GATEKEEPER_DATAPATH/keys.properties:/data/keys.properties" + - "$APP_SCRIPT_PATH/config.toml:/data/config.toml" networks: - cyphernodeappsnet restart: always diff --git a/dist/apps/welcome/start.sh b/dist/apps/welcome/start.sh index 8318bb2..6c6e768 100644 --- a/dist/apps/welcome/start.sh +++ b/dist/apps/welcome/start.sh @@ -3,6 +3,14 @@ echo "SCRIPT_NAME: $SCRIPT_NAME" echo "SHARED_HTPASSWD_PATH: $SHARED_HTPASSWD_PATH" echo "APP_SCRIPT_PATH: $APP_SCRIPT_PATH" echo "APP_START_SCRIPT_PATH: $APP_START_SCRIPT_PATH" +echo "GATEKEEPER_DATAPATH: $GATEKEEPER_DATAPATH" export SHARED_HTPASSWD_PATH -docker-compose -f $APP_SCRIPT_PATH/docker-compose.yaml up -d --remove-orphans +export GATEKEEPER_DATAPATH +export APP_SCRIPT_PATH + +if [ "$DOCKER_MODE" == "swarm" ]; then + docker stack deploy -c $APP_SCRIPT_PATH/docker-compose.yaml cn_welcome +elif [ "$DOCKER_MODE" == "compose" ]; then + docker-compose -f $APP_SCRIPT_PATH/docker-compose.yaml up -d --remove-orphans +fi diff --git a/dist/apps/welcome/stop.sh b/dist/apps/welcome/stop.sh index cdedfa2..db05c94 100644 --- a/dist/apps/welcome/stop.sh +++ b/dist/apps/welcome/stop.sh @@ -3,5 +3,10 @@ echo "SCRIPT_NAME: $SCRIPT_NAME" echo "SHARED_HTPASSWD_PATH: $SHARED_HTPASSWD_PATH" echo "APP_SCRIPT_PATH: $APP_SCRIPT_PATH" echo "APP_START_SCRIPT_PATH: $APP_START_SCRIPT_PATH" +echo "GATEKEEPER_DATAPATH: $GATEKEEPER_DATAPATH" -docker-compose -f $APP_SCRIPT_PATH/docker-compose.yaml down +if [ "$DOCKER_MODE" == "swarm" ]; then + docker stack rm cn_welcome +elif [ "$DOCKER_MODE" == "compose" ]; then + docker-compose -f $APP_SCRIPT_PATH/docker-compose.yaml down +fi