Commit Graph

236 Commits

Author SHA1 Message Date
a 9970be19e5 more cleanup 2022-02-22 05:49:08 +00:00
a 77d85278a2 adjust path 2022-02-21 03:53:13 +00:00
a 5b93b66792 more converts 2022-02-21 03:32:53 +00:00
Azareal 6870d242e9 Add ClearIPs() to TopicStore.
Add LockMany() to TopicStore.
Add RemoveMany() to TopicCache.
Add ClearIPs() to PollStore.
Add Purge() to RegLogStore.
Add DeleteOlderThanDays() to RegLogStore.
Add Purge() to LoginLogStore.
Add DeleteOlderThanDays() to LoginLogStore.
Add SetInt() to MetaStore.
Add SetInt64() to MetaStore.

Use Createf() in RegLogItem.Create()
Use Count() in SQLRegLogStore.Count()
Use Count() in SQLLoginLogStore.Count()
Use Countf() in SQLLoginLogStore.CountUser()

Add trailing triple dot parser test case.
Removed a block of commented code in gen router.
Reduce boilerplate.
2021-04-27 20:20:26 +10:00
Azareal 868a530f4b block floc
disable expfix1
2021-04-10 20:06:22 +10:00
Azareal 5bdda5c573 move router init() into non-generated router.go
experimental fix for conn hangs
2021-04-08 12:20:57 +10:00
Azareal c60118e7c4 WIP forum action code. Currently disabled.
Add Http Conn Count tracking.
Move more panel phrases into the panel namespace.
Use a string builder in hookgen.
Use Countf() in a couple of places to eliminate boilerplate.
Reduce prepared stmt boilerplate in forum store with a lambda.
Reduce prepared stmt boilerplate in topic.go with a lambda.
Reduce prepared stmt boilerplate in group.go with a lambda.
Add TestSetCreatedAt method to *Topic.
Add DateOlderThanQ method to *accDeleteBuilder and *accUpdateBuilder.
Add Stmt method to *accUpdateBuilder and *AccSelectBuilder.
Add AccBuilder interface.
Shorten variable names.
Shorten extractPerm name to ep.
Add avatar_visibility setting stub. Implementation coming in a later commit.
Don't set an IP for installer generated posts.

Add counters_perf_tick_row hook.

Add avatar_visibility phrase.
Add avatar_visibility_label phrase.
Rename forums_no_description to forums_no_desc.
Rename panel.forums_create_description_label to panel.forums_create_desc_label.
Rename panel.forums_create_description to panel.forums_create_desc.
Rename panel_forum_description to panel.forum_desc.
Rename panel_forum_description_placeholder to panel.forum_desc_placeholder.
Add panel_debug_http_conns_label phrase.
Add panel.forum_actions_head phrase.
Add panel.forum_actions_create_head phrase.
Add panel.forum_action_run_on_topic_creation phrase.
Add panel.forum_action_run_days_after_topic_creation phrase.
Add panel.forum_action_run_days_after_topic_last_reply phrase.
Add panel.forum_action_action phrase.
Add panel.forum_action_action_delete phrase.
Add panel.forum_action_action_lock phrase.
Add panel.forum_action_action_unlock phrase.
Add panel.forum_action_action_move phrase.
Add panel.forum_action_extra phrase.
Add panel.forum_action_create_button phrase.

You will need to run the patcher / updater for this commit.
2021-04-08 00:23:11 +10:00
Azareal 6b645f7b88 Add Config.DisableBadRouteLog setting.
Surface more errors in template_init.go
Dump unknown UAs properly when DisableSuspLog is enabled.
2021-03-26 09:06:35 +10:00
Azareal d47540391a Add Config.LogDir and Config.DisableSuspLog settings.
Reduce default Config.PostIPCutoff from 120 to 90.
Add another startup log call.
2021-03-24 18:08:37 +10:00
Azareal f073f29a09 detect seostar, pandalytics, pagething user agents
detect kw iso code
fix suspicious req pre lines being mashed onto one line
2021-03-24 06:59:34 +10:00
Azareal 20a35fc211 rotate the suspicious req logs
reduce the number of bytes used by each req dump and don't log raw query when it is blank
reduce the number of double suspicious req logs for the same req
reduce the number of strings contains scans in the router
split the constant parts of gen_router.go into router.go
reduce boilerplate in a few spots
2021-03-23 19:57:50 +10:00
Azareal 69f6b9c9c5 refactor rank precedence with precedence struct in router gen
add precedence tests
remove dead code from router gen
make more strides towards using writers in router gen
optimise dump request
2021-03-18 15:10:20 +10:00
Azareal b9d94d0888 hoist runnables shared among all routes in a route group to the route group to reduce code duplication
rewrite router gen to make indentation maintenance easier
2021-03-18 10:22:28 +10:00
Azareal 75561508c8 don't log referer when DNT header is set
skip Cookie headers in req logs
2021-03-02 18:47:36 +10:00
Azareal 4126e8ed0c add qwant, xenforo, twingly, linkfluence, and new toutiao user agent.
add Users.CountSearch test cases.
add Users.SearchOffset test cases.
add more Users.Count test cases.
add more Users.BulkGetByName test cases.
reduce boilerplate in other tests.
fix bugs in Users.CountSearch and Users.BulkGetByName
2021-03-02 17:22:32 +10:00
Azareal e49a79014b Log suspicious requests in a seperate log file.
Optimise the request logger.
Avoid converting from byte slice to string in router gen.
2021-02-27 16:52:51 +10:00
Azareal de2221f243 fix main.css not being served on /topics/
panic when we try to reference an agent which doesn't exist in gen router init
2021-02-18 09:37:20 +10:00
Azareal 1f0713bb27 add wappalyzer, yacy user agents
fix mj12bot user agent parsing
numbers should now work in user agent marks
2021-02-17 15:27:56 +10:00
Azareal 0740b3bf14 Reduce user agent mark boilerplate in router gen.
Fix PetalBot detection.
2021-02-17 10:07:11 +10:00
Azareal 74e0ce492d Weekly Views.
Add avif mime extension.
Optimise skipping watched files which haven't been changed.
Block zgrab to save resources.
Reduce text and boilerplate.

Add route_topic_list_weekviews_start hook.

Add topic_list.week_views_filter phrase.
Changed footer_powered_by phrase.

You will need to run the updater / patcher for this commit.
2021-01-03 07:46:24 +10:00
Azareal 75d1d6fcbe add telegram, domcop, maui and alt aspiegel user agents
reduce boilerplate in routergen
2020-05-29 08:41:19 +10:00
Azareal d0bc74f58f add cocolyze, babbar, surdotly, awesome_bot user agents
reduce matching in the router slightly
use hookgen for router_after_filters
use hookgen for router_pre_route
shorten ua buffer variable name
skip more symbols in initial ua loop
shorten vulnscan string
avoid unneccessary fork in ua logic
2020-05-27 07:08:13 +10:00
Azareal 584a50b461 reuse gzip writers with a sync pool 2020-04-13 14:54:47 +10:00
Azareal faf215f388 try speeding up static files with brotli
track ref routes for a bit to debug them
hit more bots with MicroNotFound
2020-04-13 13:28:52 +10:00
Azareal 1dc69ed89e add headless chrome ua 2020-04-12 18:33:24 +10:00
Azareal 7d30a66d26 try to filter out bot referrers more effectively
megaindex update didn't save properly
2020-04-09 19:30:51 +10:00
Azareal 49a3837621 add netcraft user agent and alt mj12bot matcher 2020-04-04 19:03:11 +10:00
Azareal 4d45fb8710 add burf.co user agent 2020-04-04 13:21:59 +10:00
Azareal afb05ab409 add nimbostratus user agent 2020-04-04 13:10:18 +10:00
Azareal 21d09db477 add CCBot user agent 2020-03-31 23:10:29 +10:00
Azareal fc6544d620 add mattermost ua
save bytes in req dump

phrases:

rename panel_group_promotion_registered_for to panel_group_promotion_reg_for
rename panel_group_promotion_registered_months_suffix to panel_group_promotion_reg_months_suffix
rename panel_group_promotion_registered_days_suffix to panel_group_promotion_reg_days_suffix
rename panel_group_promotion_registered_hours_suffix to panel_group_promotion_reg_hours_suffix
2020-03-28 15:39:05 +10:00
Azareal b53577a126 fix MicroNotFound
reduce allocs in cdn push
2020-03-27 22:00:29 +10:00
Azareal 3adee57b37 save allocs in router
better logging for bad char in path
router_pre_route hook now returns properly
2020-03-27 16:05:35 +10:00
Azareal a668cd296b save bytes in the client templates
rename template file and functions to reduce bandwidth usage
replace x-loggedin with theoretically faster x-mem
remove redundant check in ua loop
move extraData initialisation down to where it's needed
2020-03-23 09:14:08 +10:00
Azareal 6b7c51a604 eliminate extraData related allocs in /s/ hot path
shorten generated simple bot bits
2020-03-22 16:24:31 +10:00
Azareal ade8f82af7 add python and go user agents.
add new bot class for python, go and curl to reduce resource usage.
don't push canonicals for loggedin users
try to avoid pushing google site verify when it isn't necessary
give ahrefs the semrush treatment
2020-03-22 14:37:45 +10:00
Azareal 22ec566a2c add website datenbank user agent
reduce redundancy and fix sublties in StaticFile()
2020-03-21 17:44:33 +10:00
Azareal 6a7b8fd3ee map msnbot to bing and avoid bytes for ahrefs too 2020-03-19 07:21:06 +10:00
Azareal b66a494f1c Revert "Revert "will a pointer make this faster...?""
This reverts commit 501bcc2425.
2020-03-18 19:21:34 +10:00
Azareal 501bcc2425 Revert "will a pointer make this faster...?"
This reverts commit 8e414486b8.
2020-03-15 21:34:57 +10:00
Azareal 8e414486b8 will a pointer make this faster...? 2020-03-15 17:06:44 +10:00
Azareal 8d19048c0d reduce bytes used on semrush 2020-03-14 12:09:18 +10:00
Azareal bfea6b740f add cliqz, blexbot, curl user agents
add a /static/ redirect for the slower bots x.x
tweak slack, facebook ua phrases
avoid more allocs for ajax topic
2020-03-13 16:37:18 +10:00
Azareal aa32bd335c try to avoid as many upfront gzip allocs to avoid wasting resources when they're not needed
avoid gzip for guests on routeAPI
2020-03-12 16:52:26 +10:00
Azareal 64ec820453 add MojeekBot user agent 2020-03-11 18:54:11 +10:00
Azareal d43bffdec5 experiment with ajax load for topic
track route perf for BadRoute
2020-03-11 13:26:33 +10:00
Azareal d586220df2 add alternate duckduckgo ua 2020-03-09 20:49:22 +10:00
Azareal 28f210371e try to optimise routeAPI 2020-03-09 15:16:44 +10:00
Azareal f5c9a34fdd simple top forum topiclist caching
reduce thaw period to 4
fix the _ ua bug
try using a hard period for routeAPI to avoid unneccessary churn for a return string that is unlikely to change
2020-03-08 18:04:37 +10:00
Azareal 6387e2bce0 fix safari ua matcher 2020-03-08 14:36:27 +10:00