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__REDIRECT_URI=http://localhost:9000/callback
PAPERMERGE__AUTH__INTERNAL_TOKEN_URL=http://localhost:9000/api/token
PAPERMERGE__AUTH__GOOGLE_CLIENT_ID=some-id.apps.googleusercontent.com
PAPERMERGE__AUTH__GOOGLE_AUTHORIZE_URL=https://accounts.google.com/o/oauth2/auth

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

window.__PAPERMERGE_RUNTIME_CONFIG__ = {
  oauth2: {
    internal_token_url: 'http://localhost:9000/api/token',
    redirect_uri: 'http://localhost:9000/callback',
    google: {
      client_id: 'some-id.apps.googleusercontent.com',
      authorize_url: 'https://accounts.google.com/o/oauth2/auth',
      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__REDIRECT_URI
  • PAPERMERGE__AUTH__INTERNAL_TOKEN_URL
  • PAPERMERGE__AUTH__GOOGLE_AUTHORIZE_URL
  • PAPERMERGE__AUTH__GOOGLE_CLIENT_ID
  • PAPERMERGE__AUTH__GITHUB_AUTHORIZE_URL
  • PAPERMERGE__AUTH__GITHUB_CLIENT_ID

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

Uploaded Source

Built Distribution

roco-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: roco-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.4 Linux/5.19.0-42-generic

File hashes

Hashes for roco-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8038e79d7b26b63fe3f7750cec4ff2de13c5e0b86ba5a56bbd015a311857e335
MD5 c4c8840dd96af4e146f24150390ea4db
BLAKE2b-256 c9987cf55d701e085bcbaf208c310ab53cfd80a3c72617311db4c6cdf0c21902

See more details on using hashes here.

File details

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

File metadata

  • Download URL: roco-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.4 Linux/5.19.0-42-generic

File hashes

Hashes for roco-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3399bf5d3815dbfd6ca3a2a37f74abe46fe29a236084cc38ef99502d3528394
MD5 a7e11d287e172edb74d42963eb0863da
BLAKE2b-256 2e796d0a335a6abe3626a2710486cce11bb69513d796573d7ff9cd7738d7255a

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