this post was submitted on 25 May 2024
18 points (100.0% liked)

Selfhosted

40296 readers
251 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

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:

[server]
# Bind all addresses
hosts = 192.168.0.2:5234, [::]:5234
max_connections = 10
# 100 MB
max_content_length = 100000000
timeout = 30

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

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

[logging]
level = debug

Of course the users file also exists in the /etc/radicale. Then I created the service file as per the guidance without changing anything:

[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

Then I hit the usual sequence:

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

and of course it all seems to be running:

user@vm101:/$ sudo systemctl status radicale
● radicale.service - A simple CalDAV (calendar) and CardDAV (contact) server
     Loaded: loaded (/etc/systemd/system/radicale.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2024-05-25 19:44:54 BST; 18min ago
   Main PID: 313311 (python3)
      Tasks: 1 (limit: 4638)
     Memory: 13.1M
        CPU: 166ms
     CGroup: /system.slice/radicale.service
             └─313311 python3 -m radicale

May 25 19:44:54 vm101 systemd[1]: Started A simple CalDAV (calendar) and CardDAV (contact) server.

When I run $ journalctl --unit radicale.service it only provide the following output, despite the logging level is set to debug:

user@vm101:/etc/radical$ sudo journalctl --unit radicale.service
-- Journal begins at Sat 2022-12-31 15:45:51 GMT, ends at Sat 2024-05-25 20:04:37 BST. --
May 25 19:25:46 vm101 systemd[1]: Started A simple CalDAV (calendar) and CardDAV (contact) server.
May 25 19:44:46 vm101 systemd[1]: Stopping A simple CalDAV (calendar) and CardDAV (contact) server...
May 25 19:44:46 vm101 systemd[1]: radicale.service: Succeeded.
May 25 19:44:46 vm101 systemd[1]: Stopped A simple CalDAV (calendar) and CardDAV (contact) server.
May 25 19:44:54 vm101 systemd[1]: Started A simple CalDAV (calendar) and CardDAV (contact) server.

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.

top 9 comments
sorted by: hot top controversial new old
[–] taladar@sh.itjust.works 2 points 5 months ago (2 children)

Your two bind addresses might be in conflict with each other since [::]:5234 includes binding to the first one.

[–] lemmyvore@feddit.nl 1 points 5 months ago (1 children)

They do not conflict, the first is an IPv4 address and the second is an IPv6 address.

What I don't understand is why one of them is a specific address and the second is the ALL address. They should either both be specific or both ALL (0.0.0.0 for IPv4).

[–] taladar@sh.itjust.works 3 points 5 months ago

IPv6 binds on wildcard addresses include binding to the IPv4 addresses.

[–] trilobite@lemmy.ml 1 points 5 months ago* (last edited 5 months ago) (3 children)

Ok, removed the conflicting bit but it made no difference. I wonder if this is to do with 'radicale' user not being able to open ports or something like that ...?

[–] trilobite@lemmy.ml 5 points 5 months ago (1 children)

Turned out I had created /etc/radical rather than /etc/radicale and of course the app was looking for a folder that didn't exist. I can confirm the above procedure works for anyone trying to install it.

[–] UndulyUnruly@lemmy.world 2 points 5 months ago

Appreciate the walkthrough and follow up.

[–] taladar@sh.itjust.works 2 points 5 months ago (1 children)

What does ss -tlnp return? Does the process listen on any ports?

[–] trilobite@lemmy.ml 2 points 5 months ago

ss -tlnp

Yes, it returning the right address:port 192.168.0.2:5234 but as I said earlier, the problem was me mis-spelling the config folder so it was ignoring the config file.

[–] taladar@sh.itjust.works 1 points 5 months ago

That should only affect ports below 1024.