Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic inclusion of plugin-specific configuration #197

Open
3 tasks done
jmozd opened this issue Oct 19, 2022 · 1 comment
Open
3 tasks done

Automatic inclusion of plugin-specific configuration #197

jmozd opened this issue Oct 19, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@jmozd
Copy link

jmozd commented Oct 19, 2022

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Summary

When using the YOURLS Docker container via Helm chart, there seems to be no way to automatically include plugin configuration. Only a list of pre-defined env vars are supported, adding more requires replacing the config-docker.php file.

Automatic inclusion of additional config files in a well-known location would allow for easy deployment of plugin-enhanced containers via extra volume mounts.

Motivation

Automatic container deployment via Kubernetes (i.e. via Helm) is becoming more typical. When doing this, the typical way to specify configuration is via environment variables or by mapping "files" to well-known locations inside the container.

The YOURLS container already has (basic) support for this, for a number of well-known env vars drawn in by config-docker.php. But adding additional configuration requires replacing that file (which can be done via above mapping mechanism).

A more elegant version might be to automatically pull in extra config files (one or more files for each plug-in, via Kubernetes' file mapping ("secret"/"configmap") from config-docker.php. This way, per-plugin configuration is made possible, including re-use of the "get values from Docker env" mechanism already available in config-docker.php

Describe the solution

  • define a well-known location for plug-in config files, i. e. "/var/www/html/user/plugins/config.d"
  • extend config-docker.php with
foreach ( glob( "/var/www/html/user/plugins/config.d/*.php") as $pluginconfig) {
        include $pluginconfig
}

at the end of the file, to include the config files from above well-known location.

  • Alternatively, make the location configurable via env var and only run the "foreach" if the location value is set.
@jmozd jmozd added the enhancement New feature or request label Oct 19, 2022
@jmozd
Copy link
Author

jmozd commented Oct 21, 2022

see #199 for a sample implementation

@LeoColomb LeoColomb changed the title automatic inclusion of plugin-specific configuration Automatic inclusion of plugin-specific configuration Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant