From 34ccab8042c94074666d7ab2de636711541ee943 Mon Sep 17 00:00:00 2001 From: Christopher James Halse Rogers Date: Thu, 5 Nov 2020 17:11:27 +1100 Subject: [PATCH] snap: Add registration configuration option --- snap/hooks/configure | 6 ++++++ snap/local/set-environment | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/snap/hooks/configure b/snap/hooks/configure index 21869aa2..9e9d75b5 100644 --- a/snap/hooks/configure +++ b/snap/hooks/configure @@ -22,4 +22,10 @@ then echo "Invalid 'federation' setting: ${federation_enabled}. Valid values are 'true' or 'false'" fi +registration_enabled=$(snapctl get registration) +if [ -n ${registration_enabled} -a \( "${registration_enabled}" != "true" -a "${registration_enabled}" != "false" \) ] +then + echo "Invalid 'registration' setting: ${registration_enabled}. Valid values are 'true' or 'false'" +fi + exit 0 diff --git a/snap/local/set-environment b/snap/local/set-environment index b65aee00..42552f56 100755 --- a/snap/local/set-environment +++ b/snap/local/set-environment @@ -22,6 +22,12 @@ then export ROCKET_FEDERATION_ENABLED=${federation_enabled} fi +registration_enabled="$(snapctl get registration)" +if [ -n "${registration_enabled}" -a "${registration_enabled}" = "false" ] +then + export ROCKET_REGISTRATION_DISABLED="true" +fi + export ROCKET_ENV="production" export ROCKET_DATABASE_PATH=${SNAP_DATA}