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

Uploaded Source

Built Distribution

roco-0.2.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for roco-0.2.0.tar.gz
Algorithm Hash digest
SHA256 463edd5a0cdda72aa29d700528357a37f6637d59412df48733822295699e826f
MD5 3e90460c8cbeb4d1790650f7deab2839
BLAKE2b-256 9d67cd1e407cb5aba52221af558d8739dddd382d4a15271b1572eef243ab679d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for roco-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15f8ae701f7799fb2be18935a5f30842144bc845c6087f727bf64ae1cd48a6db
MD5 153918748c844f95470b8b68f3e389f2
BLAKE2b-256 53b56c49b006b1d132010cae201b34423cad3011f80ba7ebf212d3b29f68389a

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