mar10 / wsgidav

A generic and extendable WebDAV server based on WSGI
https://wsgidav.readthedocs.io
MIT License
978 stars 150 forks source link

`follow_symlinks: true` doesn't work #298

Closed ge9 closed 1 year ago

ge9 commented 1 year ago

Thanks for this useful program. I used wsgidav and cheroot, with this wsgidav.yaml:

fs_dav_provider:
    follow_symlinks: true

But when I accessed symlink files or directories, it says "403 Forbidden: Symlink support is disabled", behaving as if it was run without the config file. The output of -vv shows that the config is loaded correctly.

Configuration(/home/myname/wsgidav.yaml):
{'_config_file': '/home/myname/wsgidav.yaml',
 '_config_root': '/home/myname',
...
 'fs_dav_provider': {'follow_symlinks': True, 'shadow_map': {}},
...

I appreciate any help!

mar10 commented 1 year ago

please share your config yaml and version number.

ge9 commented 1 year ago

I'm using wsgidav ver 4.3.0, installed withpip 23.3.1 and python 3.8.16. My wsgidav.yaml has only two lines:

fs_dav_provider:
    follow_symlinks: true

As explained in changelog, symlinks work correctly with 4.2.0.

mar10 commented 1 year ago

How do you run it, can you share the command line?

ge9 commented 1 year ago

this is my command line.

wsgidav --config=$HOME/wsgidav.yaml --auth=anonymous --host=0.0.0.0 --port=11112 --root=$HOME/_dav_root -vv

I'm using ubuntu. _dav_root contains symbolic links to root / and ../test.txt.

mar10 commented 1 year ago

The --root parameter is only a shortcut for a very simple provider_mapping config option that currently does not use the fs_dav_provider configuration.

As a workaround, you can specify the provider_mapping in the config file instead of using the --root parameter:

Command line

wsgidav --config=$HOME/wsgidav.yaml --auth=anonymous --host=0.0.0.0 --port=11112 

with this config file

fs_dav_provider:
    follow_symlinks: true

provider_mapping:
    '/': '~/_dav_root'
ge9 commented 1 year ago

Oh, that works! Thank you for quick and kind advice!