feat(config): market-specific URLs via config partial (alt to #118)#121
Merged
Conversation
6e38bc0 to
bb8c539
Compare
There was a problem hiding this comment.
Pull request overview
This PR proposes a declarative, market-aware approach for IONOS URLs by resolving links at runtime from a config partial (based on MARKET), avoiding imperative occ config:system:set writes and adding CI checks to enforce that policy.
Changes:
- Make
configs/ionos-links.config.phpresolve market-specific URLs fromMARKETwith a DE fallback. - Remove the last
config:system:setfromconfigure.shby movinglookup_serverinto a config partial. - Add CI workflows/scripts to (a) forbid
config:system:setusage in shell scripts and (b) validate config partial URL structure across markets.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
configure.sh |
Removes imperative lookup_server write and logs effective market link config via read-only config:system:get. |
configs/nc-server.config.php |
Introduces declarative lookup_server config to replace shell-based mutation. |
configs/ionos-links.config.php |
Implements market-aware link selection via MARKET with a fallback. |
.github/workflows/shell-config-check.yml |
Adds CI job to run a shell-script policy check (currently has invalid YAML indentation). |
.github/workflows/config-validation.yml |
Adds CI job to lint config partials and validate URLs (currently has invalid YAML indentation). |
.github/check-shell-config.sh |
Implements repository scan for config:system:set in *.sh files. |
.github/check-config-urls.php |
Validates required IONOS URL keys and https schemes across markets with warnings/notices promoted to failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0d20cd9 to
05a112a
Compare
33ebf9a to
35512c8
Compare
Moves the empty lookup_server setting out of the configure.sh runtime script and into configs/nc-server.config.php so it is applied declaratively at config-load time. This eliminates the only config:system:set usage in shell scripts and unblocks adoption of the shell-config-check workflow. The partial config file is picked up automatically by the add_config_partials Makefile target which copies all IONOS/configs/*.config.php into Nextcloud's config/ directory. Backport of 3c1cd2e from master (adapted: this branch still uses the ooc() helper rather than execute_occ_command). Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
… usage in shell scripts Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Resolve IONOS links from the MARKET env var declaratively in ionos-links.config.php (IIFE-scoped, ionos_peer_products nesting, DE fallback) instead of imperatively via config:system:set in configure.sh. Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Add a read-only log_market_config() that echoes MARKET and the effective IONOS links via config:system:get, so the resolved values appear in the pod log for troubleshooting. Called from main() after config_ui. Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Add check-config-urls.php (loads ionos-links.config.php for every MARKET with PHP notices promoted to failures; asserts required link keys are well-formed https URLs) and a config-validation workflow running php -l plus the check. Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
When running in GitHub Actions (GITHUB_ACTIONS=true), check-config-urls.php now emits workflow commands: collapsible per-market ::group:: sections, inline ::error annotations pointing at the offending line in the partial (and a final ::notice on success), plus a job-summary table via GITHUB_STEP_SUMMARY. Outside CI the output stays plain text and exit codes are unchanged. Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
35512c8 to
ceb3782
Compare
bromiesTM
approved these changes
Jun 5, 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.
Alternative to #118 — market URLs via config partial
PR #118 sets market-specific IONOS URLs imperatively in
configure.shthrough aset_market_links()bashcasethat callsooc config:system:set .... This branchproposes a declarative alternative and aligns with the no-
config:system:setpolicyalready adopted on
master.What changes
configs/ionos-links.config.phpis now market-aware: it resolves theMARKETpod env var and returns the matching links (FR/DE/ES/UK/IT, DE fallback for
unset/invalid). Single declarative source of truth, evaluated per request — no
imperative
occwrites, no persisted-state drift. The logic is wrapped in an IIFE soonly
$CONFIGenters Nextcloud's config-loader scope, andionos_webmail_target_linkstays nested under
ionos_peer_products(as the theme reads it).master:a7a6bd0,cf4ae3a) —CI fails on any
config:system:setin shell scripts.config:system:set:lookup_servermoves to a newconfigs/nc-server.config.php(replicating master3c1cd2e), so the check passes.log_market_config()inconfigure.shlogsMARKETand the effective links(read-only
config:system:get) for pod-log troubleshooting.config-validationworkflow (.github/check-config-urls.php): loads thepartial for every market with PHP notices promoted to failures, and asserts each
required link key is a well-formed
httpsURL — catching broken PHP, droppedschemes, and missing/renamed keys.
Verification
./.github/check-shell-config.sh→ passes (noconfig:system:setin shell).php -lon allconfigs/*.config.php.php .github/check-config-urls.phppasses, and was confirmed to fail on a broken URLand a missing key.
Closes the approach discussion on #118 (does not auto-close the PR).