Skip to main content

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_URL
  • PAPERMERGE__AUTH__OIDC_CLIENT_ID
  • PAPERMERGE__AUTH__OIDC_REDIRECT_URL
  • PAPERMERGE__AUTH__OIDC_LOGOUT_URL
  • PAPERMERGE__AUTH__OIDC_SCOPE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roco-0.4.4.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

roco-0.4.4-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

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

Hashes for roco-0.4.4.tar.gz
Algorithm Hash digest
SHA256 8f2bd6df42a695871f4fd2fd777726058d22b1bfe4a9c8f1220658e6cc88907b
MD5 1c0224070732388b917f7dd4796541f7
BLAKE2b-256 25e3e77b3566270ca25c849a529270df4e04fd83171743cb6dd0be2fcae7c8ef

See more details on using hashes here.

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

Hashes for roco-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d305bbe79c86aad101a862dd162b7a9f4c6f7dc57cdc28c701f07f7ff99e91c2
MD5 4853686117ad1318df1de357452ded0a
BLAKE2b-256 e04f3ea5477ef66e6b3cb2d6cc774ab0f165eceb880f2504200f26e20e8be27b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page