Commit Graph

1285 Commits

Author SHA1 Message Date
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
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 f20b0bd936 Add BulkIsBlockedBy method to BlockStore.
Add TotalP to accCountBuilder.
Add EachP to AccSelectBuilder.
Add expectf.
Add more conversation test cases.
Refactor conversation tests.
Add block tests.
2021-02-27 16:13:03 +10:00
Azareal 9437561c76 Add BulkGetByName method to UserStore.
Add RawBulkGetByNameForConvo method to UserStore.
Add ErrSomeUsersNotFound error.
User Manager Search Experiment.
De-duplicate common user store scan logic.
Use inqbuild in BulkGetMap in UserStore.
2021-02-27 07:22:36 +10:00
Azareal 8decc0c1a8 add flif, heif, heic, bpg and opus to allowed file extensions
add flac web audio extension
eliminate aloocs with inqbuild and inqbuildstr
2021-02-19 13:28:20 +10:00
Azareal b66aeac966 fix some parser corner cases
add more parser test cases
2021-02-19 12:51:13 +10:00
Azareal 2176147dec fix parser tests
expand parser tests
2021-02-18 23:02:54 +10:00
Azareal f2adb7dfac add AutoLink permission
eliminate pointless arithmetic in the parser
possible fix for creating group promotions

add AutoLink phrase
2021-02-18 21:40:42 +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 3d2200bd18 test in 1.16 too 2021-02-17 09:23:29 +10:00
Azareal 6884c9afcc spread love
tweak variable names

phrases:
add convo_rand_0
add convo_rand_1
add convo_rand_2
add convo_rand_3
2021-01-25 09:16:54 +10:00
Azareal 70d66e7dd8 fix has param logic
fix paginator for search user by group
2021-01-20 18:10:50 +10:00
Azareal f69e077347 user manager: search by group
UserStore:
modify SearchOffset method signature
modify CountSearch method signature

phrases:
add panel_users_search_group
add panel_users_search_group_none
add panel_users_search_title

add missing paginator_mod template x.x
eliminate bytes here and there
2021-01-20 09:47:08 +10:00
Azareal 0bf1b6dbd3 make it clearer with a LocalError 2021-01-19 12:51:24 +10:00
Azareal 033ddb185d restrict email parameter to users with EditUserEmail perm 2021-01-19 12:48:49 +10:00
Azareal c9e99c075d basic user manager search
reduce template sizes
add PaginatorMod struct

UserStore:
add SearchOffset method
add CountSearch method

phrases:
add panel_users_search_head
add panel_users_search_name
add panel_users_search_name_placeholder
add panel_users_search_email
add panel_users_search_email_placeholder
add panel_users_search_button
2021-01-19 08:11:30 +10:00
Azareal e792dbc2c7 eliminate more boilerplate in tables.go 2021-01-07 19:15:39 +10:00
Azareal 1137d94d5b reduce boilerplate in tables.go 2021-01-07 18:37:21 +10:00
Azareal 74193223ee log errors properly in ForumsOrderSubmit
fix tiff extensions in canResize check
reduce boilerplate
2021-01-06 16:41:08 +10:00
Azareal 1c5967ad7e and the schema x.x 2021-01-03 08:25:08 +10:00
Azareal a43226f54a Oops. 2021-01-03 08:08:49 +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 43bace814d update .link_most_viewed properly on page transitions
reduce variable lengths
remove redundant thaw
2020-12-18 11:04:07 +10:00
Azareal fbcbfd9e96 add ComplexPrepare to AccSelectBuilder 2020-12-18 10:53:12 +10:00