Installing my PIM Server

dim. 18 décembre 2022

Package installation

Radicale is a free Python-based PIM server. We need first to have Python 3.5 (at least) and PIP installed:

$ sudo apt install python3
$ sudo apt install pi

Then we can install Radicale:

$ pip install --upgrade radicale

Server side

We will install Radicale as a service. So we need first to create a dedicated user:

sudo useradd --system --user-group --home-dir / --shell /sbin/nologin radicale

Then create the data directory and fix the rights accordingly and protect the content from illegal access:

sudo mkdir -p /var/lib/radicale/collections
sudo chown -R radicale:radicale /var/lib/radicale/collections
sudo chmod -R o= /var/lib/radicale/collections

Then we have to create the user database:

$ sudo htpasswd -c /etc/radicale/passwd ehome
New password:
Re-type password:

Notice that this authentification way (based on local password file) will not be definitive: I aim really to have a central authentification system for Ehome, basically LDAP.

Now, we can fist configure the service. Create the file /etc/radicale/config:

[server]
hosts = 0.0.0.0:5232, [::]:5232

[auth]
type = htpasswd
htpasswd_filename = /etc/radicale/passwd
htpasswd_encryption = md5

[storage]
filesystem_folder = /var/lib/radicale/collections

And then record the service to systemd Create the file /etc/systemd/system/radicale.service:

[Unit]
Description=A simple CalDAV (calendar) and CardDAV (contact) server
After=network.target
Requires=network.target

[Service]
ExecStart=/usr/bin/env python3 -m radicale
Restart=on-failure
User=radicale
# Deny other users access to the calendar data
UMask=0027
# Optional security settings
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
NoNewPrivileges=true
ReadWritePaths=/var/lib/radicale/collections

[Install]
WantedBy=multi-user.target

It is now time to start the service:

$ sudo  systemctl enable radicale
$ sudo systemctl start radicale
$ sudo systemctl status radicale

Client side

You have first to create calendars and address books on the Radicale rough interface:

$ xdg-open http://ehome:5232

Notice that you have to add a port redirection on your Internet box in order to access Radicale outside your local server. As I do not enabled full-stack on my FreeBox server, I redirected the port 5232 to 50001.

Then you can choose your preferred calendar/address book browser (Gnome Evolution for me) and to open the corresponding calendar/address book.

Switch to Calendar view:

  1. Select New Calendar.
  2. Select CalDAVfor type.
  3. Enter http://EHOME.freeboxos.fr:50001 in URL.
  4. Enter your user name in User.
  5. Select your calendar from the list of available calendars by clicking on Lookup calendars.
  6. Finally click on Validate.

Switch to Address book view:

  1. Select New address book.
  2. Select CardDAVfor type.
  3. Enter http://EHOME.freeboxos.fr:50001 in URL.
  4. Enter your user name in User.
  5. Select your calendar from the list of available calendars by clicking on Lookup address books.
  6. Finally click on Validate.

Finally, I tried with my Android client. I used OpenSync application. It worked very fine: the only trap is that you have to provide calendar/contact access by hand. In my Android version (pretty old), I had to long click on the OpenSyncicon to open and menu and select Authorization Granting.

The configuration is pretty simple. It asks for:

  • URL: http://EHOME.freeboxos.fr:50001,
  • user name,
  • password.

And now calendars and contacts are available on standard Android applications.

Radicale seems to provide to me all I was looking for but it remains a shortcoming: how to share calendars between users? As far as I understand, Radicale, this is supported neither by plugin, nor by the application itself. This might require some development on my side.

Category: EHome Tagged: pim agenda addressbook http


Opening Ehome to the World

dim. 18 décembre 2022

Ok now it is time to open my EHome to the world: mainly to make a bridge between my Internet box (a FreeBox Revolution) and the internet. We have to:

  • Install an HTTPD server on EHome.
  • Redirect port from the Freebox to the port 80 of EHome.
  • Publish some content …

Category: EHome Tagged: apache http

Read More
Page 1 of 1