Conversation
Add a `log.audit.enabled` configuration option, mirroring the existing `log.rotation.enabled` shape. The guard lives in `auditLoggerWrapper`, which every `create`/`update`/ `delete` audit call routes through, so the 13 `auditLoggerFactory` consumers need no change. Closes Chocobozzz#2686
m-altaifi
force-pushed
the
feat/disable-audit-logs
branch
from
September 1, 2026 15:28
1ac834f to
3b4d514
Compare
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.
Summary
Adds a
log.audit.enabledconfiguration option so admins can turn off the audit log, as requested in #2686.It mirrors the existing
log.rotation.enabledshape directly above it in the same section.Relation to #6004
@wickloww previously attempted this in #6004, which you closed for inactivity in Feb 2024 saying it could be reopened. I picked up the config-only part of it. Your review there asked for the option to live in the existing
log:section and to be added toproduction.yaml.exampletoo, so this PR does both.log.audit.enabledis also registered inchecker-before-init.tsalongside the otherlog.*keys, as that PR did.The one thing I deliberately left out is the admin-panel toggle that #6004 also added. #2686 asks for a config-file option, so this is the smaller change; the runtime toggle can follow separately if you want it.
One open question from your review of #6004: you asked for a 403 when audit logs are disabled. This PR only stops audit entries being written — reading previously written audit logs still works, so an admin who disables the feature can still consult history. If you would rather the read endpoint 403 as well, say so and I will add it.
Implementation
The guard is in
auditLoggerWrapper, the single function thatcreate,updateanddeleteall route through, so none of the 13auditLoggerFactoryconsumers need to change:config/config-schema.jsonwas regenerated withpnpm run generate-config-schemarather than edited by hand, since the schema usesadditionalProperties: false.Testing
Added one case to the existing
With the audit logblock inpackages/tests/src/api/server/logs.ts, following theShould not log ping/HTTP requestspattern: restart with the option off, upload a video, assert no audit entry is produced. This is the "check the audit log doesn't contain your upload" half of what you asked for on #6004. It is placed last in that block because it restarts the server with a different config.Verified locally:
pnpm run validate-config-schema— OK forconfig/default.yamland the Docker production configtsc -b server/tsconfig.jsonandtsc -b packages/tests/tsconfig.json— cleanoxlinton the touched files — cleanI did not run the API test suite locally as it needs a live PostgreSQL/Redis/ffmpeg stack.
I targeted
developrather thanrelease/v8.3.xsince this adds a configuration option; happy to retarget if you would rather it went into 8.3.Closes #2686