mirror of
https://github.com/YunoHost-Apps/spip_ynh.git
synced 2024-09-03 20:25:59 +02:00
59 lines
No EOL
1.4 KiB
Bash
59 lines
No EOL
1.4 KiB
Bash
#!/bin/bash
|
|
|
|
source .fonctions
|
|
|
|
CLEAN_SETUP () {
|
|
echo ""
|
|
}
|
|
TRAP_ON
|
|
|
|
domain=$YNH_APP_ARG_DOMAIN
|
|
path=$YNH_APP_ARG_PATH
|
|
admin=$YNH_APP_ARG_ADMIN
|
|
language=$YNH_APP_ARG_LANGUAGE
|
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
# Source app helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
CHECK_VAR "$app" "app name not set"
|
|
|
|
CHECK_USER "$admin"
|
|
|
|
CHECK_PATH
|
|
|
|
CHECK_DOMAINPATH
|
|
|
|
CHECK_FINALPATH
|
|
|
|
sudo yunohost app setting $app domain -v $domain
|
|
sudo yunohost app setting $app path -v $path
|
|
sudo yunohost app setting $app admin -v $admin
|
|
sudo yunohost app setting $app is_public -v $is_public
|
|
sudo yunohost app setting $app language -v $language
|
|
|
|
GENERATE_DB $app # Créer une base de données et un utilisateur dédié au nom de l'app.
|
|
|
|
# Crée le repertoire de destination et stocke son emplacement.
|
|
sudo mkdir "$final_path"
|
|
sudo yunohost app setting $app final_path -v $final_path
|
|
|
|
SETUP_SOURCE "spip-3.1.zip"
|
|
|
|
# Set permissions to spip directory
|
|
sudo chown -R www-data: $final_path
|
|
|
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
|
sed -i "s@ALIASTOCHANGE@$final_path@g" ../conf/nginx.conf
|
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/spip.conf
|
|
|
|
POOL_FPM
|
|
|
|
# Reload Nginx and regenerate SSOwat conf
|
|
sudo service php5-fpm restart
|
|
sudo service nginx reload
|
|
sudo yunohost app setting spip skipped_uris -v "/"
|
|
sudo yunohost app ssowatconf |