Getting Radicale to work system wide
Hi folks,
I installed Radicale earlier today and when I installed it as a user as described on the homepage using $ python3 -m pip install --upgrade radicale
.
I initially created a local storage and ran as normal user $ python3 -m radicale --storage-filesystem-folder=~/.var/lib/radicale/collections
. I was able to see the webpage when I type the server address (VM on Truenas) http://192.168.0.2:5234
. So the install went well. But I wanted to create system wide so that I can have multiple users loggin in (family members).
So i did the following:
-
$sudo useradd --system --user-group --home-dir / --shell /sbin/nologin radicale
-
$sudo mkdir -p /var/lib/radicale/collections && sudo chown -R radicale:radicale /var/lib/radicale/collections
-
sudo mkdir -p /etc/radicale && sudo chown -R radicale:radicale /etc/radicale
Then I created the config file which looks like:
<span style="color:#323232;">[server]
</span><span style="color:#323232;"># Bind all addresses
</span><span style="color:#323232;">hosts = 192.168.0.2:5234, [::]:5234
</span><span style="color:#323232;">max_connections = 10
</span><span style="color:#323232;"># 100 MB
</span><span style="color:#323232;">max_content_length = 100000000
</span><span style="color:#323232;">timeout = 30
</span><span style="color:#323232;">
</span><span style="color:#323232;">[auth]
</span><span style="color:#323232;">type = htpasswd
</span><span style="color:#323232;">htpasswd_filename = /etc/radicale/users
</span><span style="color:#323232;">htpasswd_encryption = md5
</span><span style="color:#323232;">
</span><span style="color:#323232;">[storage]
</span><span style="color:#323232;">filesystem_folder = /var/lib/radicale/collections
</span><span style="color:#323232;">
</span><span style="color:#323232;">[logging]
</span><span style="color:#323232;">level = debug
</span>
Of course the users file also exists in the /etc/radicale
. Then I created the service file as per the guidance without changing anything:
<span style="color:#323232;">[Unit]
</span><span style="color:#323232;">Description=A simple CalDAV (calendar) and CardDAV (contact) server
</span><span style="color:#323232;">After=network.target
</span><span style="color:#323232;">Requires=network.target
</span><span style="color:#323232;">
</span><span style="color:#323232;">[Service]
</span><span style="color:#323232;">ExecStart=/usr/bin/env python3 -m radicale
</span><span style="color:#323232;">Restart=on-failure
</span><span style="color:#323232;">User=radicale
</span><span style="color:#323232;"># Deny other users access to the calendar data
</span><span style="color:#323232;">UMask=0027
</span><span style="color:#323232;"># Optional security settings
</span><span style="color:#323232;">PrivateTmp=true
</span><span style="color:#323232;">ProtectSystem=strict
</span><span style="color:#323232;">ProtectHome=true
</span><span style="color:#323232;">PrivateDevices=true
</span><span style="color:#323232;">ProtectKernelTunables=true
</span><span style="color:#323232;">ProtectKernelModules=true
</span><span style="color:#323232;">ProtectControlGroups=true
</span><span style="color:#323232;">NoNewPrivileges=true
</span><span style="color:#323232;">ReadWritePaths=/var/lib/radicale/collections
</span><span style="color:#323232;">
</span><span style="color:#323232;">[Install]
</span><span style="color:#323232;">WantedBy=multi-user.target
</span>
Then I hit the usual sequence:
<span style="color:#323232;">$ sudo systemctl enable radicale
</span><span style="color:#323232;">$ sudo systemctl start radicale
</span><span style="color:#323232;">$ sudo systemctl status radicale
</span>
and of course it all seems to be running:
<span style="color:#323232;">user@vm101:/$ sudo systemctl status radicale
</span><span style="color:#323232;">● radicale.service - A simple CalDAV (calendar) and CardDAV (contact) server
</span><span style="color:#323232;"> Loaded: loaded (/etc/systemd/system/radicale.service; enabled; vendor preset: enabled)
</span><span style="color:#323232;"> Active: active (running) since Sat 2024-05-25 19:44:54 BST; 18min ago
</span><span style="color:#323232;"> Main PID: 313311 (python3)
</span><span style="color:#323232;"> Tasks: 1 (limit: 4638)
</span><span style="color:#323232;"> Memory: 13.1M
</span><span style="color:#323232;"> CPU: 166ms
</span><span style="color:#323232;"> CGroup: /system.slice/radicale.service
</span><span style="color:#323232;"> └─313311 python3 -m radicale
</span><span style="color:#323232;">
</span><span style="color:#323232;">May 25 19:44:54 vm101 systemd[1]: Started A simple CalDAV (calendar) and CardDAV (contact) server.
</span>
When I run $ journalctl --unit radicale.service
it only provide the following output, despite the logging level is set to debug:
<span style="color:#323232;">user@vm101:/etc/radical$ sudo journalctl --unit radicale.service
</span><span style="color:#323232;">-- Journal begins at Sat 2022-12-31 15:45:51 GMT, ends at Sat 2024-05-25 20:04:37 BST. --
</span><span style="color:#323232;">May 25 19:25:46 vm101 systemd[1]: Started A simple CalDAV (calendar) and CardDAV (contact) server.
</span><span style="color:#323232;">May 25 19:44:46 vm101 systemd[1]: Stopping A simple CalDAV (calendar) and CardDAV (contact) server...
</span><span style="color:#323232;">May 25 19:44:46 vm101 systemd[1]: radicale.service: Succeeded.
</span><span style="color:#323232;">May 25 19:44:46 vm101 systemd[1]: Stopped A simple CalDAV (calendar) and CardDAV (contact) server.
</span><span style="color:#323232;">May 25 19:44:54 vm101 systemd[1]: Started A simple CalDAV (calendar) and CardDAV (contact) server.
</span>
Any clue as to why i get “Can’t establish a connection …” error when I type http://192.168.0.2:5234
. I’m clearly missing something but can’t quite get what it is. Any help would be appreciated.
BTW, I’m connecting to the Truenas server (where the VM runs) from my laptop, the same one that allowed me to connect when I used the normal user approach described at the start.