Skip to content

Commit afb47e6

Browse files
committed
Add env config changes to docs
1 parent 726ee8f commit afb47e6

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

build/mac/open_msupply_server.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ cd "$(dirname "$0")"
1010
chmod +x bin/remote_server
1111
xattr -cr bin/remote_server
1212
$(sleep 3 && open "http://localhost:8000") &
13-
APP_SERVER__DANGER_ALLOW_HTTP=true ./bin/remote_server
13+
APP__SERVER__DANGER_ALLOW_HTTP=true ./bin/remote_server

server/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ From version 2.0 omSupply would require both legacy and omSupply central server
110110
- `cargo run` twice but change port, database and sync settings in yaml file or overwrite with env variables
111111

112112
For example, two sites running locally from the same repo, __central__ and __test__, for __central__ site `Site is open mSupply central server` is checked and `This site url` is http://localhost:2055.
113-
Comment out all sync settings in yaml and can start __central__ with `APP_SERVER__PORT=2055 APP_DATABASE__DATABASE_NAME="central_test" cargo run` front end would be started with `yarn start -- -- --env API_HOST='http://localhost:2055' --port 3005` (--port is for webpack port), and then start __test__ with `cargo run` and `yarn && yarn start-local` from respective folders. The first site would be initialised with `central` site credentials first, and second sites with __test__ credentials, __test__ site would sync with both legacy mSupply and omSupply central server (this __central__ site), and __central__ site would synchronise with legacy mSupply server only
113+
Comment out all sync settings in yaml and can start __central__ with `APP__SERVER__PORT=2055 APP__DATABASE__DATABASE_NAME="central_test" cargo run` front end would be started with `yarn start -- -- --env API_HOST='http://localhost:2055' --port 3005` (--port is for webpack port), and then start __test__ with `cargo run` and `yarn && yarn start-local` from respective folders. The first site would be initialised with `central` site credentials first, and second sites with __test__ credentials, __test__ site would sync with both legacy mSupply and omSupply central server (this __central__ site), and __central__ site would synchronise with legacy mSupply server only
114114

115115

116116
### Start server in watch mode
@@ -211,13 +211,13 @@ If you want to ensure all your changes have been written to the main sqlite data
211211

212212
`note`: yaml configurations are likely to be deprecated to .env, thus documentations is limited for .yaml.
213213

214-
In `configurations` folder you'll find `.yaml` config files, there is `base`, `local` (will overwrite/expand `base` in dev mode), `production` (will overwrite/expand other configs when `APP_ENVIRONMENT=production ).
214+
In `configurations` folder you'll find `.yaml` config files, there is `base`, `local` (will overwrite/expand `base` in dev mode), `production` (will overwrite/expand other configs when `APP__ENVIRONMENT=production ).
215215

216-
You can use env variable to overwrite any configurations, can use dot notation with `__` (two underscore) to specify nested value. Env vars configuration overrides start with `APP_`.
216+
You can use env variable to overwrite any configurations, can use dot notation with `__` (two underscore) to specify nested value. Env vars configuration overrides start with `APP__`.
217217

218218
```bash
219219
# example, will overwrite sync.url config in yaml
220-
APP_SYNC__URL='http://localhost:8001' cargo run
220+
APP__SYNC__URL='http://localhost:8001' cargo run
221221
```
222222

223223
## Export initialisation

server/server/src/configuration.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn get_example_file_path(configuration_directory: PathBuf) -> PathBuf {
8585
/// For example, the following runs the application using the `local` configuration with the
8686
/// `database.port` value set to `5433`:
8787
///
88-
/// APP_ENVIRONMENT=local APP_DATABASE__PORT=5433 cargo run
88+
/// APP__ENVIRONMENT=local APP__DATABASE__PORT=5433 cargo run
8989
///
9090
pub fn get_configuration_environment() -> Environment {
9191
Environment::with_prefix(CONFIGURATION_ENVIRONMENT_PREFIX)

server/service/src/sync/test/integration/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ Only data that needs to be present on central server site is a new sync site (th
4545
## 4 `Open mSupply central server`
4646

4747
- Another instance of omSupply should be running as central server, in order to set omSupply instance as central server, you will need to check "Site is open mSupply central server" against the site and enter correct This site url agains the site in mSupply->Special->Synchronisation->{Site}
48-
- And graphql API should be 'open' (without token), thus 'APP_SERVER\_\_DEBUG_NO_ACCESS_CONTROL' env variable should be set to `true`
48+
- And graphql API should be 'open' (without token), thus 'APP__SERVER\_\_DEBUG_NO_ACCESS_CONTROL' env variable should be set to `true`
4949

5050
In case you are wondering, the APP env variables translate to settings in [configuration .yaml](https://github.com/msupply-foundation/open-msupply/blob/1b8b9237863eef1a764be3973d563e6d84358827/server/configuration/example.yaml#L7) files, and override them
5151

5252
Here is the full command line I used, for this setting "test" site `Site is open mSupply central server` is ticked and `This site url` is set to "http://localhost:2055"
5353

5454
```bash
55-
APP_SERVER__PORT=2055 APP_DATABASE__DATABASE_NAME="central_test" APP_SYNC__URL="http://localhost:2048" APP_SYNC__INTERVAL_SECONDS=30 APP_SERVER__DEBUG_NO_ACCESS_CONTROL=TRUE APP_SYNC__PASSWORD_SHA256="d74ff0ee8da3b9806b18c877dbf29bbde50b5bd8e4dad7a3a725000feb82e8f1" APP_SYNC__USERNAME="test" cargo run
55+
APP__SERVER__PORT=2055 APP__DATABASE__DATABASE_NAME="central_test" APP__SYNC__URL="http://localhost:2048" APP__SYNC__INTERVAL_SECONDS=30 APP__SERVER__DEBUG_NO_ACCESS_CONTROL=TRUE APP__SYNC__PASSWORD_SHA256="d74ff0ee8da3b9806b18c877dbf29bbde50b5bd8e4dad7a3a725000feb82e8f1" APP__SYNC__USERNAME="test" cargo run
5656
```
5757

5858
In this case d74ff0ee8da3b9806b18c877dbf29bbde50b5bd8e4dad7a3a725000feb82e8f1 = pass

0 commit comments

Comments
 (0)