tomsquest / docker-radicale

Docker image for Radicale calendar and contact server :calendar: + security :closed_lock_with_key: + addons :rocket:
GNU General Public License v3.0
593 stars 82 forks source link

No configuration file & permission error #1

Closed dzervas closed 8 years ago

dzervas commented 8 years ago

After starting your container, I don't get the config file through the volume (I only get user.prop & user dir). Also when I access <server>/user/main.ics I get this:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python3.5/site-packages/radicale/__init__.py", line 332, in __call__
    user)
  File "/usr/local/lib/python3.5/site-packages/radicale/__init__.py", line 447, in do_GET
    "Content-Type": collection.mimetype,
  File "/usr/local/lib/python3.5/site-packages/radicale/ical.py", line 410, in mimetype
    if self.tag == "VADDRESSBOOK":
  File "/usr/local/lib/python3.5/site-packages/radicale/ical.py", line 405, in tag
    return props["tag"]
  File "/usr/local/lib/python3.5/contextlib.py", line 66, in __exit__
    next(self.gen)
  File "/usr/local/lib/python3.5/site-packages/radicale/storage/filesystem.py", line 143, in props
    with open(self._props_path, "w") as prop_file:
  File "/usr/local/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.5/site-packages/radicale/storage/filesystem.py", line 52, in open
    with codecs.open(abs_path, mode, config.get("encoding", "stock")) as fd:
  File "/usr/local/lib/python3.5/codecs.py", line 895, in open
    file = builtins.open(filename, mode, buffering)
PermissionError: [Errno 13] Permission denied: '/data.props'
tomsquest commented 8 years ago

For the volumes:

For the error, can you give me the command you ran and the url you used to configure the calendar ?

For me:

$ docker run -d --name radicale -p 5232:5232 -v ~/radicale:/data tomsquest/docker-radicale
...

# Created a calendar with url: http://localhost:5232/testuser/calendar.ics/

$ docker exec -it radicale sh
/data # ls -lR
.:
total 4
drwxr-xr-x    2 radicale radicale      4096 Oct  9 15:01 testuser

./testuser:
total 12
-rw-r--r--    1 radicale radicale        20 Oct  9 15:01 calendar.ics.props
dzervas commented 8 years ago

docker run -d --name Radicale -p 5232 -v /opt/radicale:/data/radicale/ -e VIRTUAL_HOST=dav.p.vpn jcsaaddupuy/radicale

The VIRTUAL_HOST env is used for nginx-proxy.

tomsquest commented 8 years ago

You're using jcsaaddupuy/radicale image and not mine, tomsquest/docker-radicale

dzervas commented 8 years ago

Oops, wrong command: docker run -d --name Radicale -p 5232 -v /data/radicale:/data -e VIRTUAL_HOST=dav.p.vpn tomsquest/docker-radical

tomsquest commented 8 years ago

Retried this morning and all is working (no error at all):

No error in the log.

tomsquest commented 8 years ago

@dzervas I reproduced the error when syncing with Davdroid. I will try to see exactly what is going on. It only occurs when syncing contacts from Davdroid...

tomsquest commented 8 years ago

Issue opened at Radicale for the security part: https://github.com/Kozea/Radicale/issues/528

I still don't know why Davdroid wants to read that file, and what this file is.

BTW, we see the stacktrace thanks to the container not running as root but with a less privileged user.

tomsquest commented 8 years ago

@dzervas fixed. You may have to change your command line. From now on, Radicale will store its data in /radicale/data and no more in /data.

tomsquest commented 8 years ago

Tag 1.1.1, so you may need to pull latest or this tag.