Skip to content

Add support for addon-specific environment variables and secrets management #2896

@tiborrr

Description

@tiborrr

Add Environment Variables Support for Addons

Problem

Docspell addons need a secure and standardized way to handle environment variables and secrets. Currently, there's no built-in way to pass environment variables to addons.

Proposed Solution

docspell.joex.addons {
  configs = [
    {
      name = "my-postgres-addon"
      enabled = true
      envs = [
        {
          name = "POSTGRES_HOST"
          value = "localhost"
        },
        {
          name = "POSTGRES_PASSWORD"
          valueFrom = { # future feature
            env = "DS_POSTGRES_PASSWORD" 
          }
        }
      ]
    }
  ]
}

Environment Variable Mapping

DOCSPELL_JOEX_ADDONS_CONFIGS_0_NAME="my-postgres-addon"
DOCSPELL_JOEX_ADDONS_CONFIGS_0_ENVS_0_NAME="POSTGRES_HOST"
DOCSPELL_JOEX_ADDONS_CONFIGS_0_ENVS_0_VALUE="localhost"
DOCSPELL_JOEX_ADDONS_CONFIGS_0_ENVS_1_NAME="POSTGRES_PASSWORD"

Key Features

  • Simple array-based configuration
  • Support for direct values and environment variable references
  • Extensible valueFrom field for future secret providers
  • Consistent with Docspell's configuration style

Future Extensions

The valueFrom field can be extended to support additional providers like:

  • File-based secrets
  • HashiCorp Vault
  • Kubernetes secrets
  • Cloud provider secret managers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions