Skip to content

Inconsistent behaviour when APP_URL is passed from docker environment variables #5748

@unknowndomain

Description

@unknowndomain

Describe the Bug

When using the Linux Server Docker container it's recommended to set the APP_URL in the environment variables of your docker-compose.yml file.

However although the APP_URL works in some places, it doesn't work with Slack as a third party auth.

In order to make it work you need an APP_URL, which clearly is only respected by the Slack authentication login if it comes from the .env file.

Steps to Reproduce

  1. Create a docker container using a Slack authentication purely using the .env file.
  2. Swap the APP_URL from the .env file to the docker-compose.yml file making sure to remove it from .env.
  3. Reload the login page when logged out and notice the button for Slack will vanish.

Expected Behaviour

Bookstack should probably respect all environment variables passed in from the shell, over and above the .env file to the extent you could skip having one entirely.

Screenshots or Additional Context

I discovered this while migrating a site from a VM directly installed, to a Docker container using a Docker Compose file I'm writing.

services:
  mariadb:
    container_name: mariadb
    image: lscr.io/linuxserver/mariadb:latest
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - MYSQL_ROOT_PASSWORD=password
    ports:
      - 127.0.0.1:3306:3306
    volumes:
      - ./mariadb:/config
    restart: unless-stopped
    networks:
      - mariadb

  bookstack:
    container_name: bookstack
    image: lscr.io/linuxserver/bookstack:latest
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      # - APP_URL=http://bookstack.example.com
      # - APP_KEY=secret
      - DB_HOST=mariadb
      - DB_PORT=3306
      - DB_USERNAME=username
      - DB_PASSWORD=password
      - DB_DATABASE=db
    volumes:
      - ./path:/config
    ports:
      - 80:80
      - 443:443
    depends_on:
      - mariadb
    restart: unless-stopped
    networks:
      - mariadb

networks:
  mariadb:
  bookstack:
  

Browser Details

Firefox macOS ARM64 141.0

Exact BookStack Version

25.07

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions