Commit Graph

1310 Commits

Author SHA1 Message Date
Azareal 513bb3c967 Push debug.go too. 2021-05-03 10:45:39 +10:00
Azareal 77291e4b44 Add ScheduledTasks and TaskSet interfaces.
Add unlisted LogLongTick developer setting.
Rearrange the order of the shutdown signal handler to figure out where it might fail.
2021-05-03 10:36:29 +10:00
Azareal 6766fd659c fine, update this file too 2021-05-02 18:54:40 +10:00
Azareal fc5b29e648 Add TickLoop struct.
Add a number of new test cases and refactor others.
Replace NotifyOne() with ActivityMatches.Add()
Shorten arr_ to a_ in tmpl_list.go
Reduce boilerplate.
2021-05-02 18:47:19 +10:00
Azareal 78fbbcda21 Optimise template generator.
Optimise mysql adapter.
Add TokenScope to mysql adapter.
Add SimpleBulkInsert() to installer.
Optimise panel.Plugins() route.
2021-04-30 08:33:02 +10:00
Azareal 39ace845b7 Add BulkExistsFunc() to LikeStore.
Add AddScheduledDayTask() and ScheduledDayTaskCount()
Reduce boilerplate.
2021-04-29 22:59:48 +10:00
Azareal ea4da062c3 Use Rstore.Exists() instead of Rstore.Get() in ReplyEditSubmit.
Reduce allocs in WsHubImpl.getUsers()
Reduce allocs in wolContextRender()
Use b.String() instead of string(b.Bytes()) in preparseWidget()
Reduce boilerplate.
2021-04-28 19:29:15 +10:00
Azareal 0c1f5cac94 Add ActivityMatches store impl.
Comment out errorBuffer.
Optimise LogWarning() with a string builder.
Avoid allocing byte slice in MicroNotFound()
Rename basePage to bp.
Reduce boilerplate.
2021-04-28 18:39:08 +10:00
Azareal 01a19ede79 Add Exec() to accDeleteBuilder.
Add DateOlderThanQ() to accCountBuilder.
Add Stmt() to accCountBuilder.
Add AccExec interface.
Optimise AccSelectBuilder.In() with a string builder.
Use Count() in DefaultActivityStream.Count()
Reduce boilerplate and duplication.
2021-04-27 20:35:10 +10:00
Azareal aa02f9fc48 Add Count()
Add Createf()
Fix inqbuild2() loop.
2021-04-27 20:24:04 +10: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 1b7d6ac724 Add ClearIPs() to ProfileReplyStore.
Add ClearIPs() to ReplyStore.
Add ClearLastIPs() to UserStore.
Use Count() in SQLProfileReplyStore.Count()
2021-04-27 20:00:11 +10:00
Azareal 67a968caf2 Add DisableLoginLog config setting.
The tests / tickloop portions (to purge existing login logs when the setting is enabled) are coming with the tickloop rewrite.
2021-04-27 19:44:00 +10:00
Azareal 0c0f265daf Add missing DisableRegLog config setting to configuration.md 2021-04-27 19:01:45 +10:00
Azareal 868a530f4b block floc
disable expfix1
2021-04-10 20:06:22 +10:00
Azareal a7b2659cde fix topic store error surfacing
reduce boilerplate in database.go
2021-04-08 15:01:27 +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 7733cf5cdc fix patcher query 2021-04-08 10:36:48 +10:00
Azareal cbee05fd3e enable forum actions
add more forum action test cases
shorten variable names
2021-04-08 10:14:24 +10:00
Azareal 347308387f don't forget the query generator
eliminate boilerplate in the query generator
add avatar_visibility setting
2021-04-08 03:37:41 +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 943a684332 comment this part to push the commit sooner 2021-04-07 14:23:26 +10:00
Azareal 14b098bac2 Add DisableStdout config setting.
Add DisableStderr config setting.
Eliminate boilerplate in main.go
Increase the number of cached q strings.
Use the ErrLogger in LogError() and LogWarning()
Add the experimental LocalErrorf()
Add Err() log function.
2021-04-07 12:10:05 +10:00
Azareal b5e8cbf87c rotate log files each week
use the current timestamp rather than the startup timestamp for new log files
2021-04-07 11:07:24 +10:00
Azareal 7b3cf6877f add basic support for ipns uris 2021-04-05 17:56:38 +10:00
Azareal ba1d68eea7 add basic support for ipfs links
shorten data variable names
add five parser tests
2021-04-05 16:03:53 +10:00
Azareal a9288d3e29 shorten tblKey to tK 2021-04-03 19:28:00 +10:00
Azareal a4ba5a2470 Optimise part of fout with string builders in the template generator. 2021-03-29 06:57:49 +10:00
Azareal cb2efa0d31 Optimise template list generation.
Remove dead code.
2021-03-28 18:24:48 +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 f6a94d39d6 Set the metadata for the last reply rather than the first in a topic when a reply is deleted.
Add tests to check the LastReplyID for a topic before and after a reply is deleted.
2021-03-25 19:04:02 +10:00
Azareal 6446a1fa4c Add LastReplyID, simple LastReplyAt, and LastReplyBy topic reply tests.
Simplify state tracking in testReplyStore by using a fresh topic on each call.
Avoid repeating the TID so much in topic reply tests.
2021-03-25 07:39:27 +10:00
Azareal c1343136c6 Update Topic.LastReplyID properly. 2021-03-25 06:01:40 +10:00
Azareal 335c1f96c4 Shorten expect to ex and expectf to exf in tests.
Reduce boilerplate in tests in other ways like a heavier use of first order functions.
Add missing AdminOnly tests in TestPermsMiddleware.
Add preliminary test of LastTopicID, TopicCount, and LastPage for topic creation on forums.
Fix FPStore check in anonymous function in TestForumPermsStore.
Test forum perm changes against specific groups and the ViewForum route.
Add alert deletion test.
Add preliminary topic list test cases.
benchmark things
2021-03-24 22:48:36 +10:00
Azareal 300defd460 Add TopicListIntTest interface.
Use inqbuild2 in DefaultTopicList.Tick.
Avoid doing a full paginator calculation in the topic list when the result is obvious.
Add defaultPagi and setForumList methods to DefaultTopicList.
Cache two more items in qcache.
Use a string builder in inqbuild and inqbuildstr.
Add the inqbuild2 function.
Reduce boilerplate in topic.go
2021-03-24 22:07:46 +10:00
Azareal 26e8bf32a7 Add GetForRenderRoute to DefaultAttachmentStore.
Use ErrCorruptAttachPath in DefaultAttachmentStore.
Consider the possibility that the requested attachment doesn't have a file extension.
Rename variables to reduce boilerplate.
Add TestThaw.
Avoid an allocation in hookgen.

Add route_attach_start hook.
Add route_attach_post_get hook.
2021-03-24 21:45:18 +10:00
Azareal adfed477a0 Avoid recomputing some values unneccessarily in the new poll loop.
Avoid duplication in reply.go with ReplyActPre.
2021-03-24 21:24:41 +10:00
Azareal faa8be12bb revert Config.LogDir for ops log
rotate other req dump logs
don't create the suspicious reqs log file when it is disabled
2021-03-24 20:50:22 +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 1d747a6f68 avoid holding the req log lock for so long 2021-03-24 13:25: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 93b6e28cd7 Oops, remember to hook up this bit.
Reduce boilerplate in tickloop.
2021-03-23 20:21:56 +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 db6bccb7ec rename router.go to old_router.go 2021-03-23 18:17:07 +10:00
Azareal 1fa6b3ff26 Optimise MemoryForumPermsStore by splitting recalcCanSeeAll out of Reload and only calling it once.
Reduce the amount of lock contention in recalcCanSeeAll by only loading each forum once.
Stop logging the group ID twice in recalcCanSeeAll.
Add the CacheAdd method to GroupCache and use it.
Reduce the amount of boilerplate.
2021-03-22 19:58:13 +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 301e7c6bea Add initial test cases for GetByName and BulkGetByName.
Eliminate boilerplate with expectf.
2021-02-28 12:23:05 +10:00