Repository navigation
Add runtime log level override: system/server_setting, admin UI, docs - #553
Draft
nicdavidson wants to merge 3 commits into
Draft
nicdavidson wants to merge 3 commits into
nicdavidson wants to merge 3 commits into
Conversation
…nly (df-system#65+66 + df-admin-interface#552 + df-docs#137)
…em#65+66 + df-admin-interface#552 + df-docs#137)
Contributor
Author
…ess rule for nav, guard, link and card (df-system#65+66 + df-admin-interface#552 + df-docs#137)
Contributor
Author
This was referenced Oct 29, 2026
Keep per-run history and show running state for scheduled tasks
dreamfactorysoftware/df-scheduler#42
Draft
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.
Refs dreamfactorysoftware/df-system#65, dreamfactorysoftware/df-system#66, #552, dreamfactorysoftware/df-docs#137
What
log_level. Newserver_settingstable (migration included) andServerSettingmodel. Overrides are applied at boot on top of config and are never written into theconfig:cachefile. Stored overrides are cached for 60 s, so a warm boot makes noserver_settingsquery, with or without rows. Writes clear the cache; a cache failure falls back to the DB.system/server_settingresource (GET, PATCH/PUT, DELETE). Access is checked like any other system resource (cache,cors): full admins, or a role withserver_setting/*onsystem. Everyone else gets 403. Each successful change or reset writes aServer setting changedline (setting, old value, new value, user id) to its own fixed-level log channel. No-op changes are not audited..env/overridebadge, a level picker, Save, and a confirmed "Reset to .env value". After a save it links on to System Info. System Info and the overview Log Level tile get a "Change" link. The nav entry, deep link, System Info link and overview tile all use one rule: a full admin, or a restricted admin whose tabs include Config.system-settings/server-settingspage (allowed values, precedence,config:cache, effect timing across nodes, role-based access, curl examples with the real 403 body, audit log).basic-configuration.mdandsystem-api.mdlink to it.server_setting/*to the Config tab inRestrictedAdmin, so restricted admins created with Config get API access.Behavior change
system/server_setting, without editing.envor restarting. It applies immediately on the node that served the change. Other nodes with their own cache (file or array) pick it up within 60 seconds. Nodes with a shared cache (redis, memcached, database) pick it up on their next request. Queue and scheduler workers pick it up when restarted.APP_LOG_LEVEL. Removing the override restores the.envvalue.log_levelchanges the four channels that followAPP_LOG_LEVEL(single,daily,syslog,errorlog).stderr,slackand other channels with their own level are not changed.system/server_settingis role-based. A restricted admin created or re-saved with the Config tab getsserver_setting/*. Restricted admins created before this release keep their Config tab but do not haveserver_setting/*until a root admin opens them, changes any field (for example, clears and re-ticks one access tab) and saves. Until then they see the Server Settings entry and get "Could not load server settings." (403). Saving without changing anything sends nothing.server_settingstable (migration included). Until it exists, behavior is unchanged.sysAdminGuardis replaced byserverSettingsGuard, which waits for the restricted admin's real tabs.Tests
tests/ServerSettingsTest.php(18 tests) covers: override beats.envand reaches the channel levels; no row leaves config unchanged; disallowed keys and invalid levels are rejected; unknown rows are ignored at boot; boot without the table does not throw; API GET, PATCH and DELETE round trip; audit line written at the stockwarninglevel; invalid PATCH and no-op reset not audited; a role withserver_setting/*is allowed; a role without it gets 403;stderrstays untouched; a warm-cache boot makes no query (with and without rows); writes are visible on the next boot; a cache failure still applies the override.tests/RestrictedAdminsTest.php: a Config restricted admin's role getsserver_setting/*; a role with the old Config accesses still has the Config tab; a plain re-save grantsserver_setting/*to an existing Config admin.jest.config.ci.js. Playwrightserver-settings.spec.tscovers the full-admin flow and restricted-admin cases with and without Config.Summary lines on the branch:
Tests: 118, Assertions: 314, Errors: 2, Failures: 4, PHPUnit Deprecations: 2.|Tests: 11, Assertions: 28, Errors: 4, Failures: 1, PHPUnit Deprecations: 1.|Tests: 62, Assertions: 195, Failures: 3, PHPUnit Warnings: 1, PHPUnit Deprecations: 1, Skipped: 4, Risky: 4.|Tests: 49, Assertions: 92, Errors: 15, Failures: 2, PHPUnit Deprecations: 1, Risky: 14.Tests: 332 passed, 332 total; production buildOK build: 93 files; PlaywrightOK e2e: e2e/smoke.spec.ts e2e/server-settings.spec.ts.OK docs build(36 failures already present on base, listed in the known-failures file).Scope
log_levelonly. Repos changed: df-system, df-compliance, df-admin-interface, df-docs. The four PRs belong together. df-system must merge first, and df-compliance has no effect without it..env, restarting workers, a history table for audit, and a df-compliance migration that backfillsserver_setting/*into existing Config roles (it would grant privileges on existing data, so it needs a decision).Related issues
platform.log(level, message)): different feature. It only needs to respect the effective level..env-only.server_setting.Open questions for the team: whether to backfill existing Config restricted admins with a migration, whether a history table is wanted (the audit entry is a log line, not a durable store), and whether separate per-channel keys are wanted.
Existing bugs found but not fixed
optionalones. A hand-narrowed row (saycors/*limited to API requestors) gets a second, wider row on re-save. Fix: filter the kept-tab additions tooptionalentries.rootAdminGuardinadmin.guard.tswas deleted. Thedf-server-settings.service.tsdocblock still says "sys admin only". The i18n hint "Applies on the next request" ignores the up-to-60 s lag on other nodes.CHANGELOG.mdis not updated.testRoleWithoutServerSettingAccessForbiddenonly exercises df-core's role check, andtestConfigCacheDoesNotBakeOverriderepeats the provider's guard instead of runningconfig:cache. Neither would fail if this change broke.storage/logs, so it is not visible on installs usingLOG_CHANNEL=stderr. The docs name the path.Session::authenticatefails there. The tests seed the admin session directly.