Browse Source

chg: [nextcloud] avoid send password environment information when it is not used

master
Valentin Lab 2 days ago
parent
commit
39a7562ded
  1. 2
      nextcloud/hooks/init
  2. 17
      nextcloud/lib/common

2
nextcloud/hooks/init

@ -84,8 +84,6 @@ fi
init-config-add "\ init-config-add "\
$MASTER_BASE_SERVICE_NAME: $MASTER_BASE_SERVICE_NAME:
environment: environment:
NEXTCLOUD_ADMIN_USER: $admin_user
NEXTCLOUD_ADMIN_PASSWORD: $admin_password
NEXTCLOUD_DATA_DIR: /var/lib/nextcloud/data NEXTCLOUD_DATA_DIR: /var/lib/nextcloud/data
NEXTCLOUD_TRUSTED_DOMAINS: '\*' NEXTCLOUD_TRUSTED_DOMAINS: '\*'
" "

17
nextcloud/lib/common

@ -90,21 +90,16 @@ create_occ_if_not_exists() {
## bare-minimum nextcloud run AND we will use occ to set some info ## bare-minimum nextcloud run AND we will use occ to set some info
## in this very same relation. ## in this very same relation.
## Note also that ``init`` is required as it sets
## NEXTCLOUD_ADMIN_{USER,PASSWORD} that is required to trigger
## a full installation
## Note also that we need to set NEXTCLOUD_ADMIN_{USER,PASSWORD}
## that is required to trigger a full installation
if ! out=$( if ! out=$(
export COMPOSE_IGNORE_ORPHANS=true export COMPOSE_IGNORE_ORPHANS=true
## XXXvlab: this is to avoid re-running init from
## apache (if provided in compose.yml) that is bugged
## and will delete all config. It'll be run even if it
## seems excluded because ALL_RELATION is already
## solved. These are 2 mishaps that will need to be
## addressed in compose-core.
export ALL_RELATIONS=
compose --debug --without-relation="$SERVICE_NAME":web-proxy run \
read-0 LOGIN PASSWORD < "$PASSWORD_FILE" || exit 1
compose --debug --no-init --without-relation="$SERVICE_NAME":web-proxy run \
-v "$CHARM_PATH"/src/fake-apache:/usr/bin/apache \ -v "$CHARM_PATH"/src/fake-apache:/usr/bin/apache \
-e NEXTCLOUD_ADMIN_USER=$LOGIN \
-e NEXTCLOUD_ADMIN_PASSWORD=$PASSWORD \
--rm --entrypoint /entrypoint.sh "$SERVICE_NAME" apache 2>&1 --rm --entrypoint /entrypoint.sh "$SERVICE_NAME" apache 2>&1
); then ); then
err "Initialization of code or database failed unexpectedly" err "Initialization of code or database failed unexpectedly"

Loading…
Cancel
Save