Skip to content

[BUG] Environment variables not being passed to /config/www/.env #189

@XStylus

Description

@XStylus

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The following docker-compose environment variables are not being passed to the Bookstack .env file at /config/www/.env:

  - MAIL_DRIVER=
  - MAIL_HOST=
  - MAIL_PORT=
  - MAIL_USERNAME=
  - MAIL_PASSWORD=
  - MAIL_ENCRYPTION=
  - MAIL_FROM_NAME=
  - MAIL_FROM=
  - GOOGLE_AP_ID=
  - GOOGLE_APP_SECRET=
  - GOOGLE_AUTO_REGISTER=

Expected Behavior

When the above variables are entered into "environment:" on docker-compose, it is expected that they be passed along to /config/www/.env.

There is an undesirable workaround by way of using a separate .env file alongside the docker-compose file, or by manually editing the /config/www/.env file after installation.

Steps To Reproduce

  1. Add the affected variables to docker compose.
  2. Install Bookstack using docker compose file.
  3. View /config/www/.env file.
  4. See that the affected variables remain at their defaults and not as specified in the docker compose file.

Environment

- OS: ubuntu 22.04.3 LTS
- How docker service was installed: Distro packagemanager

CPU architecture

x86-64

Docker creation

# Docker Compose file for Bookstack

version: "2"
services:
  bookstack:
    image: linuxserver/bookstack:latest
    container_name: bookstack_app
    restart: unless-stopped
    depends_on:
      - bookstack_db
    volumes:
      - /mnt/Secondary/docker/bookstack/config:/config
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=https://wiki.example.com
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=SuperPWGoesHere
      - DB_DATABASE=bookstackapp
      - DB_PORT=3306
# Email configuration settings
      - MAIL_DRIVER=smtp
      - MAIL_HOST=smtp.mailserver.com
      - MAIL_PORT=587
      - MAIL_USERNAME=example@example.com
      - MAIL_PASSWORD=SuperPWGoesHere
      - MAIL_ENCRYPTION=tls
      - MAIL_FROM_NAME="BookStack Wiki"
      - MAIL_FROM=noreply@example.com
      - GOOGLE_AP_ID=GoogleAppIDGoesHere.apps.googleusercontent.com
      - GOOGLE_APP_SECRET=GoogleAppSecretGoesHere
      - GOOGLE_AUTO_REGISTER=true
#    ports:
#      - 8006:80
        
#    networks:
#      - bookstack

  bookstack_db:
    image: linuxserver/mariadb:latest
    container_name: bookstack_mariadb
    restart: unless-stopped
    volumes:
      - /mnt/Secondary/docker/bookstack/mariadb/config:/config
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Los_Angeles
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_ROOT_PASSWORD=SuperPWGoesHere
      - MYSQL_PASSWORD=SuperPWGoesHere
      - MYSQL_TCP_PORT=3306      

#    networks:
#      - bookstack
#
#networks:
#  bookstack:

volumes:
  bookstack:
    name: bookstack_data
  bookstack_db:
    name: bookstack_mariadb_data      

networks:
  default:
    name: nginx-proxy-manager
    driver: bridge
    external: true

Container logs

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions