diff --git a/conf/radicale.fcgi b/conf/radicale.fcgi new file mode 100644 index 0000000..6f493da --- /dev/null +++ b/conf/radicale.fcgi @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# This file is part of Radicale Server - Calendar Server +# Copyright © 2011-2013 Guillaume Ayoub +# +# This library is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Radicale. If not, see . + +""" +Radicale FastCGI Example. + +Launch a Radicale FastCGI server according to configuration. + +""" + +from flup.server.fcgi import WSGIServer +import radicale + + +radicale.log.start() +radicale.log.LOGGER.info("Starting Radicale FastCGI server") +WSGIServer(radicale.Application()).run() +radicale.log.LOGGER.info("Stopping Radicale FastCGI server") diff --git a/conf/radicale.wsgi b/conf/radicale.wsgi deleted file mode 100644 index 88f30cb..0000000 --- a/conf/radicale.wsgi +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python -import radicale -radicale.log.start() -application = radicale.Application() diff --git a/conf/uwsgi_params b/conf/uwsgi_params deleted file mode 100644 index 2a45908..0000000 --- a/conf/uwsgi_params +++ /dev/null @@ -1,15 +0,0 @@ -uwsgi_param QUERY_STRING $query_string; -uwsgi_param REQUEST_METHOD $request_method; -uwsgi_param CONTENT_TYPE $content_type; -uwsgi_param CONTENT_LENGTH $content_length; - -uwsgi_param REQUEST_URI $request_uri; -uwsgi_param PATH_INFO $document_uri; -uwsgi_param DOCUMENT_ROOT $document_root; -uwsgi_param SERVER_PROTOCOL $server_protocol; -uwsgi_param HTTPS $https if_not_empty; - -uwsgi_param REMOTE_ADDR $remote_addr; -uwsgi_param REMOTE_PORT $remote_port; -uwsgi_param SERVER_PORT $server_port; -uwsgi_param SERVER_NAME $server_name; diff --git a/scripts/install b/scripts/install index eaa7a5f..73cdf3e 100755 --- a/scripts/install +++ b/scripts/install @@ -5,44 +5,42 @@ domain=$1 path=$2 # Check domain/path availability -#sudo yunohost app checkurl $domain$path -a radicale +# yunohost app checkurl $domain$path -a radicale #if [[ ! $? -eq 0 ]]; then # exit 1 #fi -# Check pip installation -dpkg -l | grep python-pip > /dev/null 2>&1 -if [ $? = 1 ]; -then - sudo apt-get install python-pip -y -fi - -dpkg -l | grep python-virtualenv > /dev/null 2>&1 -if [ $? = 1 ]; -then - sudo apt-get install python-virtualenv -y -fi +# Check depends installation +for i in python-pip python-virtualenv python-ldap +do + dpkg -l | grep $i > /dev/null 2>&1 + if [ $? = 1 ]; + then + sudo apt-get install $i -y + fi +done # Init virtualenv sudo virtualenv /usr/local/radicale -source /usr/local/radicale/bin/activate +sudo bash -c "source /usr/local/radicale/bin/activate && pip install radicale flup" -# Install uwsgi -sudo pip install uwsgi==1.9.20 - -# Install radiace -sudo pip install radicale==0.8 +#Configuration Radicale +if [ ! -d /etc/radicale ]; +then + mkdir /etc/radicale +fi +cp ../conf/{radicale,logging) /etc/radicale/ # Set permissions to radicale directory -#sudo chown -R www-data: $final_path +# 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/radicale.conf +# cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/radicale.conf # ## Reload Nginx and regenerate SSOwat conf -#sudo service nginx reload -#sudo yunohost app ssowatconf +# service nginx reload +# yunohost app ssowatconf