1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/radicale_ynh.git synced 2024-09-03 20:16:14 +02:00
radicale_ynh/scripts/upgrade
2014-05-29 13:48:34 +02:00

47 lines
1.4 KiB
Bash

#!/bin/bash
# Check depends installation
sudo apt-get install -y python-pip python-virtualenv python-dev libldap2-dev libsasl2-dev libssl-dev uwsgi uwsgi-plugin-python
if [ -d /usr/local/radicale ];
then
sudo mkdir -p /opt/yunohost
sudo mv /usr/local/radicale /opt/yunohost/
fi
# Set permissions to searx directory
sudo useradd radicale -d /opt/yunohost/radicale
sudo chown radicale:radicale -R /opt/yunohost/radicale
# Upgrade pip packages
sudo bash -c "source /opt/yunohost/radicale/bin/activate && pip install radicale python-ldap --upgrade"
# Radicale configuration
sudo cp ../conf/config /etc/radicale/
sudo cp ../conf/logging /etc/radicale/
sudo sed -i "s@CHANGEPATH@$path@g" /etc/radicale/config
# Copy files to the right place
final_path=/var/www/radicale
sudo mkdir -p $final_path/collections
sudo cp ../conf/radicale.wsgi $final_path
# Copy uwsgi config
sudo cp ../conf/radicale.ini /etc/uwsgi/apps-available/
# Fix permission
sudo chmod 755 /etc/radicale/
sudo find /opt/yunohost/radicale/ -type d -exec chmod 2755 {} \;
sudo find /opt/yunohost/radicale/ -type f -exec chmod g+r,o+r {} \;
sudo chmod 644 /etc/radicale/*
sudo chown -R radicale $final_path
sudo touch /var/log/radicale
sudo chgrp radicale /var/log/radicale
sudo chmod g+w /var/log/radicale
sudo yunohost app setting radicale skipped_uris -v "/"
sudo yunohost app ssowatconf
sudo service uwsgi stop
sudo killall uwsgi
sudo service uwsgi start
sudo service nginx reload