mirror of
https://github.com/YunoHost-Apps/bozon_ynh.git
synced 2024-09-03 18:16:09 +02:00
correction
This commit is contained in:
parent
be9c5b0c75
commit
436f3e6093
6 changed files with 8 additions and 52 deletions
|
@ -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"
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue