sigoden / dufs

A file server that supports static serving, uploading, searching, accessing control, webdav...
Other
5.45k stars 259 forks source link

403 Forbidden #398

Closed vwkd closed 1 month ago

vwkd commented 1 month ago

Problem

I'm trying to run dufs via podman on Fedora and mount the local directory to the /data directory as shown in the README and in #129. However, accessing the server URL gives a 403 Forbidden error.

If serving . instead of the /data directory, the server returns the error when accessing the /data URL path instead of the / URL path.

Configuration

version: "3"

services:
  dufs:
    image: docker.io/sigoden/dufs:latest
    environment:
      - DUFS_SERVE_PATH=/data
#     - DUFS_SERVE_PATH=.
      - DUFS_AUTH=admin:pass@/:rw
      - DUFS_ALLOW_ALL=true
    restart: always
    volumes:
    - ./:/data
    ports:
    - "5000:5000"

Log

>>>> Executing external compose provider "/usr/bin/podman-compose". Please refer to the documentation for details. <<<<

51766158917d576f390d21e54853896c71d6f76c08abc4c27ced0c24af033b6c
3280ab5baa61463998846e642cb5a1d2f983f8f7ae84a2b4d429bd05188eb3c9
[dufs] | Listening on:
[dufs] |   http://10.89.3.217:5000/
[dufs] |   http://127.0.0.1:5000/
[dufs] |   http://[::1]:5000/
[dufs] |
[dufs] | 2024-06-12T11:03:00Z INFO - 10.89.3.217 "GET /" 401
[dufs] | 2024-06-12T11:03:03Z INFO - 10.89.3.217 "GET /" 403

Environment:

sigoden commented 1 month ago

@vwkd

I copied your docker-compose.yaml file, then ran it, and everything works correctly. Did you input the wrong username and password?

curl -u admin:pass http://localhost:5000
vwkd commented 1 month ago

Turned out it was a SELinux issue and setting the permissions to :Z as suggested by StackOverflow fixed it.

    volumes:
    - ./:/data:Z