ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.13k stars 2.8k forks source link

Added env. #6242

Closed SamTV12345 closed 3 months ago

SamTV12345 commented 3 months ago

This pull requests adds the possibility to add arbitrary settings as environment variables. This enables adding the configuration of plugins via environment variables.

To add an environment variable you need to prefix it with EP and two underscores. Generally two underscores separate an environment variable.

As an example we want to add ep_prefer_color_scheme with dark mode setting enabled.

For this we would need to add the following in settings.json

  const nightColors = {
    toolbar: 'dark',
    background: 'super-dark',
    editor: 'dark',
  }

We require 3 env variables, toolbar, background and editor. The following set this configuration

EP__nightColors__toolbar="dark"
EP__nightColors__background="super-dark"
EP__nightColors__editor="dark"

Closes #6195