From 436f3e6093f89a80ef4369487eaa9336d59e0377 Mon Sep 17 00:00:00 2001 From: ewilly Date: Fri, 25 Mar 2016 09:49:10 +0100 Subject: [PATCH] correction --- manifest.json | 11 ----------- scripts/backup | 3 --- scripts/install | 34 ++-------------------------------- scripts/remove | 1 - scripts/restore | 7 +++---- scripts/upgrade | 4 +++- 6 files changed, 8 insertions(+), 52 deletions(-) diff --git a/manifest.json b/manifest.json index f4e928c..961676a 100644 --- a/manifest.json +++ b/manifest.json @@ -46,15 +46,6 @@ }, "example": "homer" }, - { - "name": "password", - "type": "password", - "ask": { - "en": "Choose an admin password for BoZoN", - "fr": "Choisissez un mot de passe administrateur pour BoZoN" - }, - "example": "super_secret_password" - }, { "name": "public_site", "ask": { @@ -73,8 +64,6 @@ "choices": ["de","en","es","fr","it","nl","pl","pt","po","ro","ru"], "default": "en" } - - ] } } diff --git a/scripts/backup b/scripts/backup index 74de43b..a9041b4 100644 --- a/scripts/backup +++ b/scripts/backup @@ -5,13 +5,10 @@ set -e app=bozon app_path=/var/www/$app -data_path=/home/yunohost.app/$app save_path=$1 # Backup sources & data - sudo mkdir -p $save_path/data sudo cp -R $app_path $save_path - sudo cp -R $data_path $save_path/data # Copy Nginx and YunoHost parameters to make the script "standalone" sudo cp -a /etc/yunohost/apps/$app/. save_path/yunohost diff --git a/scripts/install b/scripts/install index 8e08c79..09a539d 100644 --- a/scripts/install +++ b/scripts/install @@ -6,9 +6,8 @@ app=bozon domain=$1 path=$2 admin=$3 -password=$4 -is_public=$5 -default_lang=$6 +is_public=$4 +default_lang=$5 # Remove trailing slash [ "$path" != "/" ] && path=${path%/} @@ -64,35 +63,6 @@ sudo sed -i "s@YNH_EXAMPLE_ALIAS@$alias_path@g" ../conf/nginx.conf sudo sed -i "s@YNH_EXAMPLE_FOLDER@$folder_path@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf -# Temporary set public accessible -sudo yunohost app setting $app unprotected_uris -v "/" - -# Restart services -sudo service nginx reload -sudo yunohost app ssowatconf - -# Temporary add domain name to /etc/hosts -sudo sed -i "1 i\127.0.0.1 $domain #bozon_hosts" /etc/hosts - -#make request to install app -#get the html page -curl_path=$([ "$path" == "/" ] || echo $path) -#curl -kL -o install_page.html https://$domain$curl_path/index.php?p=admin >/dev/null 2>&1 - - -#get the token for form validation -#token=$(cat install_page.html | grep "input" | grep "token" | tail -1 | cut -d' ' -f3 | cut -d'"' -f2) -#send http POST values -curl -k -X POST \ - --data-urlencode "login=$admin" \ - --data-urlencode "pass=$password" \ - --data-urlencode "confirm=$password" \ - --data-urlencode "submit=Ok" \ - https://$domain$curl_path/index.php?p=login > /dev/null 2>&1 - -#remove domain name from /etc/hosts -sudo sed -i "/#bozon_hosts/d" /etc/hosts - # If app is private, remove url to SSOWat conf from skipped_uris if [ "$is_public" = "No" ]; then diff --git a/scripts/remove b/scripts/remove index 496b789..db66f1b 100644 --- a/scripts/remove +++ b/scripts/remove @@ -4,5 +4,4 @@ app=bozon domain=$(sudo yunohost app setting $app domain) sudo rm -rf /var/www/$app -sudo rm -rf /home/yunohost.app/$app sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf diff --git a/scripts/restore b/scripts/restore index 7ed81fa..26f313e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -2,10 +2,9 @@ app=bozon app_path=/var/www/$app -data_path=/home/yunohost.app/$app save_path=$1 sudo mv $save_path $app_path -sudo mv $app_path/data $data_path -sudo rm -rf $app_path/data -sudo chown -R www-data: $data_path +sudo chown -R www-data: $app_path/private +sudo chown -R www-data: $app_path/uploads +sudo chown -R www-data: $app_path/thumbs diff --git a/scripts/upgrade b/scripts/upgrade index 8b759ed..4d03882 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,7 +20,9 @@ sudo find $final_path -type f -name ".htaccess" | xargs sudo rm sudo rm $final_path/install.php sudo chown -R root: $final_path -sudo chown -R www-data: $final_path/data +sudo chown -R www-data: $final_path/private +sudo chown -R www-data: $final_path/uploads +sudo chown -R www-data: $final_path/thumbs sudo find $final_path -type f | xargs sudo chmod 644 sudo find $final_path -type d | xargs sudo chmod 755