Feat: Add syslog filter feature#2035
Conversation
WalkthroughThis pull request introduces a new system log filtering feature. A web interface ( Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant UI as SyslogFilter.page
participant UP as /update.php
participant SF as syslogfilter
participant RS as rsyslogd
U->>UI: Load filter settings from config file
UI->>U: Display syslog filtering form
U->>UI: Enter filter strings and submit form
UI->>UP: POST filter settings and parameters
UP->>SF: Process filter configuration file
SF->>RS: Update rsyslog configuration with new rules
SF->>RS: Restart rsyslog service if running
sequenceDiagram
participant RC as rc.rsyslogd
participant FS as File System
participant RS as rsyslogd
RC->>FS: Check existence of /boot/default/02-blocklist-extra.conf
alt File exists
FS-->>RC: File found
RC->>FS: Copy file to /etc/rsyslog.d/
else File not found
FS-->>RC: File missing
end
RC->>RS: Start rsyslog daemon
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (2)
emhttp/plugins/dynamix/scripts/syslogfilter (1)
16-18: Consider using constants for file paths.The script defines several file paths as variables. Consider defining these as constants using
define()orconstto prevent accidental modification.-$rsyslog_conf = "/etc/rsyslog.conf"; -$file = "/boot/config/plugins/dynamix/syslog_filter.conf"; -$filter_file = "/boot/default/02-blocklist-extra.conf"; +define('RSYSLOG_CONF', '/etc/rsyslog.conf'); +define('FILTER_CONFIG', '/boot/config/plugins/dynamix/syslog_filter.conf'); +define('FILTER_FILE', '/boot/default/02-blocklist-extra.conf');emhttp/plugins/dynamix/SyslogFilter.page (1)
48-51: Add confirmation dialog for Apply action.Consider adding a confirmation dialog before applying changes to prevent accidental modifications.
- <input type="submit" value="_(Apply)_"><input type="button" value="_(Done)_" onclick="done()"> + <input type="submit" value="_(Apply)_" onclick="return confirm('Are you sure you want to apply these filter changes?')"> + <input type="button" value="_(Reset)_" onclick="this.form.reset()"> + <input type="button" value="_(Done)_" onclick="done()">
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
emhttp/plugins/dynamix/icons/systemlogfilter.pngis excluded by!**/*.png
📒 Files selected for processing (3)
emhttp/plugins/dynamix/SyslogFilter.page(1 hunks)emhttp/plugins/dynamix/scripts/syslogfilter(1 hunks)etc/rc.d/rc.rsyslogd(1 hunks)
This feature adds a syslog filter page at Settings->User Utilities->System Log Filter to add strings to filter messages from the syslog. The filter applies to all logs of the Syslog Server
How it works:
Summary by CodeRabbit
Summary by CodeRabbit