1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/radicale_ynh.git synced 2024-09-03 20:16:14 +02:00

Installation racine

This commit is contained in:
Maniack Crudelis 2016-06-22 14:11:25 +02:00
parent 7efd1bde61
commit 34ce2a4153
6 changed files with 22 additions and 3 deletions

View file

@ -25,7 +25,7 @@ location @radicale {
uwsgi_param SERVER_NAME $server_name; uwsgi_param SERVER_NAME $server_name;
} }
#INFCLOUD#location __PATH__/infcloud { #INFCLOUD#location __PATH_NO_ROOT__/infcloud {
#INFCLOUD# alias __FINALPATH__/infcloud; #INFCLOUD# alias __FINALPATH__/infcloud;
#INFCLOUD# if ($scheme = http) { #INFCLOUD# if ($scheme = http) {
#INFCLOUD# rewrite ^ https://$server_name$request_uri? permanent; #INFCLOUD# rewrite ^ https://$server_name$request_uri? permanent;

View file

@ -57,7 +57,7 @@ fi
# Enregistre les infos dans la config YunoHost # Enregistre les infos dans la config YunoHost
sudo yunohost app setting $app domain -v $domain sudo yunohost app setting $app domain -v $domain
sudo yunohost app setting $app path -v $path sudo yunohost app setting $app path -v $path/
sudo yunohost app setting $app admin -v $admin sudo yunohost app setting $app admin -v $admin
sudo yunohost app setting $app infcloud -v $infcloud sudo yunohost app setting $app infcloud -v $infcloud
@ -86,7 +86,10 @@ sudo mv "$final_path/regex.py" /opt/yunohost/$app/lib/python*/site-packages/radi
sudo rm /opt/yunohost/$app/lib/python*/site-packages/radicale/rights/regex.pyc sudo rm /opt/yunohost/$app/lib/python*/site-packages/radicale/rights/regex.pyc
if [ "$infcloud" = "1" ] if [ "$infcloud" = "1" ]
then #Instal InfCloud then #Instal InfCloud
final_path_backup=$final_path # Sauvegarde le contenu de $final_path
final_path=$final_path/infcloud # Change final_path pour l'installation de infcloud
SETUP_SOURCE "infcloud.zip" # Télécharge la source, décompresse et copie dans $final_path SETUP_SOURCE "infcloud.zip" # Télécharge la source, décompresse et copie dans $final_path
final_path=$final_path_backup # Restaure le contenu de $final_path
fi fi
#Configuration Radicale #Configuration Radicale
@ -162,6 +165,12 @@ sudo ln -s /etc/uwsgi/apps-available/radicale.ini /etc/uwsgi/apps-enabled/
# Modify Nginx configuration file and copy it to Nginx conf directory # Modify Nginx configuration file and copy it to Nginx conf directory
sudo sed -i "s@__PATH__@$path@g" ../conf/nginx.conf sudo sed -i "s@__PATH__@$path@g" ../conf/nginx.conf
if [ "$path" = "/" ]
then
sudo sed -i "s@__PATH_NO_ROOT__@@g" ../conf/nginx.conf
else
sudo sed -i "s@__PATH_NO_ROOT__@$path@g" ../conf/nginx.conf
fi
sudo sed -i "s@__FINALPATH__@$final_path@g" ../conf/nginx.conf sudo sed -i "s@__FINALPATH__@$final_path@g" ../conf/nginx.conf
sudo sed -i "s@__NAMETOCHANGE__@$app@g" ../conf/nginx.conf sudo sed -i "s@__NAMETOCHANGE__@$app@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

View file

@ -31,7 +31,7 @@ if [ -e "/etc/uwsgi/apps-available/radicale.ini" ]; then
echo "Delete uwsgi config" echo "Delete uwsgi config"
sudo rm "/etc/uwsgi/apps-available/radicale.ini" sudo rm "/etc/uwsgi/apps-available/radicale.ini"
fi fi
if [ -e "/etc/uwsgi/apps-enabled/radicale.ini" ]; then if [ -h "/etc/uwsgi/apps-enabled/radicale.ini" ]; then
echo "Delete uwsgi config" echo "Delete uwsgi config"
sudo rm "/etc/uwsgi/apps-enabled/radicale.ini" sudo rm "/etc/uwsgi/apps-enabled/radicale.ini"
fi fi

View file

@ -14,6 +14,7 @@ path=$(sudo yunohost app setting $app path)
admin=$(sudo yunohost app setting $app admin) admin=$(sudo yunohost app setting $app admin)
infcloud=$(sudo yunohost app setting $app infcloud) infcloud=$(sudo yunohost app setting $app infcloud)
language=$(sudo yunohost app setting $app language) language=$(sudo yunohost app setting $app language)
final_path=$(sudo yunohost app setting $app final_path)
CHECK_PATH # Vérifie et corrige la syntaxe du path. CHECK_PATH # Vérifie et corrige la syntaxe du path.
@ -49,7 +50,10 @@ sudo mv "$final_path/regex.py" /opt/yunohost/$app/lib/python*/site-packages/radi
sudo rm /opt/yunohost/$app/lib/python*/site-packages/radicale/rights/regex.pyc sudo rm /opt/yunohost/$app/lib/python*/site-packages/radicale/rights/regex.pyc
if [ "$infcloud" = "1" ] if [ "$infcloud" = "1" ]
then #Instal InfCloud then #Instal InfCloud
final_path_backup=$final_path # Sauvegarde le contenu de $final_path
final_path=$final_path/infcloud # Change final_path pour l'installation de infcloud
SETUP_SOURCE "infcloud.zip" # Télécharge la source, décompresse et copie dans $final_path SETUP_SOURCE "infcloud.zip" # Télécharge la source, décompresse et copie dans $final_path
final_path=$final_path_backup # Restaure le contenu de $final_path
fi fi
# Radicale configuration # Radicale configuration
@ -112,6 +116,12 @@ sudo cp ../conf/radicale.ini /etc/uwsgi/apps-available/
# Update Nginx configuration file # Update Nginx configuration file
sudo sed -i "s@__PATH__@$path@g" ../conf/nginx.conf sudo sed -i "s@__PATH__@$path@g" ../conf/nginx.conf
if [ "$path" = "/" ]
then
sudo sed -i "s@__PATH_NO_ROOT__@@g" ../conf/nginx.conf
else
sudo sed -i "s@__PATH_NO_ROOT__@$path@g" ../conf/nginx.conf
fi
sudo sed -i "s@__FINALPATH__@$final_path@g" ../conf/nginx.conf sudo sed -i "s@__FINALPATH__@$final_path@g" ../conf/nginx.conf
sudo sed -i "s@__NAMETOCHANGE__@$app@g" ../conf/nginx.conf sudo sed -i "s@__NAMETOCHANGE__@$app@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