autobrr/internal/http
soup c2fcd91da7
refactor(logs): improve log sanitization performance (#779)
* refactor log sanitization for better performance

* Fix token error, add mutex for safer concurrency

* serve sanitized version directly from memory

* further improvements

made it check for "module":"irc" before running the irc regex checks

* Revert "further improvements"

This reverts commit 260037c3a58e1e760613167d3e15136b313c0612.

* update irc regexes to handle special characters

- added prefixes to the irc patterns
- improved tests

* more improvements for irc regexes

* fixed errors

* another edge case bites the dust

* regex improvements

* lock to 1 worker if cpu cores is 2 or less

* removed unused code

* revert to single thread

Moved regex patterns and replacements into a separate array for easier maintenance and readability.

Optimized the regex patterns that share the same replacement string to avoid redundancy.

Modify SanitizeLogFile to accept io.Writer for direct output

* style

* only check relevant lines

- only check relevant lines
- dont break unless length=0

* revert breaking change

* handle api and auth cases

---------

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2023-03-26 23:25:23 +02:00
..
action.go feat(api): add apikey support (#408) 2022-08-15 11:58:13 +02:00
apikey.go feat(api): add apikey support (#408) 2022-08-15 11:58:13 +02:00
auth.go feat(http): improve invalid login handling (#597) 2022-12-31 01:04:41 +01:00
config.go feat(settings): make log level configurable from UI (#704) 2023-02-11 22:37:06 +01:00
download_client.go feat(clients): add support for qBittorrent 4.4.0+ (#558) 2022-12-10 19:25:04 +01:00
encoder.go feat(api): add apikey support (#408) 2022-08-15 11:58:13 +02:00
feed.go feat(feeds): view latest RSS and Torznab feed (#609) 2023-01-02 23:00:11 +01:00
filter.go feat(filters): improve list view with filtering (#465) 2022-09-22 11:54:17 +02:00
health.go feat(api): add apikey support (#408) 2022-08-15 11:58:13 +02:00
indexer.go feat(api): add apikey support (#408) 2022-08-15 11:58:13 +02:00
irc.go feat(irc): improve list view (#466) 2022-09-22 16:39:05 +02:00
logs.go refactor(logs): improve log sanitization performance (#779) 2023-03-26 23:25:23 +02:00
logs_sanitize_test.go refactor(logs): improve log sanitization performance (#779) 2023-03-26 23:25:23 +02:00
middleware.go chore(http): set log level to trace (#765) 2023-03-19 22:01:43 +01:00
notification.go feat(api): add apikey support (#408) 2022-08-15 11:58:13 +02:00
release.go feat(http/releases): report errors to end-users. (#596) 2022-12-31 00:35:44 +01:00
server.go feat(logs): make log files downloadable (#706) 2023-02-12 17:34:09 +01:00
update.go feat: show new updates in dashboard (#690) 2023-02-05 18:44:11 +01:00