Setup Radicale on OpenBSD

— 335 words — 2 min

#openbsd 


Radicale lets you synchronize your calendar, contacts and tasks between multiple devices that support CalDAV and CardDAV. It’s written in Python.

On OpenBSD you can install the radicale with a simple

pkg_add radicale

Adjust the configuration file in /etc/radicale/config.

[server]
hosts = 127.0.0.1:5232
[auth]
type = htpasswd
htpasswd_filename = /etc/radicale/users
htpasswd_encryption = bcrypt

Generate a password for user1 (run as root).

htpasswd /etc/radicale/users user1

Adjust permissions so that user of the _radicale group can read the file containing the users.

cd /etc/radicale
chown root:_radicale users
chmod 640 users

I’m using nginx here to proxy the relevant requests to radicale. You can also configure radicale to listen on 0.0.0.0 and configure a certificates and key for TLS; or configure it to listen on an internal network address when you’re already running your own VPN.

Adjust the nginx configuration to proxy requests to the radicale service in /etc/nginx/nginx.conf.

server {
    listen 443 ssl;
    [...]

    location /radicale/ {
        proxy_pass        http://localhost:5232/; # The / is important!
        proxy_set_header  X-Script-Name /radicale;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass_header Authorization;
    }
}

For an Apache configuration or managing radicale users with the reverse proxy take a look at the official documentation.

Replacing httpd with Nginx🔗

If you’re replacing httpd on OpenBSD with nginx, you might want to adjust the logrotate configuration, too. Adjust the configuration in /etc/newsyslog.conf.

Replace these two lines

/var/www/logs/access.log       644  4     *    $W0   Z "pkill -USR1 -u root -U root -x httpd"
/var/www/logs/error.log        644  7     250  *     Z "pkill -USR1 -u root -U root -x httpd"

with

/var/www/logs/access.log        644  4     *    $W0   Z /var/run/nginx.pid SIGUSR1
/var/www/logs/error.log         644  7     250  *     Z /var/run/nginx.pid SIGUSR1

If you use nginx you should—definitely—read the pitfalls and common mistakes page.


Articles from blogs I follow around the net

Status update, June 2024

Hi all! This status update will be shorter than usual because I had a lot less free time for my open-source projects than usual this month. Indeed, I recently joined SNCF Réseau (the company responsible for the French railway infrastructure) to work on OSRD, …

via emersion June 19, 2024

Whose CIDR is it anyway?

A look at CIDR block ownership from a RIR-, country-, and organization level. Originally presented at RIPE88.

via Signs of Triviality June 12, 2024

How and why to make a /now page on your site

Background I used to wonder what my friend Benny Lewis was doing. He has a website and social media accounts, but neither gave an overview of what he’s doing now. Then I realized some people might wonder the same about me. So in 2015, I made a /now page on my…

via Derek Sivers blog May 18, 2024

Generated by openring