From b80910f9c9407adf6e90ea24b626fa1891d2569c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20F=C3=BClling?= <lukas@k40s.net>
Date: Thu, 29 Aug 2019 19:01:12 +0200
Subject: [PATCH] Add option to disable access to api admin dashboard to
 install script

---
 install.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/install.sh b/install.sh
index 41a3938..f4a17a7 100644
--- a/install.sh
+++ b/install.sh
@@ -89,10 +89,12 @@ setup() {
             read -p "Enter your redis configuration, (e.g redis://127.0.0.1:6379/0): "  funkwhale_redis_url
             funkwhale_systemd_after="funkwhale_systemd_after: "
         fi
+        yesno_prompt funkwhale_disable_django_admin 'Disable access to API admin dashboard?' 'no'
     else
         funkwhale_nginx_managed="true"
         funkwhale_database_managed="true"
         funkwhale_redis_managed="true"
+        funkwhale_disable_django_admin="false"
     fi
 
 
@@ -112,6 +114,9 @@ setup() {
     if [ "$funkwhale_database_managed" = "false" ]; then
         echo "  - Custom PostgreSQL configuration: $funkwhale_database_url"
     fi
+    if [ "$funkwhale_disable_django_admin" = "true"]; then
+        echo "- Disabled access to API admin dashboard"
+    fi
 
     if [ "$is_dry_run" = "true" ]; then
         echo "Running with dry-run mode, your system will be not be modified (apart from Ansible installation)."
@@ -255,6 +260,11 @@ EOF
 [funkwhale_servers]
 127.0.0.1 ansible_connection=local ansible_python_interpreter=/usr/bin/python3
 EOF
+    if [ "$funkwhale_disable_django_admin" = "true" ]; then
+        cat <<EOF >>playbook.yml
+      funkwhale_disable_django_admin: true
+EOF
+    fi
     echo "[2/$total_steps] Downloading Funkwhale playbook dependencies"
     $ansible_bin_path/ansible-galaxy install -r requirements.yml -f
 
-- 
GitLab