Difference between revisions of "Radicale (carddav/caldav)"

From SME Server
Jump to navigationJump to search
Line 1: Line 1:
===Introduction===  
+
{{Languages}}
The Radicale Project is a complete calendar and contact storing and manipulating solution. It can store multiple calendars and multiple address books.
+
== Foo for SME Server ==
  
Calendar and contact manipulation is available from both local and distant accesses, possibly limited through authentication policies.  
+
=== Maintainer ===
This HOWTO describes the installation procedure for installing Radicale around the Roundcube installation on an SME installation.  
+
[mailto:stephdl@de-labrusse.fr stephdl] Stéphane de Labrusse AKA [[User:stephdl|Stephdl]]<br />
Before installation
+
kudo to JM LE CORGUILLE, for the idea and the code.
On sme8, you need to install python26
+
=== Version ===
yum --enablerepo=ces-standard,epel --nogpgcheck install python26
+
{{ #smeversion: smeserver-radicale }}
Not need in sme9, python-2.6 is installed. But you have to do:
 
ln -s /usr/bin/python2.6 /usr/bin/python26
 
in order to use same init script as for sme8
 
  
===Download & Install Radicale===  
+
=== Description ===
{{Tip box| radicale is 'pip' compatible, that should be used instead of downloading each time a tar.gz. See http://radicale.org/download/}}
+
This contribution for smeserver adds a caldav and a carddav server, the collection is located at /home/e-smith/files.radicale.
mkdir -p /opt/roundcube/
+
Radicale is a caldav/carddav server written in python, smeserver-radicale use pip to install and upgrade it. http://radicale.org/
cd /opt/roundcube/
 
wget –no-check-certificate http://pypi.python.org/packages/source/R/Radicale/Radicale-1.0.1.tar.gz
 
tar xvfz Radicale-1.0.1.tar.gz
 
rm -f Radicale-1.0.1.tar.gz
 
mv Radicale-1.0.1 radicale
 
mkdir -p /home/e-smith/files/.radicale/collections
 
mkdir -p /etc/radicale
 
mkdir -p /var/run/radicale
 
  
Next, you need to configure how you want the logs:
+
=== Requirements ===
touch /etc/radicale/logging
+
You need to enable the [[epel]] and the [[stephdl]] repositories
cat <<EOF > /etc/radicale/logging
 
[loggers]
 
keys=root
 
level=NOTSET
 
 
[logger_root]
 
handlers=file
 
 
[formatters]
 
keys=simple
 
 
[formatter_simple]
 
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
 
 
[handlers]
 
keys=file
 
 
[handler_file]
 
class=handlers.TimedRotatingFileHandler
 
interval=midnight
 
backupCount=5
 
formatter=simple
 
level=ERROR
 
args=('/var/log/radicale.log',)
 
EOF
 
 
Set Radicale to start on system startup
 
To make Radicale start automagically, create
 
vim /etc/rc.d/init.d/radicaled
 
with the following content:
 
#!/bin/sh
 
#
 
# chkconfig: - 88 10
 
# description: Start/Stop the RADICALE server daemon
 
#
 
#    This program 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 2 of the License, or
 
#    (at your option) any later version.
 
#
 
#    This program 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 this program; if not, write to the Free Software
 
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
#
 
#    Copyright (C) 2015 JM LE CORGUILLE
 
#
 
 
# Source function library.
 
. /etc/rc.d/init.d/functions
 
 
PYTHON26=/usr/bin/python26
 
RADICALE=/opt/roundcube/radicale/radicale.py
 
LOCKF=/var/lock/radicale                        ##/var/run/radicale/radicale.pid
 
CONFIG=/etc/radicale/config
 
 
[ -f $PYTHON26 ] || exit 0
 
[ -f $RADICALE ] || exit 0
 
[ -f $CONFIG ] || exit 0
 
 
RETVAL=0
 
 
case "$1" in
 
  start)
 
        echo -n $"Starting RADICALE server: "
 
        cd /opt/roundcube/radicale/
 
        $PYTHON26 $RADICALE -C $CONFIG
 
        RETVAL=$?
 
        echo
 
        [ $RETVAL -eq 0 ] && touch $LOCKF &&
 
            ln -s /var/run/radicale/radicale.pid /var/run/radicale.pid 2>/dev/null
 
        ;;
 
  stop)
 
        echo -n $"Stopping RADICALE server: "
 
        killproc $PYTHON26 $RADICALE
 
        RETVAL=$?
 
        echo
 
        [ $RETVAL -eq 0 ] && rm -f $LOCKF
 
        ;;
 
  status)
 
        status radicale
 
        RETVAL=$?
 
        ;;
 
  restart)
 
        $0 stop
 
        sleep 3
 
        $0 start
 
        RETVAL=$?
 
        ;;
 
  *)
 
        echo $"Usage: $0 {start|stop|status|restart}"
 
        exit 1
 
esac
 
 
exit $RETVAL
 
  
complete it with:
+
=== Installation ===
chmod 755 /etc/rc.d/init.d/radicaled
+
* ONLY for sme9
chkconfig --add radicaled
+
This contrib is currently held in the [[epel]] and the [[stephdl]] repository, so the following commands will install the contribs on your smeserver.
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S88radicaled
 
  
===Setup Radicale configuration===
+
  yum --enablerepo=epel,stephdl install smeserver-radicale
  mkdir -p /etc/e-smith/templates-custom/etc/radicale/config
 
  
Create
+
You will then need to activate the database changes etc.
vim /etc/e-smith/templates-custom/etc/radicale/config/00setup
+
The 'official' way is to perform
  
with the following content:
+
  signal-event radicale-update
  # -*- mode: conf -*-
+
or a much more long event
# vim:ft=cfg
+
  signal-event console-save
 
# Config file for Radicale - A simple calendar server
 
#
 
# Place it into /etc/radicale/config (global)
 
# or ~/.config/radicale/config (user)
 
#
 
# The current values are the default ones
 
 
 
[server]
 
 
# CalDAV server hostnames separated by a comma
 
  # IPv4 syntax: address:port
 
# IPv6 syntax: [address]:port
 
# For example: 0.0.0.0:9999, [::]:9999
 
# IPv6 adresses are configured to only allow IPv6 connections
 
#hosts = 0.0.0.0:5232
 
  
Create
+
Each time you launch this event and 'console-save' you will upgrade radicale and renew the ssl certificate if it is removed of /home/e-smith/files/.radicale
vim /etc/e-smith/templates-custom/etc/radicale/config/10hosts
 
  
with the following content:
+
=== database===
  {
+
  # config show radicale
  my $rad_ports = $radicale{Port} || 5232;
+
radicale=service
  my $rad_ip = $LocalIP || 127.0.0.1;
+
    TCPPort=5232
  "hosts = $rad_ip:$rad_ports";
+
    access=public
}
+
    debug=False  #or True for debugging purpose (logs are in /var/log/radicale/radicale.log)
 +
    status=enabled
  
Create
+
after a change, do
  vim /etc/e-smith/templates-custom/etc/radicale/config/20daemon
+
  signal-event radicale-update
with the following content:
 
  
# Daemon flag
+
===Radicale Client Configuration===
#daemon = False
+
{{Note box|Keep in mind that there is no frontend, you must use a caldav or a carddav client}}
daemon = True
 
 
# File storing the PID in daemon mode
 
#pid =
 
pid = /var/run/radicale/radicale.pid
 
 
# SSL flag, enable HTTPS protocol
 
#ssl = False
 
ssl = True
 
  
# SSL certificate path
+
The URL for accessing the radicale server is:
#certificate = /etc/apache2/ssl/server.crt
 
  
Create
+
  https://<server_domain_name>:5232/'''USER'''/calendar.ics
  vim /etc/e-smith/templates-custom/etc/radicale/config/30crt
+
https://<server_domain_name>:5232/'''USER'''/addressbook.vcf
  
with the following content:
+
Where '''USER''' is the sme login for this user. You have no frontend, just a server, you can use lightning for caldav with thunderbird and the plugin sogo-connector for carddav.
{
 
  my $rad_name = $SystemName || "server";
 
  my $rad_domain = $DomainName;
 
  "certificate = /home/e-smith/ssl.crt/$rad_name.$rad_domain.crt";
 
}
 
  
Create
+
=== Uninstall ===
  vim /etc/e-smith/templates-custom/etc/radicale/config/40ssl
+
  yum remove smeserver-radicale
  
with the following content:  
+
=== Bugs ===
 +
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi bugzilla]
 +
and select the smeserver-radicale component or use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-radicale|title=this link}}.
  
# SSL private key
+
{{#bugzilla:columns=id,product,version,status,summary |sort=id|order=desc |component=smeserver-radicale|noresultsmessage="No open bugs found."}}
#key = /etc/apache2/ssl/server.key
 
  
Create
 
vim /etc/e-smith/templates-custom/etc/radicale/config/50key
 
  
with the following content:
+
[[Category: Contrib]]
{
 
  my $rad_name = $SystemName || "server";
 
  my $rad_domain = $DomainName;
 
  "key = /home/e-smith/ssl.key/$rad_name.$rad_domain.key";
 
}
 
 
 
Create
 
vim /etc/e-smith/templates-custom/etc/radicale/config/60fin
 
 
 
with the following content:
 
 
 
# SSL Protocol used. See python's ssl module for available values
 
#protocol = PROTOCOL_SSLv23
 
 
# Ciphers available. See python's ssl module for available ciphers
 
#ciphers =
 
 
# Reverse DNS to resolve client address in logs
 
#dns_lookup = True
 
dns_lookup = True
 
 
# Root URL of Radicale (starting and ending with a slash)
 
#base_prefix = /
 
 
# Possibility to allow URLs cleaned by a HTTP server, without the base_prefix
 
#can_skip_base_prefix = False
 
 
# Message displayed in the client when a password is needed
 
#realm = Radicale - Password Required
 
 
 
 
[encoding]
 
 
# Encoding for responding requests
 
#request = utf-8
 
 
# Encoding for storing local collections
 
#stock = utf-8
 
 
 
[well-known]
 
 
# Path where /.well-known/caldav/ is redirected
 
#caldav = '/%(user)s/caldav/'
 
 
# Path where /.well-known/carddav/ is redirected
 
#carddav = '/%(user)s/carddav/'
 
 
 
[auth]
 
 
# Authentication method
 
# Value: None | htpasswd | IMAP | LDAP | PAM | courier | http | remote_user | custom
 
#type = None
 
type = IMAP
 
 
# Custom authentication handler
 
# custom_handler =
 
 
# Htpasswd filename
 
#htpasswd_filename = /etc/radicale/users
 
 
# Htpasswd encryption method
 
# Value: plain | sha1 | ssha | crypt
 
#htpasswd_encryption = crypt
 
 
# LDAP server URL, with protocol and port
 
#ldap_url = ldap://localhost:389/
 
 
# LDAP base path
 
#ldap_base = ou=users,dc=example,dc=com
 
 
# LDAP login attribute
 
#ldap_attribute = uid
 
 
# LDAP filter string
 
# 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 =
 
 
# LDAP dn for initial login, used if LDAP server does not allow anonymous searches
 
# Leave empty if searches are anonymous
 
#ldap_binddn =
 
 
# LDAP password for initial login, used with ldap_binddn
 
#ldap_password =
 
 
# LDAP scope of the search
 
#ldap_scope = OneLevel
 
 
# IMAP Configuration
 
#imap_hostname = localhost
 
#imap_port = 143
 
#imap_ssl = False
 
imap_hostname = localhost
 
imap_port = 993
 
imap_ssl = True
 
 
# PAM group user should be member of
 
#pam_group_membership =
 
 
# Path to the Courier Authdaemon socket
 
#courier_socket =
 
 
# HTTP authentication request URL endpoint
 
#http_url =
 
# POST parameter to use for username
 
#http_user_parameter =
 
# POST parameter to use for password
 
#http_password_parameter =
 
 
 
[git]
 
 
# Git default options
 
#committer = Radicale <radicale@example.com>
 
 
 
[rights]
 
 
# Rights backend
 
# Value: None | authenticated | owner_only | owner_write | from_file | custom
 
#type = None
 
type = owner_write
 
 
# Custom rights handler
 
# custom_handler =
 
 
# File for rights management from_file
 
#file = ~/.config/radicale/rights
 
 
 
[storage]
 
 
# Storage backend
 
# -------
 
# WARNING: ONLY "filesystem" IS DOCUMENTED AND TESTED,
 
#          OTHER BACKENDS ARE NOT READY FOR PRODUCTION.
 
# -------
 
# Value: filesystem | multifilesystem | database | custom
 
#type = filesystem
 
 
# Custom storage handler
 
#custom_handler =
 
 
# Folder for storing local collections, created if not present
 
#filesystem_folder = ~/.config/radicale/collections
 
filesystem_folder = /home/e-smith/files/.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 =
 
 
 
[logging]
 
 
# Logging configuration file
 
# If no config is given, simple information is printed on the standard output
 
# For more information about the syntax of the configuration file, see:
 
# http://docs.python.org/library/logging.config.html
 
#config = /etc/radicale/logging
 
config = /etc/radicale/logging
 
# Set the default logging level to debug
 
#debug = False
 
# Store all environment variables (including those set in the shell)
 
#full_environment = False
 
 
 
[headers]
 
 
# Additional HTTP headers
 
#Access-Control-Allow-Origin = *#imap_hostname = localhost
 
 
 
db configuration set radicale service Port 5232 status enabled
 
expand-template /etc/radicale/config
 
 
/etc/rc.d/init.d/radicaled start
 
 
 
===Radicale Client Configuration===
 
The URL for accessing the radicale server is:
 
  https://<server_domain_name>:5232/'''USER'''/calendar.ics
 
  https://<server_domain_name>:5232/'''USER'''/addressbook.vcf
 
Where '''USER''' is the sme-login for the user who manage the radicale session
 
 
 
===References===
 
radicale Documentation: http://radicale.org/ <br />
 
 
 
roundcube Documentation: http://wiki.contribs.org/RoundCube
 
 
 
[[Category:Howto]]
 

Revision as of 10:19, 18 October 2015


Foo for SME Server

Maintainer

stephdl Stéphane de Labrusse AKA Stephdl
kudo to JM LE CORGUILLE, for the idea and the code.

Version

Contrib 10:
smeserver-radicale
The latest version of smeserver-radicale is available in the SME repository, click on the version number(s) for more information.


Description

This contribution for smeserver adds a caldav and a carddav server, the collection is located at /home/e-smith/files.radicale. Radicale is a caldav/carddav server written in python, smeserver-radicale use pip to install and upgrade it. http://radicale.org/

Requirements

You need to enable the epel and the stephdl repositories

Installation

  • ONLY for sme9

This contrib is currently held in the epel and the stephdl repository, so the following commands will install the contribs on your smeserver.

yum --enablerepo=epel,stephdl install smeserver-radicale

You will then need to activate the database changes etc. The 'official' way is to perform

signal-event radicale-update

or a much more long event

signal-event console-save

Each time you launch this event and 'console-save' you will upgrade radicale and renew the ssl certificate if it is removed of /home/e-smith/files/.radicale

database

# config show radicale
radicale=service
   TCPPort=5232
   access=public
   debug=False   #or True for debugging purpose (logs are in /var/log/radicale/radicale.log)
   status=enabled

after a change, do

signal-event radicale-update

Radicale Client Configuration

Important.png Note:
Keep in mind that there is no frontend, you must use a caldav or a carddav client


The URL for accessing the radicale server is:

https://<server_domain_name>:5232/USER/calendar.ics
https://<server_domain_name>:5232/USER/addressbook.vcf

Where USER is the sme login for this user. You have no frontend, just a server, you can use lightning for caldav with thunderbird and the plugin sogo-connector for carddav.

Uninstall

yum remove smeserver-radicale

Bugs

Please raise bugs under the SME-Contribs section in bugzilla and select the smeserver-radicale component or use this link .

IDProductVersionStatusSummary (3 tasks)
12169SME Contribs10.0CONFIRMEDmake cert and key sync with LE when available
12168SME Contribs10.0CONFIRMEDif public make it listen on 0.0.0.0
12140SME Contribs10.0CONFIRMEDupgrade radicale to v3