-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add ability to disable audit logs #6004
Add ability to disable audit logs #6004
Conversation
@@ -763,6 +763,9 @@ instance: | |||
securitytxt: | | |||
Contact: https://github.com/Chocobozzz/PeerTube/blob/develop/SECURITY.md | |||
Expires: 2025-12-31T11:00:00.000Z' | |||
logs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already have a log section: https://github.com/Chocobozzz/PeerTube/blob/develop/config/default.yaml#L230
Please also add this block to production.yaml.example
@@ -136,4 +136,27 @@ <h2 i18n class="inner-form-title">CUSTOMIZATIONS</h2> | |||
</div> | |||
</div> | |||
|
|||
<div class="row mt-4"> <!-- cache grid --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove HTML comments
<div class="col-12 col-lg-4 col-xl-3"> | ||
<div class="anchor" id="customizations"></div> <!-- customizations anchor --> | ||
<h2 i18n class="inner-form-title">LOGS</h2> | ||
<div i18n class="inner-form-description"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description of this block is invalid
</div> | ||
|
||
<div class="logs"> | ||
<div *ngIf="loading" i18n>Loading...</div> | ||
|
||
<div #logsElement> | ||
<div *ngIf="!loading && logs.length === 0" i18n>No log.</div> | ||
<div *ngIf="isAuditLog && !isAuditLogsEnabled" i18n>Audit logs disabled.</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isAuditLog
is a function so isAuditLog()
Also transform isAuditLogsEnabled
to a function. is..
is for functions, if you still want to have a variable then prefer auditLogsEnabled
. But it's better to have a function to not mix variables/functions if we can avoid
<div *ngIf="!loading && logs.length === 0" i18n>No log.</div> | ||
<div *ngIf="isAuditLog && !isAuditLogsEnabled" i18n>Audit logs disabled.</div> | ||
|
||
<div *ngIf="!loading && logs.length === 0 && isAuditLogsEnabled" i18n>No log.</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If audit logs is disabled but you're on the normal logs, you'll never see this message
I suggest to simplify lines 41/43 using an Angular else for example (not easy to use, but will be simpler in the future with the new Angular markup language: https://blog.angular.io/meet-angulars-new-control-flow-a02c6eee7843).
}) | ||
|
||
await server.videos.upload({ attributes: { name: 'video 12' } }) | ||
await waitJobs([ server ]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just upload one video to test audit logs. Test 403 if disabled, but also the audit log was not filled when it was disabled (so re-enable the feature and check the audit log doesn't contain your upload)
You may not want to actually have this as a feature, as it may violate some of the requirements for the Digital Services Act (e.g., to be able to provide evidence as to what an admin/moderator did and when. The only case that I could see this being argued for is on a single-user instance, but even then audit logs are useful in case you forget doing something. |
Audit logs would be enabled by default. But the instance is owned by the admin, so we give them the choice as this feature has been requested by some of them :) |
Maybe so, but they're still an important feature for trust & safety (and as noted in other issues can be used to implement features for things like actions taken on reports) It'd be good to know why they want to disable the audit logs? What problem are the audit logs creating that could necessitate them needing to be disabled? |
Closing due to inactivity. Does not hesitate to ask for the reopening :) |
Description
Add ability to disable audit logs in admin panel
Related issues
Fixes #2686
Has this been tested?
Screenshots