[GH-ISSUE #1441] Non-editable config overriden when using admin page #962

Closed
opened 2026-03-03 02:05:03 +03:00 by kerem · 4 comments
Owner

Originally created by @nbdd0121 on GitHub (Feb 26, 2021).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1441

Subject of the issue

If non-editable configs are specified in config.json, it will be lost when configs are saved in the admin page (which, in a sense, made them editable).

Your environment

  • Bitwarden_rs version: 1.19.0
  • Install method: Docker image
  • Clients used: Web
  • Reverse proxy and version: nginx/1.17.3
  • Version of mysql/postgresql: N/A

Steps to reproduce

  1. Add some non-editable configs in config.json, e.g. websocket_enabled.
  2. Start bitwarden_rs, open admin page, save.

Expected behaviour

Non-editable configs stay in config.json.

Actual behaviour

Non-editable configs are gone in config.json.

Originally created by @nbdd0121 on GitHub (Feb 26, 2021). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1441 <!-- # ### NOTE: Please update to the latest version of bitwarden_rs before reporting an issue! This saves you and us a lot of time and troubleshooting. See: https://github.com/dani-garcia/bitwarden_rs/issues/1180 # ### --> <!-- Please fill out the following template to make solving your problem easier and faster for us. This is only a guideline. If you think that parts are unnecessary for your issue, feel free to remove them. Remember to hide/obfuscate personal and confidential information, such as names, global IP/DNS addresses and especially passwords, if necessary. --> ### Subject of the issue If non-editable configs are specified in config.json, it will be lost when configs are saved in the admin page (which, in a sense, made them editable). ### Your environment <!-- The version number, obtained from the logs or the admin diagnostics page --> <!-- Remember to check your issue on the latest version first! --> * Bitwarden_rs version: 1.19.0 <!-- How the server was installed: Docker image / package / built from source --> * Install method: Docker image * Clients used: Web * Reverse proxy and version: nginx/1.17.3 * Version of mysql/postgresql: N/A ### Steps to reproduce <!-- Tell us how to reproduce this issue. What parameters did you set (differently from the defaults) and how did you start bitwarden_rs? --> 1. Add some non-editable configs in config.json, e.g. websocket_enabled. 2. Start bitwarden_rs, open admin page, save. ### Expected behaviour <!-- Tell us what should happen --> Non-editable configs stay in config.json. ### Actual behaviour <!-- Tell us what happens instead --> Non-editable configs are gone in config.json.
kerem 2026-03-03 02:05:03 +03:00
Author
Owner

@BlackDex commented on GitHub (Feb 26, 2021):

I'm not following you.
If you add a non-editable manually to the config.json you find it strange that it disappears after you press save??

That sounds illogical, because, they are non-editable they should disappear and only able to work via export .env or -e.

<!-- gh-comment-id:786846495 --> @BlackDex commented on GitHub (Feb 26, 2021): I'm not following you. If you add a non-editable manually to the config.json you find it strange that it disappears after you press save?? That sounds illogical, because, they are non-editable they should disappear and only able to work via `export` `.env` or `-e`.
Author
Owner

@nbdd0121 commented on GitHub (Feb 26, 2021):

The wiki page makes it sound like the two methods are equivalent (with config.json taking priority) and does not mention about non-editable configs at all (I only know that certain things are non-editable by peeking into config.rs).

In bitwarden_rs, you can perform configuration either via environment variables or an admin page (which writes settings to a config.json file under your data directory). It's important to note that each setting in config.json overrides the corresponding environment variable setting (if it exists). For example, if you set the environment variable DOMAIN=https://bitwarden.example.com, but your config.json includes "domain": "https://bw.example.com", then bitwarden_rs will generate various links based on what's in the config file (https://bw.example.com).

A common source of confusion is enabling the admin page (which creates the config.json file), changing some settings via the admin page (which sets the corresponding values in config.json), then later trying to change those settings via environment variable (which doesn't work because config.json overrides env vars). To avoid this confusion, it's highly recommended to stick to one configuration method or the other; that is, configure entirely via environment variables, or entirely via config.json (whether using the admin page or editing config.json directly).

Since I would like to make some changes using config.json, by following the recommendation of that wiki page I had all my configurations entirely in config.json and does not set any environment variables. (Personally I would also prefer to use a single config.json because that way all my config is in one place).

I think it is reasonable to expect from the wiki's wording that admin page keeps non-editable configs intact.

<!-- gh-comment-id:786898365 --> @nbdd0121 commented on GitHub (Feb 26, 2021): The wiki page makes it sound like the two methods are equivalent (with config.json taking priority) and does not mention about non-editable configs at all (I only know that certain things are non-editable by peeking into config.rs). > In bitwarden_rs, you can perform configuration either via environment variables or an admin page (which writes settings to a config.json file under your data directory). It's important to note that each setting in config.json overrides the corresponding environment variable setting (if it exists). For example, if you set the environment variable DOMAIN=https://bitwarden.example.com, but your config.json includes "domain": "https://bw.example.com", then bitwarden_rs will generate various links based on what's in the config file (https://bw.example.com). > > A common source of confusion is enabling the admin page (which creates the config.json file), changing some settings via the admin page (which sets the corresponding values in config.json), then later trying to change those settings via environment variable (which doesn't work because config.json overrides env vars). To avoid this confusion, it's highly recommended to stick to one configuration method or the other; that is, configure entirely via environment variables, or entirely via config.json (whether using the admin page or editing config.json directly). Since I would like to make some changes using config.json, by following the recommendation of that wiki page I had all my configurations entirely in config.json and does not set any environment variables. (Personally I would also prefer to use a single config.json because that way all my config is in one place). I think it is reasonable to expect from the wiki's wording that admin page keeps non-editable configs intact.
Author
Owner

@jjlin commented on GitHub (Feb 26, 2021):

My mistake for not clarifying which config items aren't editable via config.json. I'll update the wiki later to mention that read-only config can only be set via environment variable.

<!-- gh-comment-id:786902921 --> @jjlin commented on GitHub (Feb 26, 2021): My mistake for not clarifying which config items aren't editable via config.json. I'll update the wiki later to mention that read-only config can only be set via environment variable.
Author
Owner

@BlackDex commented on GitHub (Feb 26, 2021):

As a side note, if you want to have a single file use the .env file either via docker-compose, or mount that file via -v /path/to/env-file:/.env
Though for changing those settings you need to restart bitwarden.

Also, if you modify the config.json file it will always loose it's contents of you keep bitwarden runnen and press the save button. Because it doesn't reload/re-read that file. It only rewards it during startup and writes during save.

<!-- gh-comment-id:786906037 --> @BlackDex commented on GitHub (Feb 26, 2021): As a side note, if you want to have a single file use the .env file either via docker-compose, or mount that file via `-v /path/to/env-file:/.env` Though for changing those settings you need to restart bitwarden. Also, if you modify the config.json file it will always loose it's contents of you keep bitwarden runnen and press the save button. Because it doesn't reload/re-read that file. It only rewards it during startup and writes during save.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#962
No description provided.