Commit Graph

504 Commits

Author SHA1 Message Date
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 17c8f7604a rename avatar to img to save a few bytes in alerts 2020-03-12 13:29:19 +10:00
Azareal 61688a0c6d improve efficiency for small static files 2020-03-12 13:00:04 +10:00
Azareal 30b68945b4 guarantee more space for alerts 2020-03-12 11:08:56 +10:00
Azareal d43bffdec5 experiment with ajax load for topic
track route perf for BadRoute
2020-03-11 13:26:33 +10:00
Azareal aa303dc14d use empty string instead of 0 for pruned ips
eliminate a WriteRune call in BuildAlertSb
2020-03-09 17:11:58 +10:00
Azareal 28f210371e try to optimise routeAPI 2020-03-09 15:16:44 +10:00
Azareal b04d77d7b6 optimise topic lists by caching common qcounts for getList stmts
recalc forum topic counts
reduce thaw period to 3
cache top 8 forums instead of 5
optimise GetListByForum with zero topics
add Each method to ForumStore
2020-03-09 13:51:44 +10:00
Azareal 5007ddcb1e fix tests 2020-03-08 18:10:56 +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 7d2be466b3 optimise ua tracking
reduce number of bytes used when we don't know the lang
add more spammy domain strings
2020-03-08 14:15:27 +10:00
Azareal f3bdfffbed avoid allocs for guest alert etags
use phrase file modtime instead of instance start time for routeAPIPhrases to avoid cache churn
2020-03-07 12:59:06 +10:00
Azareal 83a2659b1c this too x.x 2020-03-07 07:55:26 +10:00
Azareal 133c240350 experiment with range header in StaticFile
optimise StaticFile with StrLength
add things i forgot yesterday
2020-03-07 07:52:58 +10:00
Azareal 8f21d34964 experiment with bce in plist 2020-03-05 14:43:40 +10:00
Azareal c31ca03a0d use string builder in buildFlexiWhere
add string builder growth hints
track favicon perf
2020-03-05 09:56:45 +10:00
Azareal 28daeee702 use string builder for alert api 2020-03-04 14:31:11 +10:00
Azareal 24107aaef1 initial reduce pointer derefs and improve bce in templates 2020-03-03 23:02:46 +10:00
Azareal 2330b5bfeb optimise topic list orderby
filter out forums with no topics from search queries
update go version in go.mod
2020-03-03 14:25:18 +10:00
Azareal 7c3c8dcae0 unify single forums in topic lists and forum pages with GetListByForum
add GetListByForum method
remove forums with topic counts of zero from filter lists
avoid locking whenever possible in route view counter
2020-03-01 16:22:43 +10:00
Azareal b1c9e0d11c swap TopicCountInForums's implementation out for a saner one...
clean up repetition in route legends
2020-02-29 17:34:38 +10:00
Azareal ae8c27fc2d remove redundant topiccount query in topiclist slow path 2020-02-29 15:38:30 +10:00
Azareal 46732286e5 optimise route perf tracking
expand route perf tracking to more routes
2020-02-29 11:10:39 +10:00
Azareal 03862d1b09 experiment with more route perf tracking 2020-02-29 09:11:07 +10:00
Azareal c403b4a85a optimise os tracking
optimise memory tracking

add panel_stats_routes_perf_head phrase
2020-02-28 15:47:43 +10:00
Azareal ca8411a519 experimental route perf pane
add 1.14 to travis test list
more qutils tests

add panel_menu_stats_routes_perf phrase
2020-02-28 14:52:45 +10:00
Azareal 671134b1f3 try to fix the int max bug again 2020-02-28 11:56:06 +10:00
Azareal 4ea5e91f2d tweak the check 2020-02-28 11:41:16 +10:00
Azareal 8db923cb6e troubleshoot anomalous int max with stacktrace 2020-02-28 09:21:38 +10:00
Azareal af7b6ebbcb try to fix int max perf counter bug 2020-02-27 11:45:07 +10:00
Azareal ea1037bd63 track favicon stats
experiment with tracking average route performance
temporary error route stub
optimise dumprequest
add DisableAnalytics config setting
fix double hyphens in slugs being mistaken for sql injection
more querygen tests

You wil need to run the updater / patcher for this commit.
2020-02-26 20:34:38 +10:00
Azareal 04fdf4c318 optimise agent and system counters 2020-02-25 18:12:54 +10:00
Azareal 64335cf1ef optimise lang counter
optimise dumprequest
add more suspicious phrases
capture more router gen errors
2020-02-25 14:25:50 +10:00
Azareal fb942fd100 optimise route counter
allow for multiple keys in mysql AddKey
add SimpleBulkInsert method
add BulkInsert acc builder
add DateOlderThanQ AccSelectBuilder method
2020-02-24 21:15:17 +10:00
Azareal 9c185cd1fd add missing perf units 2020-02-24 18:28:43 +10:00
Azareal 459d745cb1 initial perf anaytics
add tasks to debug page
ignore .git on debug page for speed

add perfchunks table

Renamed phrases (changed statistics to stats):
panel_menu_stats
panel_menu_stats_posts
panel_menu_stats_topics
panel_menu_stats_forums
panel_menu_stats_routes
panel_menu_stats_agents
panel_menu_stats_systems
panel_menu_stats_languages
panel_menu_stats_referrers
panel_menu_stats_memory
panel_menu_stats_active_memory
panel_menu_stats_perf
panel_stats_views_head_suffix
panel_stats_user_agents_head
panel_stats_forums_head
panel_stats_languages_head
panel_stats_post_counts_head
panel_stats_referrers_head
panel_stats_routes_head
panel_stats_operating_systems_head
panel_stats_topic_counts_head
panel_stats_requests_head
panel_stats_memory_head
panel_stats_active_memory_head
panel_stats_spam_hide
panel_stats_spam_show
panel_stats_memory_type_total
panel_stats_memory_type_stack
panel_stats_memory_type_heap
panel_stats_time_range_one_year
panel_stats_time_range_three_months
panel_stats_time_range_one_month
panel_stats_time_range_one_week
panel_stats_time_range_two_days
panel_stats_time_range_one_day
panel_stats_time_range_twelve_hours
panel_stats_time_range_six_hours
panel_stats_post_counts_chart_aria
panel_stats_topic_counts_chart_aria
panel_stats_requests_chart_aria
panel_stats_memory_chart_aria
panel_stats_details_head
panel_stats_post_counts_table_aria
panel_stats_topic_counts_table_aria
panel_stats_route_views_table_aria
panel_stats_requests_table_aria
panel_stats_memory_table_aria
panel_stats_views_suffix
panel_stats_posts_suffix
panel_stats_topics_suffix
panel_stats_user_agents_no_user_agents
panel_stats_forums_no_forums
panel_stats_languages_no_languages
panel_stats_post_counts_no_post_counts
panel_stats_referrers_no_referrers
panel_stats_routes_no_routes
panel_stats_operating_systems_no_operating_systems
panel_stats_memory_no_memory

Added phrases:
panel_debug_tasks
panel_debug_tasks_half_second
panel_debug_tasks_second
panel_debug_tasks_fifteen_minute
panel_debug_tasks_hour
panel_debug_tasks_shutdown
panel_stats_perf_head
panel_stats_perf_low
panel_stats_perf_high
panel_stats_perf_avg

You will need to run the updater / patcher for this commit.
2020-02-23 19:08:47 +10:00
Azareal 24cef43439 fix search not working properly
fix missing title index properly
add search tests
roll back accidental duplicate indices

You will need to run the updater / patcher for this commit.
2020-02-21 21:42:21 +10:00
Azareal d723895f5d remove polls from poll cache on deletion
add test for poll castvote and delete
2020-02-20 21:28:49 +10:00
Azareal 887804ff54 fix attachcount not being updated properly when attachments are deleted
tests for attachcount changes

add fget method to attachmentstore
2020-02-20 14:32:49 +10:00
Azareal 1766d5decd more attachment tests
Add UpdateLinked method to AttachmentStore.
2020-02-19 20:32:26 +10:00
Azareal 1191076c5b stop storing poll vote ips when anti-cheat is off
remove the PollStore.CastVote method
2020-02-19 15:17:12 +10:00
Azareal 7fd67210d0 reduce poll ip cutoff to 90 days 2020-02-19 15:00:55 +10:00
Azareal da3a41b51a reduce poll ip cutoff to 180 days 2020-02-19 14:58:45 +10:00
Azareal 570569be77 avoid confusion by formatting nil errors differently in LogWarning 2020-02-19 09:21:16 +10:00
Azareal 363826624f Reduce bandwidth usage for client templates.
Add js and ptmpl (stub) template functions.
Simple constant folding for true / false values in templates.
Use empty string instead of 0 for poll vote ips when DisablePollIP is enabled.

Shorten some things.
2020-02-19 09:04:14 +10:00
Lars Lehtonen 548a8bb39f
common: fix shadowed error in SQLSearcher.Query() 2020-02-18 11:21:32 -08:00
Lars Lehtonen 080a8fd615
common: fix shadowed error in SendEmail() 2020-02-18 11:16:16 -08:00
Azareal cd7577c84c convo alerts
change convo_dev phrase
change account_menu_messages phrase
change alerts_no_linked_topic phrase
change alerts_no_linked_topic_by_reply phrase
add alerts.convo_create phrase
add alerts.convo_reply phrase
add alerts_no_linked_convo phrase
2020-02-13 20:44:03 +10:00
Azareal 01b7a18ea9 Show avatars for 1-1 conversations in the convo list.
Don't show your own name in conversation titles.
Don't record the same participant in a conversation twice.
2020-02-12 19:11:27 +10:00
Azareal ae2a4809ba carry over the recipient when creating a convo via profile
hide the convo reply form when we don't have permission to create a reply
2020-02-11 17:01:13 +10:00
Azareal 84cdc097e7 Add UseConvosOnlyWithMod group permission.
Add UseConvosOnlyWithMod phrase.
Add initial convo tests.
Bar access to ConvosCreate route if we don't have the needed perms.
2020-02-11 13:13:38 +10:00
Azareal 459a7f0205 fix convo creation lastReplyBy default value bug
DefaultConversationStore.GetUser now returns ErrNoRows when there aren't any results.
2020-02-10 20:28:33 +10:00
Azareal b6931fe16a Add registered time as a parameter for group promotions.
Run group promotions on group change.
Run group promotions on registration.
Load the CreatedAt field when users are loaded.
Set the default for last_ip properly.
Fix the default values in the group promotion form.
Add initial group promotion tests.

Add panel_group_promotion_registered_for phrase.
Add the registeredFor column to the users_groups_promotions table.

You will need to run the updater / patcher for this commit.
2020-02-09 20:00:08 +10:00
Azareal e37c98eaa1 cache default noavatar strings to avoid allocs 2020-02-07 22:27:33 +10:00
Azareal 158b1de7bc travis... 2020-02-05 13:02:07 +10:00
Azareal f858797835 code cleanup 2020-02-05 12:48:35 +10:00
Azareal 4ae2200760 simplify ws dashboard stat push code 2020-02-05 12:29:35 +10:00
Azareal 0c1d6f0516 Add CreateProfileReply and AutoEmbed group permissions.
Log profile reply deletions in the moderator log.
Split the global permissions in the UI to make them easier to manage.
Experiment with showing group ID in group edit header.
Avoid loading groups multiple times for the same profile reply.

Initialise disabled IP log points to empty string rather than 0.

Add CreateProfileReply perm phrase.
Add AutoEmbed perm phrase.
Add panel_group_mod_permissions phrase.
Add panel_logs_mod_action_profile_reply_delete phrase.
2020-02-04 21:47:03 +10:00
Azareal 2e8c6e6fb6 fix deleting like alerts when unliking a reply
immediately delete alerts via websockets when a topic or reply is unliked

Add AidsByParams method to ActivityStream.
2020-02-01 16:56:04 +10:00
Azareal b38df9773b fix group ids in cached replies 2020-02-01 15:55:33 +10:00
Azareal b5fa9c69f7 Let users unlike posts.
Hide like buttons on own posts for Tempra Simple and Shadow themes too.
fix like visual ui.
fix topic.Unlike err return.

Add topic.minus_one phrase.
2020-01-31 20:48:55 +10:00
Azareal 6935637867 Cascade delete attachments properly.
Cascade delete replied to topic events for replies properly.
Cascade delete likes on topic posts properly.
Cascade delete replies and their children properly.
Recalculate user stats properly when items are deleted.
Users can now unlike topic opening posts.
Add a recalculator to fix abnormalities across upgrades.
Try fixing a last_ip daily update bug.

Add Existable interface.
Add Delete method to LikeStore.
Add Each, Exists, Create, CountUser, CountMegaUser and CountBigUser methods to ReplyStore.
Add CountUser, CountMegaUser, CountBigUser methods to TopicStore.
Add Each method to UserStore.
Add Add, Delete and DeleteResource methods to SubscriptionStore.
Add Delete, DeleteByParams, DeleteByParamsExtra and AidsByParamsExtra methods to ActivityStream.
Add Exists method to ProfileReplyStore.

Add DropColumn, RenameColumn and ChangeColumn to the database adapters.

Shorten ipaddress column names to ip.
- topics table.
- replies table
- users_replies table.
- polls_votes table.
Add extra column to activity_stream table.
Fix an issue upgrading sites to MariaDB 10.3 from older versions of Gosora. Please report any other issues you find.

You need to run the updater / patcher for this commit.
2020-01-31 17:22:08 +10:00
Azareal da26a29597 Cascade deletes for attachments properly when deleting a topic or deleting all of a user's posts.
Eliminate some allocs for maxAgeYear in ShowAttachment.
Split DeleteAttachment out of deleteAttachment for reuse elsewhere.
2020-01-23 16:17:50 +10:00
Azareal 32bb2edfe4 Cascade poll deletions properly when deleting topics normally or via delete all posts. 2020-01-20 16:58:22 +10:00
Azareal a21454ba5d Cascade like deletions properly when deleting topics. 2020-01-18 18:12:00 +10:00
Azareal ec7b304c08 Cascade like deletions properly when using delete all posts. 2020-01-18 17:24:51 +10:00
Azareal 7ec2037f5f Delete likes on replies / topics properly when their parent is deleted. 2020-01-15 14:16:10 +10:00
Azareal 2625db3989 Update last replies on topics properly for delete all posts. 2020-01-14 20:38:05 +10:00
Azareal e4cfe610f6 Update last reply on topics properly upon reply delete. 2020-01-14 20:29:23 +10:00
Azareal 69a2430e5a Add option to delete all of a user's posts.
Add limited dynanicism to langf.
Eliminate a few queries when updating user stats.
Minor clean-up.

Namespace the profile language strings.
2020-01-14 15:07:00 +10:00
Azareal a569772e9c Add DisableRegLog configuration setting.
Unit tests for DisablePostIP. Awkward but does the job for now.
2020-01-04 15:30:25 +10:00
Azareal b39d90e4b6 Add DisablePostIP configuration setting. 2020-01-03 07:52:41 +10:00
Azareal aed409ae9e Add DisablePollIP configuration setting. 2020-01-02 19:49:34 +10:00
Azareal 0d81557009 Add DisableLastIP configuration setting.
Reduce default PollIPCutoff to 365.
2020-01-02 16:04:10 +10:00
Azareal e2f97d29cb Experiment with 720 days for default poll vote cutoff. 2020-01-02 15:48:05 +10:00
Azareal f789a8498e Add PollIPCutoff configuration setting.
Add tests for qgen processWhere and qgen mysql buildWhere.

Shorten some things.
2020-01-02 15:28:36 +10:00
Azareal 35ddc89009 Optimise the database layer.
Refactor database adapters.
Experimental last ip cutoff.

More parser test cases.
2020-01-01 07:57:54 +10:00
Azareal d22021b022 Reduce default PostIPCutoff from 180 to 120 days.
Reduce default LogPruneCutoff from 365 to 180 days.
2019-12-19 17:09:56 +10:00
Azareal 0dede6a329 NoEmbeds privacy and config settings.
Phase out url_prefix and url_name.
Eliminate some boilerplate and allocations while we're at it.
Reduce the number of conditional statements in url validator loops.
Better parsing of Site.URL to handle user error better.

You will have to run the patcher / updater for this commit.
2019-12-08 13:40:56 +10:00
Azareal 501c0dff0a Shorten things. 2019-12-07 16:27:01 +10:00
Azareal 06f0779525 Shorten some names and eliminate a few allocs. 2019-11-12 16:56:51 +10:00
Azareal 430df1e325 Add blocklist page.
Add account_blocked phrase.
Add account_menu_blocked phrase.
Add account_blocked_head phrase.
Add account_blocked_remove phrase.
Add account_blocked_no_users phrase.
2019-11-12 16:17:46 +10:00
Azareal ec95b922cf fix the search and filter widget 2019-11-11 17:04:11 +10:00
Azareal 1044518e74 Finish up the adminlogs.
Throw an error instead of updating a word filter that doesn't exist.
Track a bit of extra data for word filter updates.

Shorten the prefixes of the adminlog phrases from panel_logs_administration_ to panel_logs_admin_
Add a bunch of new adminlog phrases.
Tweak the word filter phrases.

Add the extra column to the moderation_logs and administration_logs tables.

You need to run the updater / patcher for this commit.
2019-11-10 12:37:53 +10:00
Azareal 2fb15556e1 More word filter tests.
Fix WordFilters.Get.
2019-11-09 08:07:05 +10:00
Azareal ffdc9e7705 Adminlogs: Custom pages, settings, word filters and backups.
WordFilters.Create now returns the ID.
Add the WordFilters.Get method.
Reduce the boilerplate in the backup page and page store.

Sanitise the names and titles in the Page Manager.

Add page_unknown phrase.
Add setting_unknown phrase.
Add panel_logs_administration_action_page_create phrase.
Add panel_logs_administration_action_page_delete phrase.
Add panel_logs_administration_action_page_edit phrase.
Add panel_logs_administration_action_setting_edit phrase.
Add panel_logs_administration_action_word_filter_create phrase.
Add panel_logs_administration_action_word_filter_delete phrase.
Add panel_logs_administration_action_word_filter_edit phrase.
Add panel_logs_administration_action_backup_download phrase.
2019-11-09 07:46:50 +10:00
Azareal 6e8c241d8b Fix undefined buttons on edit reply.
Move some logic from files.go into templates.go
Shorten some things in templates.go

Fixes #63
2019-11-07 13:53:29 +10:00
Azareal cc76d399e5 Simple spoilers. 2019-11-07 07:15:43 +10:00
Azareal 5441adb7fc Very incomplete adminlogs. Only user edit so far.
Inline error when there aren't any reglogs, modlogs or adminlogs.
Hide the email on a reglog, if the user didn't insert one.

Add panel_logs_registration_no_logs phrase.
Add panel_logs_moderation_no_logs phrase.
Add panel_logs_administration_action_user_edit phrase.
Add panel_logs_administration_action_unknown phrase.
Add panel_logs_administration_no_logs phrase.
2019-11-06 12:00:44 +10:00
Azareal 4179f472e5 Oops, add this struct too. 2019-11-05 09:49:37 +10:00
Azareal 142359ce11 Add SslSchema config setting.
Reject URL usernames on registration.

Reduce length of char variable name.
2019-11-04 21:55:52 +10:00
Azareal 6b745a056f Terminate this loop earlier. 2019-11-04 17:00:12 +10:00
Azareal bffb095b57 Add zipx, kgb, pea, xz and zz archive formats. 2019-11-01 09:34:50 +10:00
Azareal f227aadb6d Allow users to upload small archives.
Fix the ordering of functions in topic.Delete.
2019-11-01 09:17:26 +10:00
Azareal 1ad3e9c9da The forum list should be updated properly now when a topic is deleted. 2019-10-31 18:55:03 +10:00
Azareal e9cf06a5f2 More jpeg file extensions. 2019-10-30 18:16:19 +10:00
Azareal 8f98708087 This too.
Rename VerifyEmailSubject phrase to ActivateEmailSubject.
Rename VerifyEmailBody phrase to ActivateEmailBody.
Add ValidateEmailSubject phrase.
Add ValidateEmailBody phrase.
Tweak menu_forums_aria phrase.
2019-10-30 16:41:05 +10:00
Azareal 40aa215331 Fix group tags not propagating to replies. 2019-10-30 15:53:35 +10:00
Azareal 01d956f9d1 Encode tiffs too.
Update file extension lists.
Update mod floater.
2019-10-30 13:52:04 +10:00
Azareal 9e8b95b1be Add jfif as an image file extension.
Add jpeg as jpgs for post attachments.

Move some things.
2019-10-30 12:59:34 +10:00