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

install ok

This commit is contained in:
root 2013-11-30 14:31:51 +00:00
parent 9c1e9babf3
commit 5501110616
7 changed files with 100 additions and 30 deletions

View file

@ -54,7 +54,7 @@ ldap_attribute = uid
# placed as X in a query of the form (&(...)X)
# example: (objectCategory=Person)(objectClass=User)(memberOf=cn=calenderusers,ou=users,dc=example,dc=org)
# leave empty if no additional filter is needed
ldap_filter = objectClass=inetOrgPerson
ldap_filter =
# LDAP dn for initial login, used if LDAP server does not allow anonymous searches
# Leave empty if searches are anonymous
ldap_binddn =
@ -94,16 +94,16 @@ file = ~/.config/radicale/rights
[storage]
# Storage backend
# Value: filesystem | database
type = database
type = filesystem
# Folder for storing local collections, created if not present
filesystem_folder = ~/.config/radicale/collections
filesystem_folder = /var/www/radicale/collections
# Database URL for SQLAlchemy
# dialect+driver://user:password@host/dbname[?key=value..]
# For example: sqlite:///var/db/radicale.db, postgresql://user:password@localhost/radicale
# See http://docs.sqlalchemy.org/en/rel_0_8/core/engines.html#sqlalchemy.create_engine
database_url = sqlite:///var/lib/radicale/radicale.db
database_url = mysql://root:CL49RGRdwh@localhost/radicale
[logging]

View file

@ -2,7 +2,7 @@
[loggers]
# Loggers names, main configuration slots
keys = root
keys = www-data
[handlers]
# Logging handlers, defining logging output methods

View file

@ -1,8 +1,26 @@
location PATHTOCHANGE {
alias ALIASTOCHANGE
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
include uwsgi_params;
uwsgi_pass unix:///tmp/uwsgi.sock;
try_files $uri @radicale;
}
location @radicale {
uwsgi_pass unix:///tmp/radicale.sock;
include uwsgi_params;
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;
}

9
conf/radicale.ini Normal file
View file

@ -0,0 +1,9 @@
[uwsgi]
socket=/tmp/radicale.sock
plugins=python
uid=www-data
gid=www-data
virtualenv=/usr/local/radicale
chdir=/var/www/radicale
wsgi-file=/var/www/radicale/radicale.wsgi
master=True

29
conf/radicale.wsgi Executable file
View file

@ -0,0 +1,29 @@
#!/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 <http://www.gnu.org/licenses/>.
"""
Radicale WSGI file (mod_wsgi and uWSGI compliant).
"""
import radicale
radicale.log.start()
application = radicale.Application()

View file

@ -16,7 +16,7 @@
{
"name": "domain",
"ask": {
"en": "Choose a domain for Roundcube"
"en": "Choose a domain for Radicale"
},
"example": "domain.org"
},

View file

@ -5,13 +5,14 @@ domain=$1
path=$2
# Check domain/path availability
# yunohost app checkurl $domain$path -a radicale
#if [[ ! $? -eq 0 ]]; then
# exit 1
#fi
yunohost app checkurl $domain$path -a radicale
sudo yunohost app setting radicale skipped_uris -v "$path"
if [[ ! $? -eq 0 ]]; then
exit 1
fi
# Check depends installation
for i in python-pip python-virtualenv python-ldap
for i in python-pip python-virtualenv python-dev libldap2-dev libsasl2-dev libssl-dev uwsgi uwsgi-plugin-python
do
dpkg -l | grep $i > /dev/null 2>&1
if [ $? = 1 ];
@ -22,25 +23,38 @@ done
# Init virtualenv
sudo virtualenv /usr/local/radicale
sudo bash -c "source /usr/local/radicale/bin/activate && pip install radicale flup"
sudo bash -c "source /usr/local/radicale/bin/activate && pip install radicale python-ldap"
deactivate
#Configuration Radicale
if [ ! -d /etc/radicale ];
then
mkdir /etc/radicale
sudo mkdir /etc/radicale
fi
cp ../conf/{radicale,logging) /etc/radicale/
sudo cp ../conf/config /etc/radicale/
sudo cp ../conf/logging /etc/radicale/
# Copy files to the right place
final_path=/var/www/radicale
sudo mkdir -p $final_path/collections
sudo cp ../conf/radicale.wsgi $final_path
# Set permissions to radicale directory
# chown -R www-data: $final_path
#
sudo chown -R www-data. $final_path
sudo touch /var/log/radicale
sudo chgrp /var/log/radicale
sudo chmod g+w /var/log/radicale
# Copy uwsgi config
cp ../conf/radicale.ini /etc/uwsgi/apps-available/
ln -s /etc/uwsgi/apps-available/radicale.ini /etc/uwsgi/apps-enabled/
## 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
# cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/radicale.conf
#
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/radicale.conf
## Reload Nginx and regenerate SSOwat conf
# service nginx reload
# yunohost app ssowatconf
service nginx reload
service uwsgi reload
yunohost app setting radicale skipped_uris -v "$path"
yunohost app ssowatconf