mirror of
https://github.com/YunoHost-Apps/pluxml_ynh.git
synced 2024-09-03 20:16:02 +02:00
Merge branch 'master' of github.com:matlink/pluxml_ynh
Conflicts: conf/nginx.conf
This commit is contained in:
commit
7b9a36501e
3 changed files with 18 additions and 7 deletions
|
@ -13,13 +13,16 @@ location YNH_EXAMPLE_PATH {
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
location YNH_EXAMPLE_PATH/data/medias{
|
location YNH_EXAMPLE_PATH/data/medias{
|
||||||
allow all;
|
allow all;
|
||||||
}
|
}
|
||||||
location YNH_EXAMPLE_PATH/data {
|
|
||||||
|
location YNH_EXAMPLE_FOLDER/data {
|
||||||
deny all;
|
deny all;
|
||||||
return 403;
|
return 403;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"email": "matlink@matlink.fr",
|
"email": "matlink@matlink.fr",
|
||||||
"url": ""
|
"url": ""
|
||||||
},
|
},
|
||||||
"multi_instance": "false",
|
"multi_instance": "true",
|
||||||
"arguments": {
|
"arguments": {
|
||||||
"install" : [
|
"install" : [
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,9 @@ password=$4
|
||||||
is_public=$5
|
is_public=$5
|
||||||
default_lang=$6
|
default_lang=$6
|
||||||
|
|
||||||
|
# Remove trailing slash
|
||||||
|
[ "$path" != "/" ] && path=${path%/}
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check domain/path availability
|
||||||
sudo yunohost app checkurl $domain$path -a $app
|
sudo yunohost app checkurl $domain$path -a $app
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
|
@ -35,7 +38,6 @@ sudo mkdir -p $final_path
|
||||||
|
|
||||||
#copy files to final folder and set permissions
|
#copy files to final folder and set permissions
|
||||||
sudo cp -R ../sources/* $final_path/
|
sudo cp -R ../sources/* $final_path/
|
||||||
sudo cp ../sources/.htaccess $final_path/
|
|
||||||
sudo find $final_path -type f -name ".htaccess" | xargs sudo rm
|
sudo find $final_path -type f -name ".htaccess" | xargs sudo rm
|
||||||
|
|
||||||
#setup permissions
|
#setup permissions
|
||||||
|
@ -45,8 +47,13 @@ sudo find $final_path -type f | xargs sudo chmod 644
|
||||||
sudo find $final_path -type d | xargs sudo chmod 755
|
sudo find $final_path -type d | xargs sudo chmod 755
|
||||||
|
|
||||||
#configure nginx settings
|
#configure nginx settings
|
||||||
|
folder_path=${path%/}
|
||||||
sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" ../conf/nginx.conf
|
sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" ../conf/nginx.conf
|
||||||
sudo sed -i "s@YNH_EXAMPLE_ALIAS@$final_path@g" ../conf/nginx.conf
|
# If path is only / (without subfolder), add trailing slash to alias
|
||||||
|
alias_path=$final_path
|
||||||
|
[ "$path" == '/' ] && alias_path=$alias_path'/'
|
||||||
|
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
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|
|
||||||
#temporary set public accessible
|
#temporary set public accessible
|
||||||
|
@ -61,7 +68,8 @@ sudo sed -i "1 i\127.0.0.1 $domain #pluxml_hosts" /etc/hosts
|
||||||
|
|
||||||
#make request to install app
|
#make request to install app
|
||||||
#get the html page
|
#get the html page
|
||||||
curl -kL -o install_page.html https://$domain$path/install.php >/dev/null 2>&1
|
curl_path=$([ "$path" == "/" ] || echo $path)
|
||||||
|
curl -kL -o install_page.html https://$domain$curl_path/install.php >/dev/null 2>&1
|
||||||
|
|
||||||
|
|
||||||
#get the token for form validation
|
#get the token for form validation
|
||||||
|
@ -75,7 +83,7 @@ curl -k -X POST \
|
||||||
--data-urlencode "pwd=$password" \
|
--data-urlencode "pwd=$password" \
|
||||||
--data-urlencode "pwd2=$password" \
|
--data-urlencode "pwd2=$password" \
|
||||||
--data-urlencode "token=$token" \
|
--data-urlencode "token=$token" \
|
||||||
https://$domain$path/install.php > /dev/null 2>&1
|
https://$domain$curl_path/install.php > /dev/null 2>&1
|
||||||
|
|
||||||
sudo rm -f $final_path/install.php
|
sudo rm -f $final_path/install.php
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue