Skip to main content

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

Metadata

Release files for roco 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for roco 0.4.4
File Size Uploaded Provenance
roco-0.4.4.tar.gz 6.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for roco 0.4.4
File Interpreter ABI Platform
roco-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / roco-0.4.4.tar.gz

Download URL roco-0.4.4.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8f2bd6df42a695871f4fd2fd777726058d22b1bfe4a9c8f1220658e6cc88907b
BLAKE2b-256 checksum
How to use checksums
25e3e77b3566270ca25c849a529270df4e04fd83171743cb6dd0be2fcae7c8ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/6.5.0-1018-azure

Release files / roco-0.4.4-py3-none-any.whl

Download URL roco-0.4.4-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d305bbe79c86aad101a862dd162b7a9f4c6f7dc57cdc28c701f07f7ff99e91c2
BLAKE2b-256 checksum
How to use checksums
e04f3ea5477ef66e6b3cb2d6cc774ab0f165eceb880f2504200f26e20e8be27b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/6.5.0-1018-azure

Security for roco 0.4.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page