Commit Graph

110 Commits

Author SHA1 Message Date
Azareal 3465e4c08f You can now manage the attachments for an opening post by hitting edit.
The update system now uses the database as the source of truth for the last version rather than lastSchema.json
Refactored several structs and bits of code, so we can avoid allocations for contexts where we never use a relative time.
Clicking on the relative times on the topic list and the forum page should now take you to the post on the last page rather than just the last page.
Added the reltime template function.
Fixed some obsolete bits of code.
Fixed some spelling mistakes.
Fixed a bug where MaxBytesReader was capped at the maxFileSize rather than r.ContentLength.
All of the client side templates should work again now.
Shortened some statement names to save some horizontal space.
accUpdateBuilder and SimpleUpdate now use updatePrebuilder behind the scenes to simplify things.
Renamed selectItem to builder in AccSelectBuilder.
Added a Total() method to accCountBuilder to reduce the amount of boilerplate used for row count queries.
The "_builder" strings have been replaced with empty strings to help save memory, to make things slightly faster and to open the door to removing the query name in many contexts down the line.
Added the open_edit and close_edit client hooks.
Removed many query name checks.
Split the attachment logic into separate functions and de-duplicated it between replies and topics.
Improved the UI for editing topics in Nox.
Used type aliases to reduce the amount of boilerplate in tables.go and patches.go
Reduced the amount of boilerplate in the action post logic.
Eliminated a map and a slice in the topic page for users who haven't given any likes. E.g. Guests.
Fixed some long out-dated parts of the update instructions.
Updated the update instructions to remove mention of the obsolete lastSchema.json
Fixed a bug in init.js where /api/me was being loaded for guests.
Added the MiniTopicGet, GlobalCount and CountInTopic methods to AttachmentStore.
Added the MiniAttachment struct.
Split the mod floaters out into their own template to reduce duplication.
Removed a couple of redundant ParseForms.

Added the common.skipUntilIfExistsOrLine function.
Added the NotFoundJS and NotFoundJSQ functions.
Added the lastReplyID and attachCount columns to the topics table.
2018-12-27 15:42:41 +10:00
Azareal 543ad8a018 Added the login log.
Added a better paginator for view topic.
The last post on the topic list and forum pages now link to the last page of a topic for quicker navigation.
The Account Manager now utilises dyntmpl in more areas.
More tooltips.
Tweaked the colour for the validated emails in the Email Manager so it looks nicer on dark themes.
Moved some inline styles from the Email Manager into the stylesheets and removed obsolete ones.
Added the mixed BenchmarkTopicGuestAdminRouteParallelWithRouter benchmark.
The bad route benchmark should no longer abort when erroring, something which doesn't make sense as it's always expected to error.
Reduce a bit more boilerplate with renderTemplate()
Added the *CTemplateSet.addText method and used it to optimise the generated templates a tiny bit more.
The forums route now has guest and member variants generated for it.
Turned the experimental template optimisation back on for more data.

Added the routes.AccountLogins route.

Added the account_logins phrase.
Added the account_menu_logins phrase.
Added the account_logins_head phrase.
Added the account_logins_success phrase.
Added the account_logins_failure phrase.

You need to run the patcher / updater for this commit.
2018-12-17 14:58:55 +10:00
Azareal a20078d83b Revamped the IP Search Page for Nox.
Revamped the Word Filter Manager for Nox.
Revamped the Setting Manager for Nox and Cosora.
Upped the number of items in the User Manager.
Upped the number of items in the Group Manager.
Upped the number of items in the Page Manager.
Swap a fmt.Println for a DebugLog in hold.ScanItem.
EQCSS.js should ignore panel.css in Cosora now.
Added the lang template function for stylesheet templates to reduce the amount of boilerplate.
Localised a couple of spots in the Nox Theme which got overlooked.
Tweaked the grid CSS for Nox.
The Control Panel Dashboard items now change colour in Nox like in the other themes.
Use Site.Host instead of req.Host for www redirects for security reasons.
Removed a superfluous function call in WriterIntercept.WriteHeader.
Tweaked several bits and pieces of CSS like the padding on a few items in the Forum Editor.

Added the topic_list.moderate phrase.
Added the panel_word_filters_to phrase.
2018-12-06 21:09:10 +10:00
Azareal 17f85ceccf The time it took for the route to be processed is shown in the footer in the Nox Theme for admins now
Don't waste queries on groups without any users for the topic list.
Bypass the GzipResponseWriter in RunThemeTemplate, so we get indirected through fewer layers of Write calls.
Added an experimental flag for disabling fsnotify.
Refactored the topic benchmarks to make them a little more flexible.
Refactored a couple of benchmarks to reduce the amount of boilerplate.
Fixed a bug in the forum list for Nox where topic titles broke onto multiple lines.
Refactored the template transpiler to reduce the amount of boilerplate for generating template functions.
2018-11-17 12:36:02 +10:00
Azareal 4759ec9c4c The settings should be validated properly now when they're updated.
Added more features to RouteError and RouteErrorImpl to help in suppressing sensitive information.
Refactored the setting update logic, so the settings are reloaded all at once rather than updated individually.
Renamed the router variables in the generated router to r to reduce the number of characters we have to type there.
Renamed some of the r variables in the generated router to req for consistency sake.
2018-11-13 16:51:34 +10:00
Azareal 2049948b0f Fixed a bug where the topic middle suffixes weren't showing up on the forum pages.
Added a NoHeader() I forgot.
2018-11-12 19:38:46 +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 05ab585d41 Added the level list page.
Levels can now be localised individually.
Added the level template function.
Fixed the padding on alerts without avatars.
The level data is now in it's own block in the profiles.
Removed three level phrases and replaced them with the new Level API.
2018-10-10 17:33:51 +10:00
Azareal 6634f3f64b All the control panel routes have been moved to /routes/panel/ now.
Moved the software version to common.go for better accessibility.
2018-10-02 15:03:20 +10:00
Azareal b2e97e47c1 Moved the last control panel theme manager route into /routes/panel/
Added the UpdateDefaultTheme function.

Renamed panelRenderTemplate to renderTemplate.
Renamed panelSuccessRedirect to successRedirect.
Reduced the amount of boilerplate in panel.GroupsEdit with renderTemplate.
Renamed the pre_render_panel_edit_group hook to pre_render_panel_group_edit.
Reduced the amount of boilerplate in panel.GroupsEditPerms with renderTemplate.
Renamed the pre_render_panel_edit_group_perms hook to pre_render_panel_group_edit_perms.

Fixed a bug where the active status for themes didn't get loaded at start-up.
Fixed a theoretical deadlock in NewThemeList.
Updated CONTRIBUTING.md
2018-10-02 14:09:17 +10:00
Azareal 750c0ff442 Moved all but one of the control panel theme routes into /routes/panel/ 2018-10-01 00:43:46 +10:00
Azareal 322a46bcb5 Moved the control panel group routes into /routes/panel/
Added the Update, UpdatePerms and CopyPtr methods to *Group.
2018-09-30 10:08:27 +10:00
Azareal 859ed2c730 Finished the Most Viewed Page for Nox.
Added three phrases for topic_list.
Moved the topic_middle_inside suffix phrases from the CSS files into the template proper.
Removed a newline in topic_middle_inside and used flex instead.
The link_select drop-down is now only visible when someone clicks on the link.
Tweaked the .topic_forum line height for Cosora.
Tweaked the .topic_view_count font size for Cosora.
2018-09-26 17:46:30 +10:00
Azareal 4d0d9fd4a5 Fixed the cache headers on /uploads/ and optimised the route a little. 2018-08-24 16:24:27 +10:00
Azareal 32f3bc453f Revert "Try this to speed up /uploads/, we might have to revert it if it breaks the caches."
This reverts commit 5d4ea4d2e0.
2018-08-23 22:18:15 +10:00
Azareal 5d4ea4d2e0 Try this to speed up /uploads/, we might have to revert it if it breaks the caches. 2018-08-23 22:11:52 +10:00
Azareal 0ad12c3958 Tweaked the permissions on the logs so we don't end up with a bunch of errors.
Oops, missed the generated router, well each instance generates it fresh anyway.
2018-08-22 22:37:58 +10:00
Azareal 146aa3aaad Fixed a bug where gzip spits out garbage bytes when it's disabled.
Disabled Gzip on the Control Panel Backup Page.
2018-08-22 17:10:29 +10:00
Azareal dcc59e7b86 Reduce the number of error checks in the generated router. 2018-08-22 12:29:11 +10:00
Azareal f90fe99fb3 Moved /uploads back into the main router switch.
Added the NoGzip method to RouteImpl.
Added the LitBeforeMultiline method to RouteImpl.
2018-08-22 12:13:17 +10:00
Azareal 8f7cda9378 Don't double-compress avatars.
Gzip is now disabled for static files when the gains don't justify the costs.
Moved StopServerChan and StoppedServer to package common.
Added some disabled profiling code.
2018-08-22 11:32:07 +10:00
Azareal 7b8943517b Upped the compression level for static files.
Experimenting with compressing everything.
Fixed the live things.

Playing around with topic buttons in Nox.
2018-08-21 18:00:35 +10:00
Azareal d8682aca94 Move these header sets to the start of the router. 2018-08-15 18:06:48 +10:00
Azareal a9a1d667c0 Added the /api/me/ API endpoint.
Moved a script block into an API endpoint.
Split the gigantic switch in ServeHTTP into it's own function.
Scripts should load more efficiently now.
2018-08-12 01:53:42 +10:00
Azareal 01a692ab5b Added the word filter store and moved the word filter routes into the route package.
Added tests for the word filter store.
Added qgen.NewAcc() to reduce the amount of boilerplate needed for creating an accumulator.
Exposed the RecordError method on the accumulator.
Added an Add method to PluginList and removed AddPlugin() in favour of that.

More panel buttons on Nox should be styled now.
Added the panel_update_button_text phrase for future use.

More errors might be caught in the thumbnailer now.
Removed ls from .travis.yml, it was there for debugging Code Climate.
2018-08-04 21:46:36 +10:00
Azareal 50d5be6f32 Moved the plugin manager to the routes package.
Added many, many tests for the plugin system.
Refactored some of the plugin system queries.

Fixed a bug where prepared statements would build up and crash Gosora.
Removed the inline CSS from the plugin rows.
2018-07-29 20:54:12 +10:00
Azareal d0907134ef Database connection drops are handled better now. 2018-07-15 20:29:31 +10:00
Azareal 2a5ab2969c Added Caire and pkg/errors as dependencies.
Made the initialisers and the task runner in main.go easier to debug.

Added form_button_row to a few forms.
Bumped up the attachment image size for Cosora.
Hid the formlabels for the setting editor for Cosora to make it cleaner.
Revamped the account manager with the same CSS as in the Control Panel for Nox.
Started adding the_form to more forms.
Removed the account_emails CSS class from the email editor.
Continued tweaking the Control Panel in Nox to make it look nicer.
Tweaked some of the headers in the Nox Theme.
Added the Create Topic and Moderate options to the topic list on the Nox Theme, although the bulk moderation tools aren't available yet.
Tweaked the padding and sticky shades on the topics on the topic list on the Nox Theme.
Closed topics are now somewhat styled on the topic list on the Nox Theme.
Continued work on the topic pages for Nox.

Renamed Admin Approval to Staff Approval in the English Language Pack.
Added more phrases for the Group Manager and Panel Menu in spots I overlooked.

Began work on the dyntmpl template function.
Be sure to run the patcher / update script to get the new setting.
2018-07-13 21:27:58 +10:00
Azareal 0f2503a20c Made it harder to parse the antispam script.
Used Unicode magic to make it harder to parse the antispam trap question.
Added more shady email substrings.
Tweaked the contributing guidelines, no more await allowed... For now.
Might already have Git, note that.
Added the the_form class to the login form, registration form and login mfa form.
Made the titles on the Control Panel Dashboard and Debug page a little softer on Cosora.

Added the quick topic form to Nox.
Made the topic pages somewhat usable on Nox.
2018-07-05 19:54:01 +10:00
Azareal 7be011a30d Almost finished live topic lists, you can find them at /topics/. You can disable them via config.json
The topic list cache can handle more groups now, but don't go too crazy with groups (e.g. thousands of them).

Make the suspicious request logs more descriptive.
Added the phrases API endpoint.
Split the template phrases up by prefix, more work on this coming up.
Removed #dash_saved and part of #dash_username.
Removed some temporary artifacts from trying to implement FA5 in Nox.
Removed some commented CSS.
Fixed template artifact deletion on Windows.
Tweaked HTTPSRedirect to make it more compact.
Fixed NullUserCache not complying with the expectations for BulkGet.
Swapped out a few RunVhook calls for more appropriate RunVhookNoreturn calls.
Removed a few redundant IsAdmin checks when IsMod would suffice.
Commented out a few pushers.
Desktop notification permission requests are no longer served to guests.
Split topics.html into topics.html and topics_topic.html
RunThemeTemplate should now fallback to interpreted templates properly when the transpiled variants aren't avaialb.e
Changed TopicsRow.CreatedAt from a string to a time.Time
Added SkipTmplPtrMap to CTemplateConfig.
Added SetBuildTags to CTemplateSet.
A bit more data is dumped when something goes wrong while transpiling templates now.
topics_topic, topic_posts, and topic_alt_posts are now transpiled for the client, although not all of them are ready to be served to the client yet.
Client rendered templates now support phrases.
Client rendered templates now support loops.
Fixed loadAlerts in global.js
Refactored some of the template initialisation code to make it less repetitive.
Split topic.html into topic.html and topic_posts.html
Split topic_alt.html into topic_alt.html and topic_alt_posts.html
Added comments for PollCache.
Fixed a data race in the MemoryPollCache.
The writer is now closed properly in WsHubImpl.broadcastMessage.
Fixed a potential deadlock in WsHubImpl.broadcastMessage.
Removed some old commented code in websockets.go

Added the DisableLiveTopicList config setting.
2018-06-24 23:49:29 +10:00
Azareal f8f46b3c48 Added support for two-factor authentication.
Added the Account Dashboard and merged a few account views into it.
BREAKING CHANGE: We now use config/config.json instead of config/config.go, be sure to setup one of these files, you can config_default.json as an example of what a config.json should look like. If you don't have an existing installation, you can just rely on the installer to do this for you.

CSS Changes (does not include Nox Theme):
Sidebar should no longer show up in the account manager in some odd situations or themes.
Made a few CSS rules more generic.
Forms have a new look in Cosora now.

Config Changes:
Removed the DefaultRoute config field.
Added the DefaultPath config field.
Added the MaxRequestSizeStr config field to make it easier for users to input custom max request sizes without having to use a calculator or figure out how many bytes there are in a megabyte.
Removed the CacheTopicUser config field.
Added the UserCache config field.
Added the TopicCache config field

Phrases:
Removed ten english phrases.
Added 21 english phrases.
Changed eleven english phrases.
Removed some duplicate indices in the english phrase pack.

Removed some old benchmark code.
Tweaked some things to make the linter happy.
Added comments for all the MemoryUserCache and MemoryTopicCache methods.
Added a comment for the null caches, consult the other caches for further information on the methods.
Added a client-side check to make sure the user doesn't upload too much data in a single post. The server already did this, but it might be a while before feedback arrives from it.
Simplified a lot of the control panel route code with the buildBasePage function.
Renamed /user/edit/critical/ to /user/edit/password/
Renamed /user/edit/critical/submit/ to /user/edit/password/submit/
Made some small improvements to SEO with a couple of meta tags.
Renamed some of the control panel templates so that they use _ instead of -.
Fixed a bug where notices were being moved to the wrong place in some areas in Cosora.
Added the writeJsonError function to help abstract writing json errors.
Moved routePanelUsers to panel.Users
Moved routePanelUsersEdit to panel.UsersEdit
Moved routePanelUsersEditSubmit to panel.UsersEditSubmit
Renamed routes.AccountEditCritical to routes.AccountEditPassword
Renamed routes.AccountEditCriticalSubmit to routes.AccountEditPasswordSubmit
Removed the routes.AccountEditAvatar and routes.AccountEditUsername routes.
Fixed a data race in MemoryTopicCache.Add which could lead to the capacity limit being bypassed.
Tweaked MemoryTopicCache.AddUnsafe under the assumption that it's not going to be safe anyway, but we might as-well try in case this call is properly synchronised.
Fixed a data race in MemoryTopicCache.Remove which could lead to the length counter being decremented twice.
Tweaked the behaviour of MemoryTopicCache.RemoveUnsafe to mirror that of Remove.
Fixed a data race in MemoryUserCache.Add which could lead to the capacity limit being bypassed.
User can no longer change their usernames to blank.

Made a lot of progress on the Nox theme.
Added modified FA5 SVGs as a dependency for Nox.
Be sure to run the patcher or update script and don't forget to create a customised config/config.json file.
2018-06-17 17:28:18 +10:00
Azareal a5f5f4af7e Added the Page Manager for faster and easier custom page creation.
Added the PageStore.

Renamed account_own_edit.html to account_own_edit_password.html
Renamed custom-page.html to custom_page.html
Renamed the pre_render_custom_page hook to pre_render_tmpl_page.
Added a new pre_render_custom_page hook, not to be confused with the previous one.
Renamed the pre_render_account_own_edit_critical hook to pre_render_account_own_edit_password.
Moved the report forum ID into a constant.
Renamed todaysReportCount to topicsTopicCountByForum and made it more generic.
Renamed panel-menu.html to panel_menu.html
Renamed panel-inner-menu.html to panel_inner_menu.html
Removed an irrelevant editable_parent in a no results row.
Fixed the profile page loading the wrong profile.css
Fixed a bug where the last poster avatar would break on the forum page.
Added the AddNotice method to *Header.
Greatly simplified many of the page struct definitions.
Added the ErrorPage page struct and refactored the error pages to use it.
Added the BasePanelPage page struct and refactored the panel page structs to use it.
Tweaked the DefaultHeader function to set the user on the spot rather than after the fact.
Simplified AccountEditAvatarSubmit into a redirect.
Add the addElement closure in the control panel dashboard to reduce the amount of complexity.
Tweaked LogWarning to better handle nils.

Added the account_username phrase.
Added the account_avatar phrase.
Added the account_email phrase.
Added the panel_pages phrase.
Added the panel_pages_edit phrase.
Added the panel_page_created phrase.
Added the panel_page_updated phrase.
Added the panel_page_deleted phrase.
Added the account_menu_security phrase.
Added the panel_menu_pages phrase.
Added the panel_pages_head phrase.
Added the panel_pages_edit_button_aria phrase.
Added the panel_pages_delete_button_aria phrase.
Added the panel_pages_no_pages phrase.
Added the panel_pages_create_head phrase.
Added the panel_pages_create_name phrase.
Added the panel_pages_create_name_placeholder phrase.
Added the panel_pages_create_title phrase.
Added the panel_pages_create_title_placeholder phrase.
Added the panel_pages_create_body_placeholder phrase.
Added the panel_pages_create_submit_button phrase.
Added the panel_pages_edit_head phrase.
Added the panel_pages_name phrase.
Added the panel_pages_title phrase.
Added the panel_pages_edit_update_button phrase.

Began work on two-factor authentication.
Made more progress with the Nox Theme.
2018-06-06 10:21:22 +10:00
Azareal f85bf51103 Added a couple of simple anti-spam measures.
Made progress with an internal error logging component for the Control Panel.
Made LogWarning less susceptible to races and slightly improved log contention.
Revamped the registration page on Cosora.
Added the SanitiseSingleLine and SanitiseBody functions to better centralise sanitisation and to ensure more consistent sanitisation.
Zero length spaces are no longer permitted in usernames to help prevent impersonation. More to come in this area.
Plugins / internal components can now schedule hourly tasks.
Reduced the chances of newlines breaking the visual layout in areas which expect none.

Added the register_account_anti_spam phrase.
2018-05-31 16:51:31 +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
Azareal ba98b0c952 Added the registration logs.
Tweaked the h1 CSS for the Control Panel in Cosora.
Improved the support for autocompleters.
Reverted some of the int64s back to ints.
The per-request user variable should now have the IPs for guests.
Removed some obsolete statements.
Removed a couple obsolete phrases.
Moved a couple more accumulator initializers out of the store initializers.
Refactored one of the report statements to use a store instead of a statement.
Created the menuhead CSS class.
Added the GetOffset method to the LogStore interface and refactored the mod and admin log pages to use it.
Changed the labels on the adminlog and modlog pages to make them more understandable.
Removed the generated templates from Git.

Run the patcher / update script to get the new table.
2018-05-16 20:46:14 +10:00
Azareal 2be884edc1 Commented out more debug code.
Main Menu is now shown on the main menu in the menu list for extra clarity.
Travis should now be able to run it's tests.
Moved routeChangeTheme to the routes package.
Moved routeShowAttachment to the routes package and partially refactored it.
Moved routeLikeTopicSubmit to the routes package.
Moved routeReplyLikeSubmit to the routes package and partially refactored it.
Moved routeProfileReplyCreateSubmit to the routes package.
Moved routeLogout to the routes package, now known as routes.AccountLogout.
Moved the routeDynamic stub to the routes package, now known as routes.DynamicRoute.
Moved the routeUploads stub to the routes package, now known as routes.UploadedFile.
Moved the BadRoute stub to the routes package, now known as routes.BadRoute.
All routes moved to the routes package have had the route prefix dropped from their name.
Simplified the email token route to redirect back to the main email route instead of rendering the same template.
Refactored the panel menus to use the new submenu system instead of the old one which had a lot of menu duplication.
Added a stub directory for Nox, the next major theme after Cosora.
Fixed a bug where the alerts wouldn't load outside of the index.

Tweaked the CSS in the topic creation and reply forms on Shadow.
Tweaked the padding on the stickies on Shadow.
Improved the submenu CSS on every theme.
Fixed the submitrow CSS on Shadow, Tempra Conflux.
Fixed some double borders on Tempra Conflux.
The frontend sidebar should no longer show up in the Control Panel in Tempra Conflux and Tempra Simple.
Tweaked the title CSS on Cosora.
Tweaked the user manager CSS on Cosora.
Changed the primary text colour on Cosora.
Fixed attachment images taking up too much space on Cosora.

Run the patcher or update script for this commit.
2018-05-15 15:59:52 +10:00
Azareal 9075798128 Alerts are now rendered via a client side transpiled template rather than being hard-coded.
Tweaked some bits to make them more 32-bit friendly for GopherJS, but this might not be necessary now.
Added notice.html
Added an alerts package to fix the import cycles, more things may be moved here soon.
Saved a few lines of accumulator code in a few stores.
Moved the AccountEditCriticalSubmit, AccountEditAvatar, AccountEditAvatarSubmit, AccountEditUsername, and AccountEditUsernameSubmit routes into the routes package.
Added a QueryRow method to AccSelectBuilder.
Tweaked the indentation in the generated templates.
Simplified the template render in the AccountEditUsernameSubmit route into a redirect back to the previous page.

Run the update script / patcher to replace the route names in the viewchunks table.
2018-05-14 18:56:56 +10:00
Azareal 185f00e019 You can now reorder menu items by dragging them around in the menu item manager.
You can now create menu items.
You can now delete menu items.

Renamed ID to MenuID on PanelMenuPage struct.
Bumped the copyright year in a place in advance.
The footer is no longer hidden in the Control Panel in Tempra Simple.
Fixed the notifications URL, although that page still isn't implemented yet.
Fixed config_default.noparse so that Travis won't error over that.
Refactored some user queries.
2018-05-13 16:56:59 +10:00
Azareal d0318191c9 Added the menu manager and menu item editor.
Refactored the menu system.
Updated the README and revamped it a tad to make it easier to understand. Also, added manual instructions for patching.
Revamped the update scripts, especially on Windows.
Merged the CSS and Tmpl phrase namespaces.
Added lastSchema to .gitignore
Added DropTable to the database adapters.
Implemented DbVersion in the PgSQL Adapter.
Swapped out the checkboxes for cleaner looking yes-no dropdowns.
Began revamping small bits of the user logic.

We now open to contributions, just open a pull request and sign the CLA.
Schema has been updated, run the patcher or update script.
2018-05-11 15:41:51 +10:00
Azareal b32e8d6c21 You can now disable slugs.
Split ops.log into ops.log and requests.log
Moved the logs into the logs directory.
Moved more password validation logic in the registration route into WeakPassword().
Tweaked the WeakPassword algorithm to cover more cases and to reduce the number of false positives.
Fixed the error grammer in WeakPassword now that the linter isn't bothering me about that anymore.
Fixed BuildGuildURL().
Removed some commented logging logic.
Bad requests are no longer logged to the console.
All bad routes are logged now.
We now track the instance uptime on the Control Panel Debug Page.
Added the executables for Linux to the .gitignore file.
Added GopherJS as a dependency.

Began work on transpiling WeakPassword to JavaScript in use in the client-side logic.
2018-04-03 05:34:07 +01:00
Azareal 74e09efb63 Fixed a bug where it would use the wrong templates for Tempra Simple, Tempra Cursive, and Shadow
Likes are now done over AJAX.
Posts you have liked are now visually differentiated from those which you have not.
Added support for OR to the where parser.
|| and && now get translated to OR and AND in the where parser.
Added support for ( and ) in the where parser.
Added an adapter and builder method for getting the database version.
Multiple wheres can now be chained with the micro and accumulator builders.
Added the In method to the accumulator select builder.
Added the GetConn method to the builder.
/uploads/ files should now get cached properly.
Added more tooltips for topic titles and usernames.

Fixed a bug in the runners where old stale templates would be served.
Fixed a bug where liking topics didn't work.
Began moving the database initialisation logic out of {adapter}.go and into querygen.
Tweaked the alert direction to show the newest alerts rather than the oldest.
Tweaked the WS JS to have it handle messages more efficiently.
Partially fixed an issue where inline edited posts would lack newlines until the page is refreshed.
Used arrow functions in a few places in global.js to save a few characters.

Schema:
Added the liked, oldestItemLikedCreatedAt and lastLiked columns to the users table.
Added the createdAt column to the likes table.

MySQL Update Queries:
ALTER TABLE `users` ADD COLUMN `liked` INT NOT NULL DEFAULT '0' AFTER `topics`;
ALTER TABLE `users` ADD COLUMN `oldestItemLikedCreatedAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `liked`;
ALTER TABLE `users` ADD COLUMN `lastLiked` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `oldestItemLikedCreatedAt`;
ALTER TABLE `likes` ADD COLUMN `createdAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `sentBy`;
delete from `likes`;
delete from `activity_stream` where `event` = 'like';
delete from `activity_stream_matches` where `asid` not in(select `asid` from `activity_stream`);
update `topics` set `likeCount` = 0;
update `replies` set `likeCount` = 0;
2018-03-31 06:25:27 +01:00
Azareal b20e295375 Changed the defaultest default theme to Cosora... For now.
You need the ViewIPs permission to view IPs on logs now.
Added the leftOfNav and rightOfNav docks, more on this soon.
Added a max length for topic titles.
Added a max length for usernames.
Added none as a possible language for the language view counter.
We began adding the notice phrases.
Fixed a misnamed phrase which was spitting out placeholder text.
Localised unknown for the human language phrases.
Moved routeForums to routes.ForumList.
Moved routeRobotsTxt to routes.RobotsTxt.
Started tracking the views for routes.RobotsTxt.
Moved routeSitemapXml to routes.SitemapXml.
Started tracking the views for routes.SitemapXml.
Changed the fallback theme to Cosora.
Fixed changing the default theme to Cosora or Tempra Conflux.
Removed some redundant type definitions in template init.
Return ErrNoTitle instead of ErrNoBody when trying to create a topic with no title.
Moved some in-progress routes and helper functions for handling search engine crawlers to routes/api.go
2018-03-17 08:16:43 +00:00
Azareal 5a8b994877 Added support for phrases in templates.
The language of the end-user is now tracked and presented in the Analytics Manager.
Profile owners now get alerts when someone posts on their profiles.

The login page is now transpiled, estimated to be sixty times faster.
The registration page is now transpiled, estimated to be sixty times faster.
The IP Search page is now transpiled, estimated to be sixty times faster.
The error pages are now transpiled, estimated to be sixty times faster.
The login page now uses phrases.
The registration page now uses phrases.
IP Search now uses phrases.
Renamed the ip-search template to ip_search.
Alerts are now held in an alertbox container div.
Added ids for the main container divs for the account manager sections.
Added an id to the main container for the topic list template.
Added an id to the main container for the forum list template.
Added an id to the main container for the forum template.
Added an avatar box CSS class for the avatar box in the account manager's avatar page.
Did a bit of renaming for a future refactor in the routes counter.
Did a bit of renaming for a future refactor in the operating system counter.
A notice is shown to the user now when their account is inactive.
The account activation status is now fetched by the user store.
We now track Slackbot.
You can now prepend strings to the start of router.DumpRequest request dumps to avoid tearing these bits of contextual data away from the bodies.
.action file extensions are now seen as suspicious by the router.
Moved routeWebsockets to common.RouteWebsockets for now.
Moved routeCreateReplySubmit to routes.CreateReplySubmit.
Moved alert.go into common.
Moved the WebSockets logic into common.
Escape strings a little earlier in the analytics routes and use integers instead of strings where possible.
We now show a success notification when you update a user via the User Manager.
Split the configuration properties off from CTemplateSet into CTemplateConfig.
Renamed some of the properties of CTemplateSet to make them easier to understand.
Removed some obsolete properties from CTemplateSet.
Did a bit of spring cleaning in the template transpiler to cut down on unneccessary lines and to reduce duplication.
Fixed a double else bug in ranges over maps in the template transpiler.
Split the minifiers off the main template transpilation file into their own file.
Refactored some of the routes which rely on alerts to use shared functions rather than having unique implementations in the routes themselves.

All Themes Except Cosora:
Refactored the opt nodes to make it easier to roll out bulk moderation.

Shadow:
Improved the notice CSS.
Tweaked the sticky border colour.

Cosora:
The theme JS file now uses strict mode.
Notices are shunted under rowhead with JS now, although this change might be reverted soon.
Added CSS for notices.
Fixed the padding under the avatar box in the account manager avatar page.

Schema:
Added the viewchunks_langs table.
2018-03-08 03:59:47 +00:00
Azareal 8ecc637ab9 Moved routeProfile to routes.ViewProfile.
Requests are now logged as one big chunk to help prevent them getting torn apart and improve log throughput.
Newlines are now stripped from dumped requests.
Prepared statement logging now only happens in debug mode for speedier server startups.
More suspicious request tracking is done outside of debug mode now.
Only log the initial message in plugin_markdown in debug mode.
Moved the CreateTopicSubmit attachment logging to super debug mode.
Removed a couple of unneccesary menu items from the Account Manager menu.
Hid the add friend option on the profiles for now.
Moved the remaining analytics results loops into a common function.
Only log the graph for the analytics routes in debug mode.

Every Theme:
Added CSS for the Don't have an Account link on the Login Page.

Cosora:
Fixed the header CSS on mobile.
The header CSS now covers optheads on mobile.
Revamped the profile comment UI.

Shadow:
Added CSS for sticky topics.

Tempra Simple:
Button CSS now applies to type=submit inputs.
Fixed the IP Search CSS.

Tempra Conflux:
Button CSS now applies to type=submit inputs.
Fixed the IP Search CSS.

Tempra Cursive (Deprecated):
Button CSS now applies to type=submit inputs.
2018-02-26 09:07:00 +00:00
Azareal 0879f56893 Added per-forum analytics.
Added one week as a time range option.

Moved routeForum to routes.ViewForum
Renamed form_vars to formVars.
Moved the analytics chart JS into it's own file.
Changed the header text on the requests chart from Views to Requests.
Added simple hooks to global.js
Moved some of the in funcname prints to debug mode.
De-duplicated some of the back-end analytics logic.
2018-02-22 02:27:17 +00:00
Azareal 60964868d4 Moved the counters to their own package.
De-duped some of the logging code.
Added per-route state to the not found errors.
Exported debugDetail, debugDetailf, debugLog, and debugLogf.
Tweaked the padding on Tempra Simple.
Added panel submenus to Tempra Conflux.
Added Chart CSS to Tempra Conflux.
Fixed the padding and margins for the Control Panel in Cosora.
Made Cosora's Control Panel a little more tablet friendly.
Added the rowmsg CSS class to better style message rows.
Removed the repetitive guard code for the pre-render hooks.
Removed the repetitive guard code for the string-string hooks.
We now capture views for routes.StaticFile
Added the move action to the moderation logs.

Added the viewchunks_forums table.
Began work on Per-forum Views.
I probably missed a few things in this changelog.
2018-02-19 04:26:01 +00:00
Azareal fa065bc584 /topics/ (the default index) is now over 25 times faster than before.
Change the length of the ticks for referrer tracking.
Fixed a bug in Shadow and Tempra Simple where the polls would appear when they shouldn't.
Added styling to Shadow for Control Panel Sub-menus.
Fixed the ridiculously wide attachment images on Cosora.
The analytics pages should no longer be treated as the dashboard style-wise.
The installer now works again.
Tests now run again, as do the benchmarks.
Refactored the topic list logic, and moved the route portion into the routes package.
Fixed an inverted comparison in the referrer logic.
Added friendly text for Mac operating systems to the english language pack.
Removed two obsolete prepared statements.
Fixed three race conditions in the database adapters.
Potentially sped up the topic page by 20%
Added several new benchmarks and refactored the others.
Removed a redundant prepared statement in user.go

Added reviseID as a primary key to the revisions table.
The user_count column was added to the users_groups table, but it's unknown if it will stay.
2018-02-10 15:07:21 +00:00
Azareal 1ac47bfdfd Added referrer analytics. You can now see what site a visitor has come from.
Added the viewchunks_referrers table.
2018-02-05 10:29:13 +00:00
Azareal e56e7cd467 Fix the false positives with IE11 and Firefox.
Moved some noisy things to SuperDebug.
2018-02-04 09:33:04 +00:00