izderadicka / audioserve

Simple personal server to serve audiofiles files from folders. Intended primarily for audio books, but anything with decent folder structure will do.
723 stars 36 forks source link

Base URL not working #403

Closed hugo-akaora closed 2 weeks ago

hugo-akaora commented 2 weeks ago

Hello, according to https://github.com/izderadicka/audioserve/issues/36, I use the flag url_path_prefix, via the environment var AUDIOSERVE_URL_PATH_PREFIX: "/audio"

Seems properly added in config:

root@iv:~# docker exec -ti audioserve ./audioserve --print-config|grep url_path_prefix
url_path_prefix: /audio

Nonetheless, it seems that my web browser doesn't fetch the assets using url_path_prefix, so it doesn't work.

image

My complete compose.yaml file :

services:

   audioserve:
      user: 1000:1000
      image: ghcr.io/srd424/audioserve-docker:v0.26.2
      container_name: audioserve
      environment:
         # https://github.com/izderadicka/audioserve/blob/master/src/config/cli.rs
         PUID: 1000
         PGID: 1000
         AUDIOSERVE_SHARED_SECRET: "__REDACTED__"
         AUDIOSERVE_NO_AUTHENTICATION: true
         AUDIOSERVE_DATA_DIR: "/data"
         AUDIOSERVE_BASE_DIRS: "/audio"
         AUDIOSERVE_TAGS: true
         AUDIOSERVE_CLIENT_DIR: "/client/dist"
         AUDIOSERVE_URL_PATH_PREFIX: "/audio"
         AUDIOSERVE_URL_BASE: "cerenu.${BASE_DOMAIN}"
         AUDIOSERVE_BEHIND_PROXY: true
         AUDIOSERVE_POSITIONS_BACKUP_FILE: "/data/positions"
         AUDIOSERVE_ALLOW_SYMLINKS: true
         AUDIOSERVE_READ_PLAYLIST: true
         AUDIOSERVE_PRINT_CONFIG: true
      labels:
         traefik.enable: "true"
         traefik.docker.network: "proxy"
         traefik.http.services.audioserve.loadbalancer.server.port: 3000
         traefik.http.routers.audioserve.entrypoints: web,websecure
         traefik.http.routers.audioserve.tls: true
         traefik.http.routers.audioserve.rule: Host(`cerenu.${BASE_DOMAIN}`) && PathPrefix(`/audio`)
      volumes:
         - ${DOCKER_VOLUME_STORAGE_PATH}/dufs/data:/audio
         - ${DOCKER_VOLUME_STORAGE_PATH}/audioserve/data:/data
         - ${DOCKER_VOLUME_STORAGE_PATH}/audioserve/client:/client
         - ${DOCKER_VOLUME_STORAGE_PATH}/audioserve/config:/config
      networks:
         - proxy

networks:
  proxy:
    external: true

I'm using arm64's docker image https://github.com/srd424/audioserve-docker on Raspberry Pi 3B.

Logs are empty.

Thank you!

hugo-akaora commented 2 weeks ago

Oh, https://github.com/srd424/audioserve-docker does not seem to be updated to last version, so I'll try to compile it myself for arm64.

hugo-akaora commented 2 weeks ago

Ok, @srd424 updated it, so I was able to test that I have a similar behavior on latest version (v0.28.6)

izderadicka commented 2 weeks ago

Thanks for info, will check on my side.

izderadicka commented 2 weeks ago

Hi,

please try with trailing / - this should work - e.g. https://some.host/audio/
It's related to handling of absolute and relative URL, which is not handled for all cases if prefix path is used. I'll fix it with redirect later, but for now trailing / should work.

izderadicka commented 2 weeks ago

Merged redirection to master branch with #404