mickael-kerjean / filestash

🦄 A file manager / web client for SFTP, S3, FTP, WebDAV, Git, Minio, LDAP, CalDAV, CardDAV, Mysql, Backblaze, ...
https://www.filestash.app/
GNU Affero General Public License v3.0
10.28k stars 763 forks source link

[bug] Can't view local files on my Synology NAS #729

Open srahimeen opened 2 months ago

srahimeen commented 2 months ago

Description of the bug

I have installed filestash on my Synology DS923+ NAS using the following docker-compose.yml:

version: '2'
services:
  app:
    container_name: filestash
    image: machines/filestash
    restart: always
    environment:
    - APPLICATION_URL=
    - GDRIVE_CLIENT_ID=<gdrive_client>
    - GDRIVE_CLIENT_SECRET=<gdrive_secret>
    - DROPBOX_CLIENT_ID=<dropbox_key>
    - ONLYOFFICE_URL=http://onlyoffice
    ports:
    - "8334:8334"
    volumes:
    - filestash:/app/data/state/

  onlyoffice:
    container_name: filestash_oods
    image: onlyoffice/documentserver
    restart: always
    security_opt:
      - seccomp:unconfined

volumes:
    filestash: {}

It's running and I can access it. I have set it to only local.

image

When I try to view my files, I get the "Oops! Not Found" error.

image

What do I need to do to view my files from my NAS? I would specifically like to just view the volume1/NAS-BACKUPS/Backup Photos folder from my NAS.

Step by step instructions to reproduce the bug

  1. Install filestash on Synology DS923+ NAS using above docker-compose.yml
  2. Set it to only have local config as per above screenshot

Can you replicate that error from the demo?

Observed behavior

"Oops! Not Found" error when trying to view files.

Expected behavior

I am able to view the local files in my Synology NAS volume1/NAS-BACKUPS/Photos folder

vatsalkgor commented 2 months ago

I think you need to select Authentication Middleware like below!

Screenshot 2024-08-05 at 13 33 12

srahimeen commented 2 months ago

@vatsalkgor what settings need to go in the middleware?

vatsalkgor commented 2 months ago

Each auth middleware have different settings. Details are shown here for many of the Auth middleware. However for local storage with docker container, it will only have access to folders that are mounted on the container.

Let's say you want to add /path/to/files from your host system to the filestash, you first need to mount this path to a path in the container like /path/to/files:/my-files in the docker-compose's volume section. Then in the admin UI select Local and select Admin Auth middleware. Then select local in Attribute Mapping section. That will give you configuration for the local backend. Add your admin password in the password field and /my-files in the path. Then go to your filestash instance and add Admin password to login and you should have your files shown to you.

srahimeen commented 2 months ago

I run immich on my NAS to in the docker compose of that app I had to add the following:

volumes:
  - "/volume1/NAS-BACKUPS/Backup Photos":/usr/src/app/external

To allow access to the local shared folder I want the app to access.

If I want to do something similar in filestash, do I add something like:

    volumes:
    - filestash:/app/data/state/
    - "/volume1/NAS-BACKUPS/Backup Photos":/usr/src/photos

And then expose it in the admin UI? Does the settings here look correct? Is the password here my filestash password or my NAS admin password?

image

@vatsalkgor still getting the Oops error with the above settings so was curious what I'm doing wrong.

vatsalkgor commented 2 months ago

The password is your filestash password, not your NAS Password. And sometimes cache can also play effect so please try in incognito as well.

Thanks

srahimeen commented 2 months ago

I have it set up as the above screenshot, but still seem to get the Oops error. Tried it in incognito mode and in another browser as well. Is mounting to /usr/src/photos not allowed, or should I mount some other way?

My docker compose is now:

version: '2'
services:
  app:
    container_name: filestash
    image: machines/filestash
    restart: always
    environment:
    - APPLICATION_URL=
    - GDRIVE_CLIENT_ID=<gdrive_client>
    - GDRIVE_CLIENT_SECRET=<gdrive_secret>
    - DROPBOX_CLIENT_ID=<dropbox_key>
    - ONLYOFFICE_URL=http://onlyoffice
    ports:
    - "8334:8334"
    volumes:
    - filestash:/app/data/state/
    - "/volume1/NAS-BACKUPS/Google Photos":/usr/src/photos

  onlyoffice:
    container_name: filestash_oods
    image: onlyoffice/documentserver
    restart: always
    security_opt:
      - seccomp:unconfined

volumes:
    filestash: {}

I don't see anything in the logs indicating it failed to mount the volume or something.

srahimeen commented 2 months ago

I also went ahead and gave the filestash containers access to the volume in the Synology Container Manager UI

image

image

Now I seem to get a different error which says "Permission denied".

image

srahimeen commented 2 months ago

@vatsalkgor @mickael-kerjean any ideas on what to do here?

mickael-kerjean commented 1 month ago

I would need to replicate the issue to understand what's going on at a deeper level. If you're ok sending me some testing account I can try from here, I'm happy to give it a shot

ogmkp commented 1 month ago

I use htpasswd on my instance. It works with adding {{.password}} to the local field password with local path.