Runtime Config Generator
Project description
Roco - Runtime config generator
Command line utility which prints to the standard output javascript valid text generated from environment variables.
For example, given following environment variables:
PAPERMERGE__AUTH__OIDC_CLIENT_ID=papermerge
PAPERMERGE__AUTH__OIDC_AUTHORIZE_URL=http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/auth
PAPERMERGE__AUTH__OIDC_REDIRECT_URL=http://demo.trusel.net:12000/oidc/callback
PAPERMERGE__AUTH__OIDC_LOGOUT_URL=http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/logout
will result in the following text (valid javascript) as output:
window.__PAPERMERGE_RUNTIME_CONFIG__ = {
oidc: {
client_id: 'papermerge',
authorize_url: 'http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/auth',
redirect_url: 'http://demo.trusel.net:12000/oidc/callback',
logout_url: 'http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/logout'
scope: 'openid email',
}
};
Install
pip install roco
Usage
If no relevant environment variables were defined just running:
roco
Will result in following output:
window.__PAPERMERGE_RUNTIME_CONFIG__ = {
};
i.e. valid, but empty, javascript object. In order to see current roco's pydantic settings (read from env vars) run:
roco --settings
The above command will also show the env var prefix i.e. PAPERMERGE__AUTH__.
Roco reads from following environment variables:
PAPERMERGE__AUTH__OIDC_AUTHORIZE_URLPAPERMERGE__AUTH__OIDC_CLIENT_IDPAPERMERGE__AUTH__OIDC_REDIRECT_URLPAPERMERGE__AUTH__OIDC_LOGOUT_URLPAPERMERGE__AUTH__OIDC_SCOPE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file roco-0.4.4.tar.gz.
File metadata
- Download URL: roco-0.4.4.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.5.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f2bd6df42a695871f4fd2fd777726058d22b1bfe4a9c8f1220658e6cc88907b
|
|
| MD5 |
1c0224070732388b917f7dd4796541f7
|
|
| BLAKE2b-256 |
25e3e77b3566270ca25c849a529270df4e04fd83171743cb6dd0be2fcae7c8ef
|
File details
Details for the file roco-0.4.4-py3-none-any.whl.
File metadata
- Download URL: roco-0.4.4-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.5.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d305bbe79c86aad101a862dd162b7a9f4c6f7dc57cdc28c701f07f7ff99e91c2
|
|
| MD5 |
4853686117ad1318df1de357452ded0a
|
|
| BLAKE2b-256 |
e04f3ea5477ef66e6b3cb2d6cc774ab0f165eceb880f2504200f26e20e8be27b
|