From 46d5099f50f8c8f4dfaf9958c2fe0a3ad9fc14e3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 23 Dec 2016 22:19:21 +0000 Subject: [PATCH] Allow mediagoblin registrations to be disabled --- src/freedombone-app-mediagoblin | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/freedombone-app-mediagoblin b/src/freedombone-app-mediagoblin index 1d0dfda0..f1ebd933 100755 --- a/src/freedombone-app-mediagoblin +++ b/src/freedombone-app-mediagoblin @@ -45,6 +45,7 @@ mediagoblin_variables=(ONION_ONLY MY_USERNAME MEDIAGOBLIN_DOMAIN_NAME MEDIAGOBLIN_CODE + DEFAULT_DOMAIN_NAME DDNS_PROVIDER) function install_interactive_mediagoblin { @@ -58,6 +59,27 @@ function install_interactive_mediagoblin { APP_INSTALLED=1 } +function configure_interactive_mediagoblin { + read_config_param 'MEDIAGOBLIN_DOMAIN_NAME' + MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs + + dialog --title $"Mediagoblin" \ + --backtitle $"Freedombone Control Panel" \ + --defaultno \ + --yesno $"\nAllow registration of new users?" 10 60 + sel=$? + case $sel in + 0) + sed -i 's|allow_registration.*|allow_registration = true|g' $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin.ini + ;; + 1) + sed -i 's|allow_registration.*|allow_registration = false|g' $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin.ini + ;; + 255) return;; + esac + systemctl restart mediagoblin +} + function change_password_mediagoblin { curr_username="$1" new_user_password="$2"