Commit Graph

45 Commits

Author SHA1 Message Date
Azareal f502bf4f53 subresource integrity 2020-07-31 15:33:29 +10:00
Azareal 43d72e6f3b wip allow for more cdns
add res template function
add ExtraCSPOrigins config setting
add StaticResBase config setting
skip flush directives
2020-07-30 18:10:29 +10:00
Azareal efa9b4ea70 did i not commit this? giiiiittt.
wider videos on cosora
2020-06-09 21:52:59 +10:00
Azareal 019efc8c62 add support for niconico videos
tweak tempra simple text attach padding
2020-06-08 22:19:32 +10:00
Azareal 77669d42a5 add actionSuccess function to reduce boilerplate
skip doPush if there is nothing to push
optimise cdnpush string building
use string builder for server push strings
2020-05-27 14:15:02 +10:00
Azareal 47d88f1744 optimise cdn push with sync pool 2020-04-21 10:08:54 +10:00
Azareal b53577a126 fix MicroNotFound
reduce allocs in cdn push
2020-03-27 22:00:29 +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 3d7f04b92b tweak renderTemplate3 for performance 2020-03-19 09:50:57 +10:00
Azareal 6a7b8fd3ee map msnbot to bing and avoid bytes for ahrefs too 2020-03-19 07:21:06 +10:00
Azareal 7d25937352 avoid csp for semrush 2020-03-18 19:45:36 +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 4d8858b846 don't do server pushes for unneccesary resources on ajax topics
save bytes in init.js
2020-03-13 19:02:28 +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 372508bf98 fix poll results on ajax topic and eliminate unnecessary allocs for resources that aren't used 2020-03-13 12:56:23 +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 5eaa8c8c89 optimise away this string for non-admins
optimise away redundant parentID column on ViewForum
2020-03-01 09:15:48 +10:00
Azareal 46732286e5 optimise route perf tracking
expand route perf tracking to more routes
2020-02-29 11:10:39 +10:00
Azareal 08891853e6 fix int max perf counter bug 2020-02-28 15:06:16 +10:00
Azareal 2094032ff6 or we could try this. 2020-02-24 11:37:02 +10:00
Azareal 75084fe452 fire perf counter after tmpl render 2020-02-24 11:18:54 +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 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 0f75e96a2d Push CSPs for non-HTTPS connections too. 2019-11-04 20:11:07 +10:00
Azareal 4d8c97812d More conversations work.
Add support for AS in columns for SimpleInnerJoin.
Add a referrer policy to improve privacy a little.
Shorten /static/ to /s/ since it comes up so much.
Remove some obsolete code.
Shorten some variable names.
Reduce the amount of boilerplate in the patcher.

Added the RefNoTrack and RefNoRef privacy config settings.

You may need to run the updater / patcher for this commit.
2019-08-14 20:39:04 +10:00
Azareal fb990c182c Fix the order of the stylesheets. 2019-06-05 01:33:44 +10:00
Azareal 05c2ac3ce4 Add the disk and database sections to the debug page.
Add the ActivityStream interface to abstract Get, Add and Count.
Rename the GlobalCount methods to Count for simplicity.
Simplify the variable names in the Count methods.
Rename the GlobalCount method to Count and rename the original Count method to CountUser in LoginLogStore.
Add a float64 case for bunit, sort of.
Theme.RunTmpl now returns ErrBadDefaultTemplate instead of panicking when an interpreted template doesn't exist.
Widget.Allowed now checks the zoneid.
Fire the alert off in the background in AddActivityAndNotifyTarget instead of blocking the request.
Use ErrBadDefaultTemplate instead of calling DefaultTemplates.Lookup directly for custom pages.
Split the page struct for the debug page into multiple structs to make things more organised.

Add the Count method to ProfileReplyStore.
Add the Count method to ReplyStore.
Add the DirSize utility function.

Add a few ActivityStream tests.

Secret gallery stuff.
2019-06-01 22:31:48 +10:00
Azareal 2964cd767d Oops, missed this one, there are some changes not ready for prime time here, so I overlooked it. 2019-04-25 16:22:29 +10:00
Azareal b4ffaa2cd6 Initial work on Plugin Hyperdrive.
Reduced the amount of boilerplate in Plugin Markdown.
Reduced the amount of boilerplate in Plugin Sendmail.
Reduced the amount of boilerplate in sample plugins Heythere and Skeleton.
Fixed up Plugin GeoIP. It's not ready for use though.

Added the routes.FootHeaders function.

Added the route_topic_list_start plugin hook.
2019-04-20 14:55:22 +10:00
Azareal c84b0aa433 Avoid concatenating the style / script names with the hashes in AddScript, AddPreScriptAsync, AddScriptAsync and AddSheet to reduce the number of allocations.
Use a string builder for building Link Headers.
2019-04-19 20:39:17 +10:00
Azareal 42b9f27c45 Defer setting headers to renderTemplate to avoid wasting resources for JSON requests and for future optimisations.
Error pages now use routes.renderTemplate bringing them in line with the other standard routes.
Every route should use a renderTemplate function now instead of calling RunTmpl.
Merged some pi and renderTemplate lines in routes to reduce the amount of vertical space used.
2019-04-19 19:34:16 +10:00
Azareal 20a6a22e78 Shorten the common namespaces in some areas to reduce the amount of boilerplate. 2019-04-19 16:36:26 +10:00
Azareal af9a56a9a9 Server push is back. But only for Chrome and Firefox.
Added the DisableServerPush and EnableCDNPush config.json settings.
2019-04-02 17:43:11 +10:00
Azareal 660f24acff Experimenting with Nox's Control Panel.
Experimenting with better cache busting for static resources.
HTTPSRedirect requests are now counted in the route analytics.
More scripts are loaded asynchronously now.
Upped the default ReadTimeout to eight seconds.
Reduce the number of unneccesary NewAcc calls.
Added panel_before_head as an injection point for themes.
Themes can now declare scripts to be loaded asynchronously.
Tweaked the WS resumption algorithm to mae the backoffs a little less aggressive.
Fixed an ordering issue in the WS resumption algorithm where backoffs weren't expiring as fast as they should have.
Fixed a bug where template logs weren't being written due to a panic.
You can now use byte slices in more places in the transpiled templates.
Fixed a bug where Cosora's misc.js seemed to be erroring out.
Fixed a bug where YT embeds were getting blocked by the CSP.

Added the panel_back_to_site phrase.
Added the panel_welcome phrase.
2019-03-22 08:59:41 +10:00
Azareal 4d1f80edab Tweaked the content security policy a little. 2019-03-04 09:21:06 +10:00
Azareal ae8485391b Loosen the CSP a little for images. 2019-02-28 18:11:29 +10:00
Azareal cc1d0f089a Client templates can now be overriden like every other template.
The client templates load earlier now for a smoother user experience.
Added a setting for setting a Google Site Verification meta tag without editing header.html
Added support for favicons. /static/favicon.ico will be mapped to favicon.ico, if it exists.
The parent forum is now visible on the topics list for Nox.

Language headers which contain the wildcard character are no longer considered unknowns.
Meta descriptions and open graph descriptions are no longer emitted for logged in users.
Slimmed down topics_topic slightly for Nox.
Pre-parsed widgets are now minified.
Stale WebSockets connections should be cleaned up far quicker now.
Template generation is now logged separately.
Commented out some obsolete template logic.
Marked a few template generator fields as unexported.

Fixed the styling for the ban page in the profile for Nox.
Fixed the styling for colline for Cosora and Tempra Simple.
Fixed the sidebar overflowing outside of the box on Nox.
Fixed the meta description text overflowing the box in the Setting Manager on Nox.
Fixed excessive padding in the Page Manager.
Fixed a few missing border on the profiles for Tempra Simple.
Fixed the sidebar appearing in places it shouldn't on Tempra Simple.
Fixed the status code emitted by NotFoundJS
Fixed a bug where Gosora kept falling back to interpreted templates.
Fixed a bug where WebSockets connections weren't getting closed properly if the user cache overflowed.
Fixed a bug where WebSocket connections weren't getting initialised for guests.
Fixed a bug where template overrides weren't always getting applied.
Fixed a bug where root template overrides weren't always getting applied.

Added the google_site_verify setting.
Added the google_site_verify phrase.

You will need to run the patcher or updater for this commit.
2019-02-28 17:28:17 +10:00
Azareal fe33112827 Added an experimental content security policy.
Added support for Open Graph Descriptions.
Nox now officially supports notices.
Tweaked the language detection algorithm to cover more cases.
Tweaked the user agent parser to accomodate DotBot better.
Added a non-JS fallback for the theme selector.
Tweaked the padding on widget simple.
Scripts should now execute properly for individual language charts in the analytics panel.
2019-02-24 18:02:00 +10:00
Azareal 99012e8961 Replaced RunThemeTemplate and GetThemeTemplate with methods on *Theme and refactored their implementations to make them more predictable.
Added the Elapsed1 route timer.
2018-12-08 10:45:27 +10:00
Azareal 9f273a99f5 Trying to reduce the amount of UserCheck() boilerplate in the routes.
Reduced the amount of boilerplate in routes with renderTemplate()
Reduced the amount of boilerplate in routes with ParseSEOURL()
Removed some dated commented bits of code.
Used StashConfig in a few more places in the benchmarks to reduce the amount of boilerplate.

Renamed the pre_render_forum_list hook to pre_render_forums.
Renamed the pre_render_topic_list hook to pre_render_topics.
Renamed a few benchmark variables to simplify the code.
2018-11-12 19:23:36 +10:00
Azareal bf851bd9fc We now use Go 1.11 modules. This should help with build times, deployment and development, although it does mean that the minimum requirement for Gosora has been bumped up from Go 1.10 to Go 1.11
Added support for dyntmpl to the template system.
The Account Dashboard now sort of uses dyntmpl, more work needed here.
Renamed the pre_render_view_topic hook to pre_render_topic.
Added the GetCurrentLangPack() function.
Added the alerts_no_new_alerts phrase.
Added the account_level_list phrase.

Refactored the route rename logic in the patcher to cut down on the amount of boilerplate.
Added more route renames to the patcher. You will need to run the patcher / updater in this commit.
2018-10-27 13:40:36 +10:00
Azareal 23a686fe96 UNSTABLE: Began work on the Nox Theme.
Removed the Tempra Cursive Theme.
You can now do bulk moderation actions with Shadow.

Added:
Argon2 as a dependency.
The EmailStore.
The ReportStore.
The Copy method to *Setting.
The AddColumn method to the query builder and adapters.
The textarea setting type.
More logging to better debug issues.
The GetOffset method to the UserStore.

Removed:
Sortable from Code Climate's Analysis.
MemberCheck and memberCheck as they're obsolete now.
The obsolete url_tags setting.
The BcryptGeneratePasswordNoSalt function.
Some redundant fields from some of the page structs.

Revamped:
The Control Panel Setting List and Editor.

Refactored:
The password hashing logic to make it more amenable to multiple hashing algorithms.
The email portion of the Account Manager.
The Control Panel User List.
The report system.
simplePanelUserCheck and simpleUserCheck to remove the duplicated logic as the two do the exact same thing.

Fixed:
Missing slugs in the profile links in the User Manager.
A few template initialisers potentially reducing the number of odd template edge cases.
Some problems with the footer.
Custom selection colour not applying to images on Shadow.
The avatars of the bottom row of the topic list on Conflux leaking out.

Other:
Moved the startTime variable into package common and exported it.
Moved the password hashing logic from user.go to auth.go
Split common/themes.go into common/theme.go and common/theme_list.go
Replaced the SettingLabels phrase category with the more generic SettingPhrases category.
Moved a load of routes, including panel ones into the routes and panel packages.
Hid the notifications link from the Account Menu.
Moved more inline CSS into the CSS files and made things a little more flexible here and there.
Continued work on PgSQL, still a ways away.
Guests now have a default avatar like everyone else.
Tweaked some of the font sizes on Cosora to make the text look a little nicer.
Partially implemented the theme dock override logic.
Partially implemented a "symlink" like feature for theme directories.
... And a bunch of other things I might have missed.

You will need to run this update script / patcher for this commit.
Warning: This is an "unstable commit", therefore some things may be a little less stable than I'd like. For instance, the Shadow Theme is a little broken in this commit.
2018-05-27 19:36:35 +10:00