From 5f78f09c816246c676a8c1e3f46c5bcf49c5ac0e Mon Sep 17 00:00:00 2001 From: Elie Date: Thu, 14 Aug 2014 21:10:10 -0400 Subject: [PATCH] Install Seafile as public app for access from desktop or mobile app Former-commit-id: 97a22a7b15d902003da8940159d2cd6b5007fc0c --- manifest.json | 9 +++++++++ scripts/install | 10 ++++++++++ scripts/remove | 6 +++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 30a7058..0fd1eec 100644 --- a/manifest.json +++ b/manifest.json @@ -49,6 +49,15 @@ "en": "Enter a password for the administrator" }, "example": "**Sup3rS3cr3t**" + }, + { + "name": "public_site", + "ask": { + "en": "Is it a public site ?", + "fr": "Est-ce un site public ?" + }, + "choices": ["Yes", "No"], + "default": "Yes" } ] } diff --git a/scripts/install b/scripts/install index 5bcfb58..173628c 100644 --- a/scripts/install +++ b/scripts/install @@ -4,6 +4,7 @@ path=$2 server_name=$3 admin_email=$4 admin_password=$5 +is_public=$6 final_path=/var/www/seafile seafile_data=$final_path/seafile-data seafile_version=3.1.1 @@ -60,6 +61,8 @@ sudo yunohost app setting seafile seafile_port -v $seafile_port sudo yunohost app setting seafile seafile_fileserver_port -v $seafile_fileserver_port sudo yunohost app setting seafile seahub_port -v $seahub_port +sudo yunohost app setting seafile is_public -v $is_public + # Modify install script with parameters sed -i "s@SERVER_NAME@$server_name@g" ../sources/setup-seafile.sh @@ -126,3 +129,10 @@ sudo yunohost firewall allow $seafile_port sudo yunohost firewall allow $seahub_port +if [ "$is_public" = "No" ]; +then + sudo yunohost app setting seafile skipped_uris -d + sudo yunohost app ssowatconf +else + sudo yunohost app setting seafile skipped_uris -v "/" +fi diff --git a/scripts/remove b/scripts/remove index 4843204..e026138 100644 --- a/scripts/remove +++ b/scripts/remove @@ -14,6 +14,6 @@ ccnet_port=$(sudo yunohost app setting seafile ccnet_port) seafile_port=$(sudo yunohost app setting seafile seafile_port) seahub_port=$(sudo yunohost app setting seafile seahub_port) -sudo yunohost firewall deny $ccnet_port -sudo yunohost firewall deny $seafile_port -sudo yunohost firewall deny $seahub_port +sudo yunohost firewall disallow $ccnet_port +sudo yunohost firewall disallow $seafile_port +sudo yunohost firewall disallow $seahub_port