diff --git a/bridgehead b/bridgehead index 0d86110..989e26f 100755 --- a/bridgehead +++ b/bridgehead @@ -193,19 +193,6 @@ case "$ACTION" in ;; postRun | postUpdate) ;; - ### ovisreimport is untested, just writing down the idea to test it later - # ovisreimport) - # ./bridgehead stop ${PROJECT} - # docker volume rm ${PROJECT}_ovis-mongodb-data - # loadVars - # hc_send log "Bridgehead $PROJECT startup (ovisreimport): Checking requirements ..." - # checkRequirements - # sync_secrets - # hc_send log "Bridgehead $PROJECT startup (ovisreimport): Requirements checked out. Now starting bridgehead ..." - # exec $COMPOSE --profile ovisreimport -p $PROJECT -f ./minimal/docker-compose.yml -f ./$PROJECT/docker-compose.yml $OVERRIDE up --abort-on-container-exit *) - # printUsage - # exit 1 - # ;; *) printUsage exit 1 diff --git a/ovis/docker-compose.yml b/ovis/docker-compose.yml index 94a2c15..4fd83b2 100644 --- a/ovis/docker-compose.yml +++ b/ovis/docker-compose.yml @@ -58,11 +58,6 @@ services: ORIGIN: ${OVIS_PUBLIC_ORIGIN:-https://${HOST:-localhost}} volumes: - ovis-catalogue-data:/app/dynamic-catalogue:ro - - ${OVIS_CATALOGUE_FILE:-../ovis/runtime/mongodb/ovis-catalogue.json}:/app/static/ovis-catalogue.json:ro - - ${OVIS_SITE_DOWNLOADS_DIR:-../ovis/runtime/downloads}/UserAgreement/ovis_userAgreement_en_template.pdf:/app/static/downloads/ovis_userAgreement_en_template.pdf:ro - - ${OVIS_SITE_DOWNLOADS_DIR:-../ovis/runtime/downloads}/UserAgreement/ovis_userAgreement_de_template.pdf:/app/static/downloads/ovis_userAgreement_de_template.pdf:ro - - ${OVIS_SITE_DOWNLOADS_DIR:-../ovis/runtime/downloads}/Authorization/ovis_authorization_en_template.pdf:/app/static/downloads/ovis_authorization_en_template.pdf:ro - - ${OVIS_SITE_DOWNLOADS_DIR:-../ovis/runtime/downloads}/Authorization/ovis_authorization_de_template.pdf:/app/static/downloads/ovis_authorization_de_template.pdf:ro depends_on: ovis-backend-apollo: condition: service_healthy @@ -93,7 +88,6 @@ services: http_proxy: ${OVIS_HTTP_PROXY:-} https_proxy: ${OVIS_HTTPS_PROXY:-} no_proxy: ${OVIS_NO_PROXY:-} - CORS_ORIGIN: "*" DB: onc_test ADDRESS: mongodb://ovis-backend-database-mongodb:27017 volumes: @@ -117,7 +111,6 @@ services: environment: OVIS_ROOT_USERNAME: ${OVIS_ROOT_USERNAME:-ovis-root} volumes: - - ${OVIS_MONGO_INIT_FILE:-../ovis/runtime/mongodb/initdb.js}:/docker-entrypoint-initdb.d/init.js:ro - ovis-mongo-db:/data/db - ovis-mongo-conf:/data/configdb @@ -131,7 +124,6 @@ services: http_proxy: ${OVIS_HTTP_PROXY:-} https_proxy: ${OVIS_HTTPS_PROXY:-} no_proxy: ${OVIS_NO_PROXY:-} - CORS_ORIGIN: "*" DB: onc_test ADDRESS: mongodb://ovis-backend-database-mongodb:27017 CATALOGUE_PATH: /app/generated/ovis-catalogue.json diff --git a/ovis/runtime/downloads/Authorization/ovis_authorization_de_template.pdf b/ovis/runtime/downloads/Authorization/ovis_authorization_de_template.pdf deleted file mode 100644 index 8038e4f..0000000 Binary files a/ovis/runtime/downloads/Authorization/ovis_authorization_de_template.pdf and /dev/null differ diff --git a/ovis/runtime/downloads/Authorization/ovis_authorization_en_template.pdf b/ovis/runtime/downloads/Authorization/ovis_authorization_en_template.pdf deleted file mode 100644 index 31816e4..0000000 Binary files a/ovis/runtime/downloads/Authorization/ovis_authorization_en_template.pdf and /dev/null differ diff --git a/ovis/runtime/downloads/UserAgreement/ovis_userAgreement_de_template.pdf b/ovis/runtime/downloads/UserAgreement/ovis_userAgreement_de_template.pdf deleted file mode 100644 index bed89ce..0000000 Binary files a/ovis/runtime/downloads/UserAgreement/ovis_userAgreement_de_template.pdf and /dev/null differ diff --git a/ovis/runtime/downloads/UserAgreement/ovis_userAgreement_en_template.pdf b/ovis/runtime/downloads/UserAgreement/ovis_userAgreement_en_template.pdf deleted file mode 100644 index a21f8e4..0000000 Binary files a/ovis/runtime/downloads/UserAgreement/ovis_userAgreement_en_template.pdf and /dev/null differ diff --git a/ovis/runtime/mongodb/initdb.js b/ovis/runtime/mongodb/initdb.js deleted file mode 100644 index c63b4e1..0000000 --- a/ovis/runtime/mongodb/initdb.js +++ /dev/null @@ -1,18 +0,0 @@ -const rootUsername = process.env.OVIS_ROOT_USERNAME || 'ovis-root'; -const databaseName = process.env.DB || 'onc_test'; - -db = db.getSiblingDB(databaseName); -db.createCollection('user'); -db.user.insertMany([ - { - _id: rootUsername, - createdAt: new Date(), - createdBy: 'system', - role: 'super-admin', - status: 'active', - pseudonymization: false, - darkMode: false, - colorTheme: 'CCCMunich', - language: 'en' - } -]); diff --git a/ovis/runtime/mongodb/ovis-catalogue.json b/ovis/runtime/mongodb/ovis-catalogue.json deleted file mode 100644 index 0967ef4..0000000 --- a/ovis/runtime/mongodb/ovis-catalogue.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/ovis/vars b/ovis/vars index 1869d1e..e1da61b 100644 --- a/ovis/vars +++ b/ovis/vars @@ -1,7 +1,6 @@ PRIVATEKEYFILENAME=/etc/bridgehead/pki/${SITE_ID}.priv.pem BROKER_URL_FOR_PREREQ=${OVIS_PREREQ_URL:-https://github.com} -: ${ENABLE_OVIS:=true} : ${REQUIRES_BEAM:=false} : ${OVIS_PUBLIC_BASE_PATH:=/ovis} : ${OVIS_PUBLIC_ORIGIN:=https://${HOST}} @@ -15,45 +14,39 @@ BROKER_URL_FOR_PREREQ=${OVIS_PREREQ_URL:-https://github.com} : ${PUBLIC_SYSTEM_START_LANGUAGE:=en} : ${PUBLIC_NAV_STUDY_ENABLED:=true} : ${PUBLIC_NAV_USER_MANAGEMENT_ENABLED:=true} -: ${OVIS_SITE_CONFIG_DIR:=/etc/bridgehead/ovis} : ${OVIS_RUNTIME_DIR:=$(pwd)/ovis/runtime} -: ${OVIS_SITE_DOWNLOADS_DIR:=${OVIS_RUNTIME_DIR}/downloads} : ${OVIS_SITE_CERTS_DIR:=${OVIS_RUNTIME_DIR}/certs} : ${OVIS_SITE_KEYCLOAK_REALM_FILE:=${OVIS_RUNTIME_DIR}/keycloak/ovis-realm.json} -: ${OVIS_CATALOGUE_FILE:=${OVIS_RUNTIME_DIR}/mongodb/ovis-catalogue.json} -: ${OVIS_MONGO_INIT_FILE:=${OVIS_RUNTIME_DIR}/mongodb/initdb.js} : ${OVIS_OPS4_FILE:=${OVIS_RUNTIME_DIR}/mongodb/ops4.mjs} : ${OVIS_CREDOS_EXPORT_DIR:=${OVIS_RUNTIME_DIR}/input/CREDOSExportFiles} -if [ "${ENABLE_OVIS}" = "true" ]; then - mkdir -p /var/cache/bridgehead/ovis || fail_and_report 1 "Failed to create /var/cache/bridgehead/ovis" - OVIS_CREDENTIALS_FILE=${OVIS_CREDENTIALS_FILE:-/var/cache/bridgehead/ovis/credentials.env} +mkdir -p /var/cache/bridgehead/ovis || fail_and_report 1 "Failed to create /var/cache/bridgehead/ovis" +OVIS_CREDENTIALS_FILE=${OVIS_CREDENTIALS_FILE:-/var/cache/bridgehead/ovis/credentials.env} - ovis_random_secret() { - openssl rand -hex 24 - } +ovis_random_secret() { + openssl rand -hex 24 +} - if [ ! -f "$OVIS_CREDENTIALS_FILE" ]; then - umask 077 - { - printf ': ${KEYCLOAK_ADMIN:=ovis-admin}\n' - printf ': ${KEYCLOAK_ADMIN_PASSWORD:=%s}\n' "$(ovis_random_secret)" - printf ': ${KEYCLOAK_REALM:=ovis}\n' - printf ': ${KEYCLOAK_CLIENT_ID:=ovis_client}\n' - printf ': ${KEYCLOAK_CLIENT_SECRET:=%s}\n' "$(ovis_random_secret)" - printf ': ${KEYCLOAK_ADMIN_CLIENT_ID:=admin-cli}\n' - printf ': ${KEYCLOAK_ADMIN_CLIENT_SECRET:=%s}\n' "$(ovis_random_secret)" - printf ': ${OVIS_ROOT_USERNAME:=ovis-root}\n' - printf ': ${OVIS_ROOT_PASSWORD:=%s}\n' "$(ovis_random_secret)" - printf ': ${POSTGRES_DB:=keycloak}\n' - printf ': ${POSTGRES_USER:=ovis_keycloak}\n' - printf ': ${POSTGRES_PASSWORD:=%s}\n' "$(ovis_random_secret)" - } > "$OVIS_CREDENTIALS_FILE" - fi - if [ "$(id -u)" -eq 0 ] && id bridgehead >/dev/null 2>&1; then - chown bridgehead /var/cache/bridgehead/ovis "$OVIS_CREDENTIALS_FILE" - fi - chmod 700 /var/cache/bridgehead/ovis - chmod 600 "$OVIS_CREDENTIALS_FILE" - source "$OVIS_CREDENTIALS_FILE" +if [ ! -f "$OVIS_CREDENTIALS_FILE" ]; then + umask 077 + { + printf ': ${KEYCLOAK_ADMIN:=ovis-admin}\n' + printf ': ${KEYCLOAK_ADMIN_PASSWORD:=%s}\n' "$(ovis_random_secret)" + printf ': ${KEYCLOAK_REALM:=ovis}\n' + printf ': ${KEYCLOAK_CLIENT_ID:=ovis_client}\n' + printf ': ${KEYCLOAK_CLIENT_SECRET:=%s}\n' "$(ovis_random_secret)" + printf ': ${KEYCLOAK_ADMIN_CLIENT_ID:=admin-cli}\n' + printf ': ${KEYCLOAK_ADMIN_CLIENT_SECRET:=%s}\n' "$(ovis_random_secret)" + printf ': ${OVIS_ROOT_USERNAME:=ovis-root}\n' + printf ': ${OVIS_ROOT_PASSWORD:=%s}\n' "$(ovis_random_secret)" + printf ': ${POSTGRES_DB:=keycloak}\n' + printf ': ${POSTGRES_USER:=ovis_keycloak}\n' + printf ': ${POSTGRES_PASSWORD:=%s}\n' "$(ovis_random_secret)" + } > "$OVIS_CREDENTIALS_FILE" fi +if [ "$(id -u)" -eq 0 ] && id bridgehead >/dev/null 2>&1; then + chown bridgehead /var/cache/bridgehead/ovis "$OVIS_CREDENTIALS_FILE" +fi +chmod 700 /var/cache/bridgehead/ovis +chmod 600 "$OVIS_CREDENTIALS_FILE" +source "$OVIS_CREDENTIALS_FILE"