Closed calvinbui closed 2 years ago
These are only designed to work on first creation of the container. If you're looking change these after deployment, you'll need to edit the .env
file accordingly.
I just may have found the cause. If you copied docker-compose from the readme.md here it said DB_PASS where it should be DB_PASSWORD
@matthijsbro From what I can see the DB_PASS
variable is converted and set to the Bookstack expected DB_PASSWORD
when the container is created the first time. So that would not be the cause.
See https://github.com/linuxserver/docker-bookstack/blob/master/root/etc/cont-init.d/50-config#L61
if [ "${DB_USER}" ];
then
echo "Running config - db_user set"
ESCAPED_PASSWORD=$(sed -e 's/[$\/&]/\\&/g' <<< $DB_PASS)
sed -i "s/DB_HOST=localhost/DB_HOST=${DB_HOST}/g" /config/www/.env
sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /config/www/.env
sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /config/www/.env
sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${ESCAPED_PASSWORD}/g" /config/www/.env
fi
I know very little about this. I can only conclude that the change made it work for me.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
After banging my head for hours, using DB_PASSWORD instead of DB_PASS worked for me as well.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Expected Behavior
Changing the
DB_HOST
,DB_DATABASE
,DB_USERNAME
orDB_PASSWORD
values should update the/config/www/.env
file values.Current Behavior
The
sed
command only replaces the default values.The script also exits successfully (0) afterwards when there is an error.
See file: See file: https://github.com/linuxserver/docker-bookstack/blob/master/root/etc/cont-init.d/50-config#L65-L68
Steps to Reproduce
DB_HOST
,DB_DATABASE
,DB_USERNAME
orDB_PASSWORD
environment values/config/www/.env
is not updated to the correct valueDocker logs