feat(config): expose log.conditions via OWNCLOUD_LOG_CONDITIONS#487
Merged
Conversation
ownCloud core's 'log.conditions' (documented in config.apps.sample.php) is a list of condition maps mixing scalar and array values (apps, users, logfile, loglevel, shared_secret). The flat env-var idioms used elsewhere in config.php (explode/parse_str) cannot represent this nested structure, so it had no env-var equivalent in the image. Expose it through a single JSON-encoded env var. A json_decode result that is not an array (malformed JSON) is ignored so a bad value cannot break config generation. Applied to all three versions (v20.04, v22.04, v24.04). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
|
Docs to |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
mmattel
approved these changes
Jun 15, 2026
phil-davis
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Exposes ownCloud core's
log.conditionsconfig value through a newOWNCLOUD_LOG_CONDITIONSenvironment variable, parsed inoverlay/etc/templates/config.phpfor all three versions (v20.04,v22.04,v24.04).Why
log.conditions(documented in core'sconfig.apps.sample.php) is a list of condition maps mixing scalar and array values:The flat env-var idioms already used in
config.php(explode()for flat lists,parse_str()for a single key=value map) cannot represent a list of maps with nested arrays, so this value previously had no env-var equivalent in the image.How
A single JSON-encoded env var is the faithful representation:
Example:
OWNCLOUD_LOG_CONDITIONS='[{"apps":["files_external"],"loglevel":0,"logfile":"/var/log/oc-debug.log"}]'The
is_array()guard makes malformed JSON a no-op (key left unset, core falls back to default) rather than a fatal config-generation error.Testing
php -lclean on all three files.getConfigFromEnv()covering: valid single condition (all five fields, types preserved), valid multi-condition list, malformed JSON (ignored), and unset (key absent).🤖 Generated with Claude Code