django-cms / django-filer

File and Image Management Application for django
https://django-filer.readthedocs.io/
Other
1.73k stars 575 forks source link

Secure downloads doesn't work as expected #1272

Closed erlenddalen closed 1 year ago

erlenddalen commented 2 years ago

Given the following settings:

FILER_STORAGES = {
    'private': {
        'main': {
            'ENGINE': 'filer.storage.PrivateFileSystemStorage',
            'OPTIONS': {
                'location': '/securemedia',
                'base_url': '/smedia/filer_private',
            },
            'UPLOAD_TO': 'filer.utils.generate_filename.randomized',
            'UPLOAD_TO_PREFIX': 'filer_private',
        },
    },
}

I'm able to serve the secured files located in my /smedia -folder, but I'm unable to store files in this directory. The code is giving me a message saying that I don't have the rights to create the directory '/securemedia'.

If I change the location in the above settings to '/srv/data/smedia/sitename/', I'm able to store the files correctly, but now filer thinks that these files should be served from https://www.sitename.com/srv/data/smedia/sitename/filer_private/

This is clearly wrong as the location of where the files should be served from should be the FILER_SERVERS, not FILER_STORAGES.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This will now be closed due to inactivity, but feel free to reopen it.