mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-02-03 19:54:28 +01:00
Added support for welcome app
This commit is contained in:
22
dist/apps/welcome/docker-compose.yaml
vendored
Normal file
22
dist/apps/welcome/docker-compose.yaml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
cyphernode_welcome:
|
||||
environment:
|
||||
- "TRACING=1"
|
||||
image: cyphernode_welcome
|
||||
volumes:
|
||||
- "/Users/jash/go/src/cyphernode_welcome/data_docker:/data"
|
||||
networks:
|
||||
- cyphernodeappsnet
|
||||
restart: always
|
||||
labels:
|
||||
- "traefik.docker.network=cyphernodeappsnet"
|
||||
- "traefik.frontend.rule=PathPrefix:/welcome; PathPrefixStrip:/welcome"
|
||||
- "traefik.frontend.passHostHeader=true"
|
||||
- "traefik.enable=true"
|
||||
- "traefik.port=8080"
|
||||
# - "traefik.frontend.auth.basic.usersFile=${SHARED_HTPASSWD_PATH}"
|
||||
networks:
|
||||
cyphernodeappsnet:
|
||||
external: true
|
||||
8
dist/apps/welcome/start.sh
vendored
Normal file
8
dist/apps/welcome/start.sh
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
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"
|
||||
|
||||
export SHARED_HTPASSWD_PATH
|
||||
docker-compose -f $APP_SCRIPT_PATH/docker-compose.yaml up -d --remove-orphans
|
||||
7
dist/apps/welcome/stop.sh
vendored
Normal file
7
dist/apps/welcome/stop.sh
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
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"
|
||||
|
||||
docker-compose -f $APP_SCRIPT_PATH/docker-compose.yaml down
|
||||
7
dist/apps/welcome/test.sh
vendored
Normal file
7
dist/apps/welcome/test.sh
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
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 "No tests"
|
||||
@@ -48,3 +48,33 @@ 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 + ':'+ gatekeeper_port + '/status/\\r\\n') %><% }) %>\033[0m\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"
|
||||
|
||||
|
||||
# be aware that randomly downloaded cyphernode apps will have access to
|
||||
# your configuration and filesystem.
|
||||
# !!!!!!!!! DO NOT INCLUDE APPS WITHOUT REVIEW !!!!!!!!!!
|
||||
# TODO: Test if we can mitigate this security issue by
|
||||
# running app dockers inside a docker container
|
||||
|
||||
start_apps() {
|
||||
local SCRIPT_NAME="start.sh"
|
||||
local APP_SCRIPT_PATH
|
||||
local APP_START_SCRIPT_PATH
|
||||
local APP_ID
|
||||
|
||||
for i in "$current_path/apps/*"
|
||||
do
|
||||
APP_SCRIPT_PATH=$(echo $i)
|
||||
if [ -d $APP_SCRIPT_PATH ]; then
|
||||
APP_START_SCRIPT_PATH="$APP_SCRIPT_PATH/$SCRIPT_NAME"
|
||||
|
||||
if [ -f $APP_START_SCRIPT_PATH ]; then
|
||||
APP_ID=$(basename $APP_SCRIPT_PATH)
|
||||
source $APP_START_SCRIPT_PATH
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
. ./installer/config.sh
|
||||
start_apps
|
||||
|
||||
@@ -11,3 +11,32 @@ export USER=$(id -u):$(id -g)
|
||||
export ARCH=$(uname -m)
|
||||
docker-compose -f $current_path/docker-compose.yaml down
|
||||
<% } %>
|
||||
|
||||
# be aware that randomly downloaded cyphernode apps will have access to
|
||||
# your configuration and filesystem.
|
||||
# !!!!!!!!! DO NOT INCLUDE APPS WITHOUT REVIEW !!!!!!!!!!
|
||||
# TODO: Test if we can mitigate this security issue by
|
||||
# running app dockers inside a docker container
|
||||
|
||||
stop_apps() {
|
||||
local SCRIPT_NAME="stop.sh"
|
||||
local APP_SCRIPT_PATH
|
||||
local APP_START_SCRIPT_PATH
|
||||
local APP_ID
|
||||
|
||||
for i in "$current_path/apps/*"
|
||||
do
|
||||
APP_SCRIPT_PATH=$(echo $i)
|
||||
if [ -d $APP_SCRIPT_PATH ]; then
|
||||
APP_START_SCRIPT_PATH="$APP_SCRIPT_PATH/$SCRIPT_NAME"
|
||||
|
||||
if [ -f $APP_START_SCRIPT_PATH ]; then
|
||||
APP_ID=$(basename $APP_SCRIPT_PATH)
|
||||
source $APP_START_SCRIPT_PATH
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
. ./installer/config.sh
|
||||
stop_apps
|
||||
Reference in New Issue
Block a user