Update README.md
|
@ -3,3 +3,10 @@ pluxml_ynh
|
|||
A yunohost version of PluXml : http://www.pluxml.org
|
||||
|
||||
once installed, go to the web path of pluxml and follow the instructions.
|
||||
|
||||
TODO
|
||||
=====
|
||||
|
||||
-dodge the installation step by giving settings to pluxml (installation will be automatic)
|
||||
|
||||
-set files permissions to 750 for the whole folder (cause after installation step, configuration folder is created with word readable permission, that folder contains login infos with hashed pass via sha1 oO)
|
||||
|
|
|
@ -26,13 +26,15 @@ fi
|
|||
# Save app settings
|
||||
sudo yunohost app setting $app admin -v "$admin"
|
||||
sudo yunohost app setting $app is_public -v "$is_public"
|
||||
sudo yunohost app setting $app domain -v "$domain"
|
||||
sudo yunohost app setting $app path -v "$path"
|
||||
|
||||
#create path for copying
|
||||
final_path=/var/www/$app
|
||||
sudo mkdir -p $final_path
|
||||
|
||||
#copy files to final folder and set permissions
|
||||
sudo cp -R ../src/* $final_path/
|
||||
sudo cp -R ../sources/* $final_path/
|
||||
sudo chown www-data:www-data -R $final_path
|
||||
|
||||
#configure nginx settings
|
||||
|
@ -41,17 +43,21 @@ sudo sed -i "s@YNH_EXAMPLE_ALIAS@$final_path@g" ../conf/nginx.conf
|
|||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
#temporal set public acessible
|
||||
sudo yunohost app setting $app skipped_uris -v "/"
|
||||
sudo yunohost app setting $app unprotected_uris -v "/"
|
||||
|
||||
#make request to install app
|
||||
#token=
|
||||
curl -k -X POST --data "default_lang=fr&timezone=Greenland&install=Installer&name=$admin&login=$admin&pwd=$password&pwd2=$password&token=$token" https://$domain/$path/install.php
|
||||
#get the html page
|
||||
curl -kL -o "install_page.html" https://$domain/$path/install.php >/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 "default_lang=fr&timezone=Greenland&install=Installer&name=$admin&login=$admin&pwd=$password&pwd2=$password&token=$token" https://$domain/$path/install.php >/dev/null 2>&1
|
||||
sudo chmod 750 -R $final_path
|
||||
|
||||
# If app is private, remove url to SSOWat conf from skipped_uris
|
||||
if [ "$is_public" = "No" ];
|
||||
then
|
||||
sudo yunohost app setting wordpress skipped_uris -d
|
||||
sudo yunohost app setting $app skipped_uris -d
|
||||
fi
|
||||
|
||||
#adding admin to the allowed users
|
||||
|
|
33
scripts/upgrade
Normal file
|
@ -0,0 +1,33 @@
|
|||
#! /bin/bash
|
||||
|
||||
app=pluxml
|
||||
|
||||
#retrieve arguments
|
||||
domain=$(sudo yunohost app setting $app domain)
|
||||
path=$(sudo yunohost app setting $app path)
|
||||
admin=$(sudo yunohost app setting $app admin)
|
||||
is_public=$(sudo yunohost app setting $app is_public)
|
||||
|
||||
|
||||
# Remove trailing "/" for next commands
|
||||
path=${path%/}
|
||||
|
||||
# Copy source files
|
||||
final_path=/var/www/$app
|
||||
sudo mkdir -p $final_path
|
||||
sudo cp -a ../sources/* $final_path
|
||||
|
||||
#configure nginx settings
|
||||
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
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
# If app is public, add url to SSOWat conf as skipped_uris
|
||||
if [ "$is_public" = "Yes" ];
|
||||
then
|
||||
sudo yunohost app setting $app unprotected_uris -v "/"
|
||||
fi
|
||||
|
||||
# Restart services
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
Before Width: | Height: | Size: 626 B After Width: | Height: | Size: 626 B |
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 689 B After Width: | Height: | Size: 689 B |
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |