-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node details overrides + logging utils (#415)
## Overview Add server details overrides and logging utilities. ## Changes **Non-breaking changes** - Compose script utilities: * Add `BIRDHOUSE_COLOR` option and various logging/messaging definitions in `birdhouse/scripts/logging.include.sh`. * Replace all explicit color "logging" related `echo` in scripts by utility variables `MSG_DEBUG`, `MSG_INFO`, `MSG_WARN` and `MSG_ERROR` as applicable per respective messages. * Unify all `birdhouse/scripts` utilities to employ the same `COMPOSE_DIR` variable (auto-resolved or explicitly set) in order to include or source any relevant dependencies they might have within the `birdhouse-deploy` repository. * Add `info` option (ie: `pavics-compose.sh info`) that will stop processing just before `docker-compose` call. This can be used to run a "dry-run" of the command and validate that was is loaded is as expected, by inspecting provided log messages. - Defaults: * Add multiple `SERVER_[...]` variables with defaults using previously hard coded values referring to PAVICS. These variables use a special combination of `DELAYED_EVAL` and `OPTIONAL_VARS` definitions that can make use of a variable formatted as `<ANY_NAME>='${__DEFAULT__<ANY_NAME>}'` that will print a warning messages indicating that the default is employed, although *STRONGLY* recommended to be overridden. This allows a middle ground between backward-compatible `env.local` while flagging potentially misused configurations. - Canarie-API: updated references * Use the new `SERVER_[...]` variables. * Replace the LICENSE URL of the server node pointing at [Ouranosinc/pavics-sdi](https://github.com/Ouranosinc/pavics-sdi) instead of intended [bird-house/birdhouse-deploy](https://github.com/bird-house/birdhouse-deploy). **Breaking changes** - n/a ## Related Issue / Discussion - Partially related to #414
- Loading branch information
Showing
44 changed files
with
763 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ venv/ | |
|
||
## Testing | ||
.pytest_cache/ | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.0.6 2024-02-15T16:29:01Z | ||
2.1.0 2024-02-23T20:32:41Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
#!/bin/sh | ||
|
||
THIS_FILE="`realpath "$0"`" | ||
THIS_DIR="`dirname "$THIS_FILE"`" | ||
COMPOSE_DIR="$THIS_DIR/../.." | ||
THIS_FILE="$(readlink -f "$0" || realpath "$0")" | ||
THIS_DIR="$(dirname "${THIS_FILE}")" | ||
COMPOSE_DIR="${COMPOSE_DIR:-$(dirname "${THIS_DIR}/..")}" | ||
|
||
if [ -f "${COMPOSE_DIR}/read-configs.include.sh" ]; then | ||
. "${COMPOSE_DIR}/read-configs.include.sh" | ||
|
||
# resolve GEOSERVER_DATA_DIR | ||
read_configs | ||
fi | ||
|
||
if [ ! -f "${GEOSERVER_DATA_DIR}/global.xml" ]; then | ||
echo "fix GeoServer data dir permission on first run only, when data dir do not exist yet." | ||
FIRST_RUN_ONLY=1 "$COMPOSE_DIR"/deployment/fix-geoserver-data-dir-perm | ||
log INFO "fix GeoServer data dir permission on first run only, when data dir do not exist yet." | ||
FIRST_RUN_ONLY=1 "${COMPOSE_DIR}/deployment/fix-geoserver-data-dir-perm" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,13 @@ | |
# must use single quotes to avoid early expansion before overrides in env.local | ||
# are applied and must be added to the list of DELAYED_EVAL. | ||
|
||
# Any default value that should be marked for security concern or recommended modificiation should | ||
# use the '${__DEFAULT__{var}}' naming format. These can then be referenced in 'env.local.example' to | ||
# avoid literal value duplication, and ensure they remain in sync. Also, those '${__DEFAULT__{var}}' | ||
# definitions should *NOT* be exported to avoid unnecessary polution of the environment variables. | ||
# Variables with format '${__DEFAULT__{var}}' will be flagged accordingly to their required/optional status | ||
# (see also: 'check_default_vars' in 'birdhouse/read-configs.include.sh'). | ||
|
||
export BASH_IMAGE="bash:5.1.4" | ||
|
||
# Root directory under which all data persistence should be nested under | ||
|
@@ -29,19 +36,86 @@ export PAVICS_FQDN_PUBLIC='${PAVICS_FQDN}' | |
export DELAYED_EVAL=" | ||
$DELAYED_EVAL | ||
PAVICS_FQDN_PUBLIC | ||
DOC_URL | ||
SUPPORT_EMAIL | ||
SSL_CERTIFICATE | ||
DATA_PERSIST_SHARED_ROOT | ||
WPS_OUTPUTS_DIR | ||
SERVER_NAME | ||
SERVER_DESCRIPTION | ||
SERVER_INSTITUTION | ||
SERVER_SUBJECT | ||
SERVER_TAGS | ||
SERVER_DOCUMENTATION_URL | ||
SERVER_RELEASE_NOTES_URL | ||
SERVER_SUPPORT_URL | ||
SERVER_LICENSE_URL | ||
" | ||
|
||
|
||
export SERVER_NAME=PAVICS | ||
export SERVER_DESCRIPTION=" | ||
# Server Identification Details | ||
# Following definitions should definitenly be updated. | ||
# Previous defaults are defined for backward-compatibility. | ||
# If not overridden explicitly by their non '__' prefixed variant, | ||
# a WARN message will be displayed by pavics-compose. | ||
__DEFAULT__SERVER_NAME="PAVICS" | ||
__DEFAULT__SERVER_DESCRIPTION=" | ||
The PAVICS (Power Analytics for Visualization of Climate Science) platform is a collection of | ||
climate analysis services served through Open Geospatial Consortium (OGC) protocols. | ||
These services include data access, processing and visualization. Both data and algorithms | ||
can be accessed either programmatically, through OGC-compliant clients such as QGIS or ArcGIS, | ||
or a custom web interface. | ||
" | ||
__DEFAULT__SERVER_INSTITUTION="Ouranos" | ||
__DEFAULT__SERVER_SUBJECT="Climatology" | ||
# below can be a CSV list of tags | ||
__DEFAULT__SERVER_TAGS="Climatology" | ||
__DEFAULT__SERVER_DOCUMENTATION_URL="https://pavics-sdi.readthedocs.io/en/latest/arch/backend.html" | ||
__DEFAULT__SERVER_RELEASE_NOTES_URL="https://github.com/bird-house/birdhouse-deploy/blob/master/CHANGES.md" | ||
__DEFAULT__SERVER_SUPPORT_URL="https://github.com/bird-house/birdhouse-deploy/issues" | ||
# NOTE: | ||
# This value does not use the previously hard coded default. | ||
# Previous default pointed at the wrong repository with a mismatching LICENSE file. | ||
__DEFAULT__SERVER_LICENSE_URL="https://github.com/bird-house/birdhouse-deploy/blob/master/LICENSE" | ||
__DEFAULT__SUPPORT_EMAIL="[email protected]" | ||
__DEFAULT__DOC_URL="https://www.example.com/" | ||
__DEFAULT__PAVICS_FQDN="hostname.domainname" | ||
__DEFAULT__SSL_CERTIFICATE="/path/to/ssl/cert.pem" | ||
|
||
# apply overrides or fallback above defaults with delayed evaluation | ||
# exceptions for 'SUPPORT_EMAIL' and 'DOC_URL' using the old name for backward compatibility. | ||
export SUPPORT_EMAIL='${__DEFAULT__SUPPORT_EMAIL}' | ||
export DOC_URL='${__DEFAULT__DOC_URL}' | ||
export SSL_CERTIFICATE='${__DEFAULT__SSL_CERTIFICATE}' | ||
export SERVER_NAME='${__DEFAULT__SERVER_NAME}' | ||
export SERVER_DESCRIPTION='${__DEFAULT__SERVER_DESCRIPTION}' | ||
export SERVER_INSTITUTION='${__DEFAULT__SERVER_INSTITUTION}' | ||
export SERVER_SUBJECT='${__DEFAULT__SERVER_SUBJECT}' | ||
export SERVER_TAGS='${__DEFAULT__SERVER_TAGS}' | ||
export SERVER_DOCUMENTATION_URL='${__DEFAULT__SERVER_DOCUMENTATION_URL}' | ||
export SERVER_RELEASE_NOTES_URL='${__DEFAULT__SERVER_RELEASE_NOTES_URL}' | ||
export SERVER_SUPPORT_URL='${__DEFAULT__SERVER_SUPPORT_URL}' | ||
export SERVER_LICENSE_URL='${__DEFAULT__SERVER_LICENSE_URL}' | ||
|
||
# Defaults for required variables recommended for override for security reasons. | ||
# Those will not be set explicitly as defaults to ensure they are overridden explicitly by the instance. | ||
# These values would be detected only if the instance was configured using a copy of 'env.local.example'. | ||
__DEFAULT__MAGPIE_SECRET="itzaseekrit" | ||
__DEFAULT__MAGPIE_ADMIN_USERNAME="admin" | ||
__DEFAULT__MAGPIE_ADMIN_PASSWORD="qwertyqwerty!" | ||
__DEFAULT__POSTGRES_PAVICS_USERNAME="postgres-pavics" | ||
__DEFAULT__POSTGRES_PAVICS_PASSWORD="postgres-qwerty" | ||
__DEFAULT__POSTGRES_MAGPIE_USERNAME="postgres-magpie" | ||
__DEFAULT__POSTGRES_MAGPIE_PASSWORD="postgres-qwerty" | ||
__DEFAULT__GEOSERVER_ADMIN_USER="admingeo" | ||
__DEFAULT__GEOSERVER_ADMIN_PASSWORD="geoserverpass" | ||
############################################################################# | ||
# Deprecated vars (for components in the ./deprecated-components directory) | ||
############################################################################# | ||
__DEFAULT__TOMCAT_NCWMS_PASSWORD="ncwmspass" | ||
__DEFAULT__CATALOG_USERNAME="admin-catalog" | ||
__DEFAULT__CATALOG_PASSWORD="qwerty" | ||
__DEFAULT__PHOENIX_PASSWORD="phoenix_pass" | ||
__DEFAULT__PHOENIX_PASSWORD_HASH="sha256:123456789012:1234567890123456789012345678901234567890123456789012345678901234" | ||
|
||
export DEFAULT_CONF_DIRS=' | ||
./components/proxy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.