Skip to main content

Runtime Config Generator

Project description

Roco - Runtime config generator

Command line utility tool which prints to the standard output javascript valid text generated from environment variables.

For example, given following environment variables:

PAPERMERGE__AUTH__GOOGLE_CLIENT_ID=some-id.apps.googleusercontent.com
PAPERMERGE__AUTH__GOOGLE_AUTHORIZE_URL=https://accounts.google.com/o/oauth2/auth
PAPERMERGE__AUTH__GOOGLE_REDIRECT_URI=http://localhost:11000/google/callback

will result in the following text (valid javascript) as output:

window.__PAPERMERGE_RUNTIME_CONFIG__ = {
  oauth2: {
    google: {
      client_id: 'some-id.apps.googleusercontent.com',
      authorize_url: 'https://accounts.google.com/o/oauth2/auth',
      redirect_uri: 'http://localhost:11000/google/callback',
      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 -s

The above command will also show the env var prefix i.e. PAPERMERGE__AUTH__.

Roco reads from following environment variables:

  • PAPERMERGE__AUTH__GOOGLE_AUTHORIZE_URL
  • PAPERMERGE__AUTH__GOOGLE_CLIENT_ID
  • PAPERMERGE__AUTH__GOOGLE_REDIRECT_URI
  • PAPERMERGE__AUTH__GITHUB_AUTHORIZE_URL
  • PAPERMERGE__AUTH__GITHUB_CLIENT_ID
  • PAPERMERGE__AUTH__GITHUB_REDIRECT_URI
  • PAPERMERGE__AUTH__LDAP_URL

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.3.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

roco-0.3.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file roco-0.3.0.tar.gz.

File metadata

  • Download URL: roco-0.3.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.12.2 Linux/6.2.0-1019-azure

File hashes

Hashes for roco-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8d8d20ac7538e3f390cb7569abcb2c75588c091d6179c56acbb8bb75c56b619f
MD5 b3f3d0d66d84b7fd8d1e8b00ecf2ebaf
BLAKE2b-256 c514f64dd115548e6abb0186de731ba9db6edb362131247e1a3861ae0bd1f93a

See more details on using hashes here.

File details

Details for the file roco-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: roco-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.12.2 Linux/6.2.0-1019-azure

File hashes

Hashes for roco-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4697323c5b7e9889fe5df41319335bade56852e32ebe4b33ba0fbd651fb43824
MD5 6048fe8f4f25583f9b2b33bb853b73bf
BLAKE2b-256 85dcd981ff2b73d3088fd7a5b5c6937a6e0da7a685694b2a32c63b1b9d801a7b

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