Skip to content

Commit

Permalink
Permit passing config object via env vars (#461)
Browse files Browse the repository at this point in the history
* Retain object types

* Rm notes of unsupported CLI/ENV arguments

* Update config.js.json to permit CLI/ENV contirbutions of objects

* Last updates before release, v3.3.0

* Update translations (#526)

* Support passing in objects in non-dockerized environments

* New translations fields.json (French) (#527)

* Fix config schema for requestHeaders

* Permit requestHeaders setting via CLI & env

---------

Co-authored-by: Matthias Mohr <[email protected]>
Co-authored-by: Matthias Mohr <[email protected]>
  • Loading branch information
3 people authored Jan 9, 2025
1 parent d39fd27 commit 1d92235
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
12 changes: 3 additions & 9 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,12 @@
"requestHeaders": {
"type": [
"object"
],
"noCLI": true,
"noEnv": true
]
},
"requestQueryParameters": {
"type": [
"object"
],
"noCLI": true,
"noEnv": true
]
},
"socialSharing": {
"type": [
Expand Down Expand Up @@ -240,9 +236,7 @@
{
"$ref": "https://stac-extensions.github.io/authentication/v1.1.0/schema.json"
}
],
"noCLI": true,
"noEnv": true
]
}
}
}
2 changes: 1 addition & 1 deletion docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ env -0 | cut -f1 -d= | tr '\0' '\n' | grep "^SB_" | {
boolean)
bool "$value"
;;
integer | number)
integer | number | object)
object "$value"
;;
array)
Expand Down
6 changes: 0 additions & 6 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@ This is affected by [`allowedDomains`](#alloweddomains).

Example: `{'Authorization': 'Bearer 134567984623223'}` adds a Bearer token to the HTTP headers.

Please note that this option can only be provided through a config file and is not available via CLI/ENV.

## requestQueryParameters

***experimental***
Expand All @@ -296,8 +294,6 @@ This is affected by [`allowedDomains`](#alloweddomains).

Example: `{'f': 'json'}` adds a `f` query parameter to the HTTP URL, e.g. `https://example.com?f=json`.

Please note that this option can only be provided through a config file and is not available via CLI/ENV.

## socialSharing

Lists the social sharing service for which buttons should be shown in the "Share" panel.
Expand Down Expand Up @@ -335,8 +331,6 @@ In addition the following properties are supported:

Authentication is generally affected by the [`allowedDomains`](#alloweddomains) option.

The `authConfig` option can only be provided through a config file and is not available via CLI/ENV.

### API Keys

API keys can be configured to be sent via HTTP header or query parameter:
Expand Down
5 changes: 5 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ const argv = yargs(hideBin(process.argv))
.boolean(optionsForType("boolean"))
.number(optionsForType("number").concat(optionsForType("integer")))
.array(optionsForType("array"))
.option(
Object.fromEntries(
optionsForType("object").map((k) => [k, { coerce: JSON.parse }])
)
)
.argv;
// Clean-up arguments
delete argv._;
Expand Down

0 comments on commit 1d92235

Please sign in to comment.