Hi all, here is a patch for radicale 0.10 - version bump, - change defaults in radicale/config.py and make it reflect /etc/radicale/config content - move right management file from /etc/config/radicale/ to /etc/radicale/ - I also took the liberty to change logging level so we can have a readable log file by default.
caveats: - default htpasswd_encryption is set to bcrypt, unfortunately security/py-bcrypt doesn't seem to handle $2b ( $2a is ok) - it was mentioned, in ports@, a SIGHUP support but radicale doesn't reload its configuration file. tested on loogson. hope it helps, and maybe fits. Samir Saada
Index: Makefile =================================================================== RCS file: /cvs/ports/productivity/radicale/Makefile,v retrieving revision 1.24 diff -u -p -r1.24 Makefile --- Makefile 2 Apr 2015 14:21:16 -0000 1.24 +++ Makefile 7 Sep 2015 21:42:06 -0000 @@ -2,7 +2,7 @@ COMMENT = simple CalDAV calendar server -MODPY_EGG_VERSION = 0.9 +MODPY_EGG_VERSION = 0.10 DISTNAME = Radicale-${MODPY_EGG_VERSION} PKGNAME = ${DISTNAME:L} CATEGORIES = productivity net Index: distinfo =================================================================== RCS file: /cvs/ports/productivity/radicale/distinfo,v retrieving revision 1.10 diff -u -p -r1.10 distinfo --- distinfo 15 Dec 2014 13:27:13 -0000 1.10 +++ distinfo 7 Sep 2015 21:42:06 -0000 @@ -1,2 +1,2 @@ -SHA256 (Radicale-0.9.tar.gz) = d7+BP9JvDTWcGnt7zOm4QrRQPFUWmJpKCk9kjimeQfc= -SIZE (Radicale-0.9.tar.gz) = 42100 +SHA256 (Radicale-0.10.tar.gz) = DGUi9XUWhfwVlSTtes7oEcy5pYLbKttru02pnOAQPWQ= +SIZE (Radicale-0.10.tar.gz) = 43051 Index: patches/patch-config =================================================================== RCS file: /cvs/ports/productivity/radicale/patches/patch-config,v retrieving revision 1.8 diff -u -p -r1.8 patch-config --- patches/patch-config 15 Dec 2014 13:27:13 -0000 1.8 +++ patches/patch-config 7 Sep 2015 21:42:06 -0000 @@ -1,56 +1,67 @@ $OpenBSD: patch-config,v 1.8 2014/12/15 13:27:13 ian Exp $ ---- config.orig Wed Aug 6 13:29:21 2014 -+++ config Sun Nov 16 18:55:14 2014 -@@ -23,9 +23,9 @@ pid = - # SSL flag, enable HTTPS protocol - ssl = False +--- config.orig Mon Nov 10 10:38:46 2014 ++++ config Mon Sep 7 22:48:56 2015 +@@ -3,7 +3,7 @@ + + # Config file for Radicale - A simple calendar server + # +-# Place it into /etc/radicale/config (global) ++# Place it into ${SYSCONFDIR}/radicale/config (global) + # or ~/.config/radicale/config (user) + # + # The current values are the default ones +@@ -28,10 +28,10 @@ + #ssl = False + # SSL certificate path --certificate = /etc/apache2/ssl/server.crt -+certificate = ${SYSCONFDIR}/radicale/server.crt +-#certificate = /etc/apache2/ssl/server.crt ++#certificate = ${SYSCONFDIR}/radicale/server.crt + # SSL private key --key = /etc/apache2/ssl/server.key -+key = ${SYSCONFDIR}/radicale/private/server.key +-#key = /etc/apache2/ssl/server.key ++#key = ${SYSCONFDIR}/radicale/private/server.key + # SSL Protocol used. See python's ssl module for available values - protocol = PROTOCOL_SSLv23 - # Ciphers available. See python's ssl module for available ciphers -@@ -56,10 +56,10 @@ type = None - custom_handler = + #protocol = PROTOCOL_SSLv23 +@@ -80,11 +80,11 @@ + #custom_handler = # Htpasswd filename --htpasswd_filename = /etc/radicale/users -+htpasswd_filename = ${SYSCONFDIR}/radicale/users +-#htpasswd_filename = /etc/radicale/users ++#htpasswd_filename = ${SYSCONFDIR}/radicale/users + # Htpasswd encryption method --# Value: plain | sha1 | crypt --htpasswd_encryption = crypt -+# Value: plain | sha1 | crypt | bcrypt -+htpasswd_encryption = bcrypt +-# Value: plain | sha1 | ssha | crypt +-#htpasswd_encryption = crypt ++# Value: plain | sha1 | ssha | bcrypt ++#htpasswd_encryption = bcrypt # LDAP server URL, with protocol and port - ldap_url = ldap://localhost:389/ -@@ -113,7 +113,7 @@ type = None - custom_handler = + #ldap_url = ldap://localhost:389/ +@@ -146,7 +146,7 @@ + #custom_handler = # File for rights management from_file --file = ~/.config/radicale/rights -+file = ${SYSCONFDIR}/config/radicale/rights +-#file = ~/.config/radicale/rights ++#file = ${SYSCONFDIR}/radicale/rights [storage] -@@ -125,7 +125,7 @@ type = filesystem - custom_handler = +@@ -163,7 +163,7 @@ + #custom_handler = # Folder for storing local collections, created if not present --filesystem_folder = ~/.config/radicale/collections -+filesystem_folder = /var/db/radicale/calendars +-#filesystem_folder = ~/.config/radicale/collections ++#filesystem_folder = /var/db/radicale/collections # Database URL for SQLAlchemy # dialect+driver://user:password@host/dbname[?key=value..] -@@ -139,7 +139,7 @@ database_url = +@@ -178,7 +178,7 @@ # 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 = ${SYSCONFDIR}/radicale/logging +-#config = /etc/radicale/logging ++#config = ${SYSCONFDIR}/radicale/logging # Set the default logging level to debug - debug = False + #debug = False # Store all environment variables (including those set in the shell) Index: patches/patch-logging =================================================================== RCS file: patches/patch-logging diff -N patches/patch-logging --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-logging 7 Sep 2015 21:42:06 -0000 @@ -0,0 +1,19 @@ +$OpenBSD$ +--- logging.orig Sun Aug 3 15:51:47 2014 ++++ logging Mon Sep 7 23:41:09 2015 +@@ -38,13 +38,14 @@ handlers = console,file + [handler_console] + # Console handler + class = StreamHandler +-level = INFO ++level = DEBUG + args = (sys.stdout,) + formatter = simple + + [handler_file] + # File handler + class = FileHandler ++level = INFO + args = ('/var/log/radicale',) + formatter = full + Index: patches/patch-radicale_auth_htpasswd_py =================================================================== RCS file: /cvs/ports/productivity/radicale/patches/patch-radicale_auth_htpasswd_py,v retrieving revision 1.2 diff -u -p -r1.2 patch-radicale_auth_htpasswd_py --- patches/patch-radicale_auth_htpasswd_py 15 Dec 2014 13:27:13 -0000 1.2 +++ patches/patch-radicale_auth_htpasswd_py 7 Sep 2015 21:42:06 -0000 @@ -3,8 +3,8 @@ $OpenBSD: patch-radicale_auth_htpasswd_p bcrypt support, based on http://evilshit.wordpress.com/2013/11/19/how-to-install-a-caldav-and-carddav-server-using-radicale/#bcrypt ---- radicale/auth/htpasswd.py.orig Sun Aug 3 17:51:47 2014 -+++ radicale/auth/htpasswd.py Sun Nov 16 19:01:49 2014 +--- radicale/auth/htpasswd.py.orig Mon Nov 10 10:38:46 2014 ++++ radicale/auth/htpasswd.py Sun Sep 6 11:41:01 2015 @@ -30,6 +30,7 @@ supported, but md5 is not (see ``htpasswd`` man page t import base64 import hashlib @@ -13,9 +13,9 @@ http://evilshit.wordpress.com/2013/11/19 from .. import config -@@ -59,11 +60,21 @@ def _sha1(hash_value, password): - return sha1.digest() == base64.b64decode(hash_value) - +@@ -69,11 +70,21 @@ def _ssha(hash_salt_value, password): + sha1.update(salt_value) + return sha1.digest() == hash_value +def _bcrypt(hash_value, password): + """Check if ``hash_value`` and ``password`` match using bcrypt method.""" Index: patches/patch-radicale_config_py =================================================================== RCS file: /cvs/ports/productivity/radicale/patches/patch-radicale_config_py,v retrieving revision 1.8 diff -u -p -r1.8 patch-radicale_config_py --- patches/patch-radicale_config_py 15 Dec 2014 13:27:13 -0000 1.8 +++ patches/patch-radicale_config_py 7 Sep 2015 21:42:06 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-radicale_config_py,v 1.8 2014/12/15 13:27:13 ian Exp $ ---- radicale/config.py.orig Wed Aug 6 13:23:29 2014 -+++ radicale/config.py Sun Nov 16 18:58:10 2014 +--- radicale/config.py.orig Tue Oct 21 13:03:32 2014 ++++ radicale/config.py Mon Sep 7 22:48:01 2015 @@ -43,8 +43,8 @@ INITIAL_CONFIG = { "daemon": "False", "pid": "", @@ -12,22 +12,29 @@ $OpenBSD: patch-radicale_config_py,v 1.8 "protocol": "PROTOCOL_SSLv23", "ciphers": "", "dns_lookup": "True", -@@ -57,7 +57,7 @@ INITIAL_CONFIG = { +@@ -60,8 +60,8 @@ INITIAL_CONFIG = { "auth": { "type": "None", "custom_handler": "", - "htpasswd_filename": "/etc/radicale/users", +- "htpasswd_encryption": "crypt", + "htpasswd_filename": "${SYSCONFDIR}/radicale/users", - "htpasswd_encryption": "crypt", ++ "htpasswd_encryption": "bcrypt", "imap_hostname": "localhost", "imap_port": "143", -@@ -83,11 +83,10 @@ INITIAL_CONFIG = { + "imap_ssl": "False", +@@ -82,15 +82,14 @@ INITIAL_CONFIG = { + "rights": { + "type": "None", + "custom_handler": "", +- "file": "~/.config/radicale/rights"}, ++ "file": "${SYSCONFDIR}/radicale/rights"}, "storage": { "type": "filesystem", "custom_handler": "", - "filesystem_folder": os.path.expanduser( - "~/.config/radicale/collections"), -+ "filesystem_folder": "/var/db/radicale/calendars", ++ "filesystem_folder": "/var/db/radicale/collections", "database_url": ""}, "logging": { - "config": "/etc/radicale/logging", @@ -35,7 +42,7 @@ $OpenBSD: patch-radicale_config_py,v 1.8 "debug": "False", "full_environment": "False"}} -@@ -99,7 +98,7 @@ for section, values in INITIAL_CONFIG.items(): +@@ -102,7 +101,7 @@ for section, values in INITIAL_CONFIG.items(): for key, value in values.items(): _CONFIG_PARSER.set(section, key, value)