Commit Graph

43 Commits

Author SHA1 Message Date
Azareal fb8fa10570 Let plugins define imports to custom templates.
Things should work now.
2017-11-11 06:33:08 +00:00
Azareal d2a8fb1267 Fixed the template transpiler.
Fixed the PreRoute middleware.
Renamed makeDummyForum to BlankForum.

Began adding the plugin_guilds routers to the template transpiler for extra speed.
2017-11-11 05:22:33 +00:00
Azareal f30ea7a9bb Finished moving the files into the subpackage, this should open more doors to us.
Moved more queries out of the global stmt holder.
Refactored several things.
2017-11-11 04:06:16 +00:00
Azareal 6f45c62815 We made more progress with topic views on Cosora. We accidentally broke Tempra Conflux's topic view in the process and we're planning to fix it in the following commit.
Added the ForumPermsStore.
Fixed the creation dates of the posts.
Added a skippable version of the vhooks.
Social Groups now work again, although I'm planning to refactor them ;)
Added more Markdown tests and fixed a few Markdown bugs.
2017-11-02 02:52:21 +00:00
Azareal 14a14b7e80 More work on Cosora, we have a screenshot of it up now, although it's super experimental at the moment.
This commit might be a little broken, another is coming to fix things up!

The topics list is now paginated.
Refactored the error handling system.
Added the Trumboyg WYSIWYG editor for Cosora.
Moved Delete() out of the TopicStore and into *Topic
You can now bulk delete and bulk lock topics on Cosora.
h1s are now formatted properly on Firefox.
Added more ARIA Labels.
SuperModOnly is now a piece of middleware for the Control Panel routes.
Refactored and extended the router generator.
Improved the SEO for the paginators.
Added bits of Microdata to improve SEO further.
Wrote benchmarks for users.Get() and users.BypassGet()
More errors are caught now.
You can now attach pcss files to posts.
Improved the error logging for JavaScript.
Topic list avatars now link to the associated profiles.
Added last poster avatars to the forum list.
2017-10-30 09:57:08 +00:00
Azareal 97860d4f79 Began work on the new theme, Cosora.
Added the ReplyStore and the ProfileReplyStore.
Added more allowed file extensions for attachments.
The tif, webp, and apng extensions are now recognised as images.
Added the Delete method to the Reply struct.
Added the Like method to the Reply struct.
Refactored the topic list avatars to make things easier on Cosora.
The attachment cap should now work properly on topics.
You can now attach files to replies.
The Markdown parser now ignores URLs rather than mangling them.
Fixed a bug where themes weren't able to register custom resources.
Added the ability to embed images.
Added the ability to embed videos.
Made the requirements for URLs looser.

Misc improvements to the themes and templates.
2017-10-12 04:24:14 +01:00
Azareal 22650aad27 Added Quick Topic.
Added Attachments.
Added Attachment Media Embeds.

Renamed a load of *Store and *Cache methods to reduce the amount of unneccesary typing.
Added petabytes as a unit and cleaned up a few of the friendly units.
Refactored the username change logic to make it easier to maintain.
Refactored the avatar change logic to make it easier to maintain.
Shadow now uses CSS Variables for most of it's colours. We have plans to transpile this to support older browsers later on!
Snuck some CSS Variables into Tempra Conflux.
Added the GroupCache interface to MemoryGroupStore.
Added the Length method to MemoryGroupStore.
Added support for a site short name.
Added the UploadFiles permission.
Renamed more functions.
Fixed the background for the left gutter on the postbit for Tempra Simple and Shadow.
Added support for if statements operating on int8, int16, int32, int32, int64, uint, uint8, uint16, uint32, uint64, float32, and float64 for the template compiler.
Added support for if statements operating on slices and maps for the template compiler.
Fixed a security exploit in reply editing.
Fixed a bug in the URL detector in the parser where it couldn't find URLs with non-standard ports.
Fixed buttons having blue outlines on focus on Shadow.
Refactored the topic creation logic to make it easier to maintain.

Made a few responsive fixes, but there's still more to do in the following commits!
2017-10-05 11:20:28 +01:00
Azareal 47963e10a9 Began work on support for JS Plugins.
Renamed the rrow_assign hook to topic_reply_row_assign and gave it access to more data.
Fixed a bug where the topic store wouldn't fetch the last reply time for a topic.
Refactored the process of adding and removing topics from and to a *Forum.
Fixed a bug where editing the opening post of a topic would yield a vast number of <br>s instead of blank lines.
Selecting text in Shadow now has it's own CSS instead of falling back onto the browser defaults.
Fixed a bug in Shadow where not all the headers filled up the space they should.
Fixed a bug in Shadow where the footer is broken on mobile.
Added an ARIA Label to the topic list.
Refactored the last poster logic to reduce the number of bugs.
Renamed ReplyShort to Reply and Reply to ReplyUser.
Added a Copy method to Reply, Group, Forum, User, and Topic.
Rewrote Hello World into something slightly more useful for new plugin devs to learn off.
Added the GetLength() method to ForumCache.
2017-09-28 23:16:34 +01:00
Azareal 31f506c50c Removed the images for Cosmo from /images/, it's very saddening to see it go :(
Moved Reload from the UserStore into the UserCache.
Replaced many of the calls to Reload with CacheRemove.
Simplified the error functions.
Fixed a bug in the errors where they didn't have any CSS. Oops.
Added CustomErrorJS(), unused for now, but it may be useful in the future, especially for plugins.
Fixed many problems in the themes.
Added the Stick(), Unstick(), CreateActionReply(), Lock() and Unlock() methods to *Topic.
Renamed ip-search.html to ip-search-results.html
Added the Activate() and initPerms methods to *User.

Tempra Cursive is hiding from sight for this one commit.
Added Font Awesome to /public/, it isn't used yet.
2017-09-22 03:21:17 +01:00
Azareal 217e7abab3 Another mooostly technical commit, don't worry we'll be getting to the fun stuff soon!
The query statements now use camelCase instead of undercase.
Added more documentation.
Renamed a few config variables.
The length counters in the MemoryUserStore and MemoryTopicStore are now atomic.
Added the Flush method to the UserCache and TopicCache.
Made more visual improvements to Tempra Conflux.
The avatar block vanished from the opening posts for topics for some reason, I added it back.
Added more tests.

And many more changes...
2017-09-18 18:03:52 +01:00
Azareal 91f70d2a4a Add a per-user theme switcher. The CSS might be slightly broken in the themes, that'll be fixed in a follow-up commit.
Added basic support for server sync.

Re-added a few missing defers.
Renamed TO-DO to TODO across the entire codebase.
Renamed StaticForumStore to MemoryForumStore.
The ForumStore is now built on a sync.Map with a view slice for generating /forums rather than a slice.
Renamed many more functions and variables to satisfy the linter.
increase_post_user_stats() and decrease_post_user_stats() are now methods on the User struct. We also fix a bug where they take the moderator's score rather than the target user's into account when recalculating their level after a post / topic is deleted.
Transitioned the topic list to CSS Grid for Tempra Simple, with a float fallback.
Cosmo and Cosmo Conflux are now hidden from the theme list.
Fixed more data races.
Added more debug data to the template compiler logs.
2017-09-10 17:57:22 +01:00
Azareal ba36814d8d Refactored the code to follow best standards better.
Added Basic IP Search.
Added more items to .gitignore
Add a VSCode settings file.
Refactored the theme system to allow me to add a per-user theme switcher in the following commit.
Fixed h1s, rowmenus, profiles and the Control Panel Dashboard on Tempra Simple.
We now catch more extreme edge case errors.
Renamed route_panel_themes_default to route_panel_themes_set_default.
Centralised some of the per-route ExtData fields.
Added an ExtData field to headerLite.
Moved SettingLabels into the Phrase System.
2017-09-03 05:50:31 +01:00
Azareal 409719d10e Added support for screen readers.
Refactored the setting system to make it thread-safe.
Planned out the task system.
Fixed the closed topic status header.
2017-08-20 10:39:02 +01:00
Azareal 5a43432b80 Replaced most of the uses of fmt with log.
Replaced the io.Writers with http.ResponseWriters.
Refactored the compiled template calls.
Redirect port 443 to port 80.
Catch more errors from templates.
Fixed a few mutexes which are never unlocked.
Eliminated an unnecessary parameter in InternalError()
Temporarily commented out users_penalties so that the installer will succeed.
A couple more template types can be remapped now.
Tweaked the theme.
2017-08-13 12:22:34 +01:00
Azareal 41c620b988 Shadow is now fully responsive and almost done! Just a few places like the dashboard and a few glitches to patch up!
Fixed the indentation in alerts.go, Atom replaced the tabs with spaces for some reason x.x
Made the friendly URL logic more flexible.
Made the supermod menu item hiding more JS friendly.
strconv is now an optional dependency for compiled template files.
Revamped the profile template.
2017-07-29 15:04:20 +01:00
Azareal d976a192fb Added the new theme, Shadow. It still isn't complete yet.
Revamped the configuration system.
If you have trouble installing this, try installing my fork of gopsutil with `go get` and delete the users_penalties table from the schema folder. That stuff will be cleaned up in the next commit.

Fixed an issue with the links for the Uncategorised forum being broken.
Swapped out NOW() for UTC_TIMESTAMP() in MySQL queries.
We now get an error message when the server goes down for whatever reason.
The template compiler now supports pointers.
Swapped out shirou/gopsutil for a fork locked on an older and more stable commit of the same library.
Fixed a bug where the preprocessor didn't play nice with empty CSS files.

Added the site name to the navbar.
Added more things to .gitignore
Laid the foundations for the next commit.
2017-07-17 11:23:42 +01:00
Azareal 9a93f799bf Added friendly URLs.
Added the Forum Store. Rewrote all the forum slice calls to use it.

Remapped sql.ErrNoRows to ErrNoRows for portability.
Removed a pointless column in the login query.
Revamped the tags and buttons on Tempra Simple, and on the profiles for the other themes.
Fixed a padding bug.
Tweaked the font sizes and padding in the Control Panel for Tempra Simple.
More progress with widgets.
2017-06-28 13:05:26 +01:00
Azareal 21d623cba4 Static CSS files are now processed by the template system. This will be most likely be superseded by a more sophisticated system in the future.
Added the authentication interface and associated struct to better organise / escapsulate the authentication logic.
Added the LogError function. We'll put together a custom logger at some point which will supersede this.
Reorganised things a little.
Moved two queries into the query generator and inlined four with the query builder.
Added SimpleInsertLeftJoin to the query generator.
Added SimpleInsertSelect, SimpleInsertLeftJoin, and SimpleInsertInnerJoin to the query builder.
Removed the undocumented password reset mechanism for security reasons. We have a proper interface for this in the control panel.
Made one of the template compiler errors less cryptic.
Fixed the CSS on widget_simple.
Fixed a glitch in the weak password detector regarding unique character detection.
Moved the responsive CSS in media.partial.css for Tempra Conflux, and Tempra Simple.
Added the CreateUser method to the UserStore.
Users are no longer logged out on all devices when logging out.

Took the first step towards SEO URLs.
2017-06-25 10:56:39 +01:00
Azareal 1cc1e47582 Added an algorithm for sniffing out weak passwords upon registration.
Themes can now inject their own stylesheets and JavaScript files into the header.

Added friendlier errors for developers / designers when something goes wrong in the system.
Moved three queries to the query generator.
_process_where() in the query generator now uses an arbitrary expression parser, thus allowing more complex constructs like IN.
Began work on the widget system.
Added SimpleLeftJoin and SimpleInnerJoin to the inline query builder.
Added SimpleInsertSelect and SimpleInsertInnerJoin to the query generator.
_process_columns() now supports parametisation.
Fixed a bug in _process_set() where _ was considered an invalid character in column names.
Fixed a typo in the interpreter template mapping for topics.
2017-06-19 09:06:54 +01:00
Azareal c4e109adb7 Added the HeaderVars struct which is now used in the header template.
The NoticeList field in the various page structs is now part of the HeaderVars struct.
The Left / Right hotkeys will no longer take you to the next or previous page, if you have a textarea, input, or select element selected.
Added the panel.css file.
Added the PanelSessionCheck and SimplePanelSessionCheck functions.
Reworked the ExtData field in the page structs, we'll have some hooks for you to inject stuff in here soon!
Fixed a problem with the templates not getting remapped properly with Tempra Conflux when the compiled templates are missing.
More Atom Madness.
2017-06-16 11:41:30 +01:00
Azareal 29d9d07cde Added Live Alerts for replies to posts.
Added relative times to posts.
Added push_alerts to the WebSockets Hub.
Added simple_delete, purge, and simple_inner_join to the query generator.
Query generator joiners now take not equals into account.
Other query generator stuff and query refactoring.
Fixed a weird padding bug on Tempra Conflux.
Fixed a couple of megapost_min_chars and bigpost_min_chars which I missed.
Fixed a security exploit in the login system.
2017-06-12 10:03:14 +01:00
Azareal b60792391e Improved the mobile theme for Tempra Mobile. I broke something in the process of doing so, but it shouldn't take too long to make right!
Action posts are now visible on Tempra Conflux, Cosmo, and Cosmo Conflux.
Action posts now work properly on mobile.
2017-05-13 15:27:42 +01:00
Azareal a4ffc14a0c Testing branches. 2017-04-12 11:26:10 +01:00
Azareal 42eb509448 Added the Group Creator.
Generated files should now be detected by Github. I'll work on making the detection method a little less ugly once Github lets me put that thing on something other than the first line.
Fixed a race condition in the Forum Creator.
Fixed a few forgotten error checks in permmap_to_query.
2017-03-27 08:09:28 +01:00
Azareal cf480947d3 I'm still working on alerts. I've worked out the client-side UI for Cosmo, the UI will be tweaked for the other themes shortly. The client-side JS also now pulls the alerts from the server.
The errors are now sent properly via JSON.
The success JSON messages are now sent properly.
Optimised the message for guests.
Added the opthead class for adding a nice Cosmo specific enhancement.
2017-03-01 11:36:50 +00:00
Azareal 9fce51a3d7 Added the InternalErrorJS and LocalErrorJS error handler functions.
Hid the themes which aren't under construction yet from the Theme Manager.
Fixed a bug in the BBCode parser where every post had ten spaces appended to them.
Added the get_reply() internal API function for plugins to make use of.
Added the bell to the theme.
Fixed some bits of the Cosmo theme where the rowhead wasn't appearing.
Added a "Don't have an account?" link to the login page.

I began work on the alerts system, I took a little break, so it's a little further behind than you might expect, but it shouldn't take too long for me to finish it up.
I haven't finished the back-end portions of it yet, so there's not much to see yet!
2017-02-28 09:27:28 +00:00
Azareal 61358b5449 Added support for likes to the other themes. I'm pondering over how to best show the like counter on them.
Cleaned up the alternate topic layout, no longer do we have buttons on the topic header.
Added the topic specific permissions to the templates and removed the reliance on the Is_Mod flag.
Fixed a bug where the nav menu refuses to acknowledge that you're logged in.
2017-02-15 15:29:05 +00:00
Azareal 399128c208 Added the topic and user memory caches. Currently used in an extremely limited way, we plan to expand this!
Added a template minifier which strips out many types of whitespace.
Stop the router from blocking the other goroutines.
Content is no longer an interface{} in the TopicUser and Reply structs
Allow plugins to add new routes without any potential race coditions occuring
Use non-breaking spaces in the topic view to make it harder for the minifier to break things.
2017-02-11 14:51:16 +00:00
Azareal 534ef10194 You can now upvote topics and replies. The number of upvotes is visible on the posts.
The static resources now support Gzip Compression. Software-wide support is coming with the upcoming router rewrite!
Revamped Tempra Simple's topic view. We now use emojis instead of text for the fields. Experimental.
Simplified the json permissions in the installer.
Fixed some places where the wrong error handler is used.
Fixed a bug in the word counter where it was off by one.
The word count is now tracked by the topics and replies.
2017-02-10 13:39:13 +00:00
Azareal 0e5d0e649e Relative times are now shown for all the topics on /topics/ and /forum/
You can now see which forum the topics are in on the topic list.
Relative times are now calculated in real-time rather than once at start-up. I'm not sure how it ended up like that.
Fixed an issue with the lastReplyAt field not being populated for topics.
We now have relative times for weeks and months.
2017-02-06 04:52:19 +00:00
Azareal f8e657ee39 You can now create forums with a specific permission preset. The ability to change the preset of a forum and more granular control over it's permissions is coming soon.
Fixed a bug in the /forums/ route over which forums were visible.
2017-02-04 06:19:55 +00:00
Azareal f5c6f6b552 Added Per-Forum Permissions. The admin side of this is under development.
Added the Not Loggedin group.
The Reports Forum is now only available to staff.
Groups are now stored in a slice instead of a map for extra concurrency and speed.
Testing background SVGs.
You can now toggle a forum's visibility via the Forum Manager.
Added the Inline Form API to global.js
The reports forum can now be edited but not deleted.
Tempra Simple and Tempra Conflux now support backgrounds.
2017-01-31 05:13:38 +00:00
Azareal 5e3b61d910 Added pagination for forums.
You can now use the left and right keyboard keys to go to the next and previous page.
Making the shell files a little friendlier. Needs testing.
The main executable will always be named gosora.exe or the Linux equivalent ./Gosora
Reports is now a physical forum and not a "virtual" one.
Added create_forum() and delete_forum() for creating and deleting forums.
Synced the installer's config.go with the main one.
Forums are now stored in slices rather than maps for improved performance and concurrency.
You can now set a forum as hidden when initially creating it.
BBCode tag names may only be seven characters long now. This is part of a new anti-overflow measure that's much faster and simpler than the previous one.
Updated the last block of code in routes.go which uses the antiquated "success = 0" error detection method.
Fixed a visual bug in the Control Panel CSS.
Seperated the system forums from the normal ones in the Forum Manager.
You can now see if a forum is marked as Hidden in the Forum Manager.
Fixed the position of the lock status indicator.
IP Addresses now have a simple title attribute explaining that this long incomprehensible string is in fact an IP Address.
Textareas look a little better now.
Next / Previous buttons are now visible on mobile.
.bat files always say what they're doing now.
2017-01-26 13:37:50 +00:00
Azareal 16bc3a82e2 Added basic pagination for topics.
Added template functions for arithmetic.
Split the "TO-DO" section of README.md into it's own file.
Themes can now mark themselves as permanently disabled.
Improved the BBCode Bounds Checking.
Fixed a bug with the BBCode parser where part of the content at the end is cut off.
is_super_admin is now a hidden flag and isn't taken into account for Staff CSS.
Themes can now show a custom tag in the Theme Manager.
2017-01-21 18:16:27 +00:00
Azareal d4ad7f1a4c Dramatically improved Gosora's speed by two to four times.
Admins and mods can now see the IP Addresses of users.
The last IP Address of a user is now tracked.
The IP Addresses a user used to create replies and topics are now tracked.
Dramatically improved the speed of templates with the new Fragment System. More optimisations to come!
Decreased the memory usage of compiled templates with the new Fragment System.
build.bat now provides more information on what it's doing.
Added the `go generate` command to the .bat files in preparation for the future.
We're currently in the process of overhauling the benchmark system to run tests in parallel rather than serially. More news on that later.
We're also looking into the best way of integrating pprof with the benchmarks for detailed profiling.
The internal and notfound errors are now static pages.
Internal Error pages are now served properly.
Optimised most of the errors.
Added an internal flag for checking if the plugins have been initialised yet. Mainly for tests.
Decoupled the global initialisation code from the tests.
Removed URL Tags from Tempra Simple. We're pondering over how to re-introduce this in a less intrusive way.
Template file writing is now multi-threaded.
The number of maximum open connections is now explicitly set.
Removed the Name field from the page struct.
Turned some of the most frequently hit queries into prepared statements.
Added the [rand] BBCode.
Converted the NoticeList map into a slice.
Added the missing_tag error type to the [url] tag.
error_notfound is now used for when the router can't find a route.
Fixed a bug in the custom page route where both the page AND the error is served when the page doesn't exist.
Removed some deferrals.
Reduced the number of allocations on the topic page.
run.bat now provides more information on what it's doing.
2017-01-17 07:55:46 +00:00
Azareal 2f50da8cd8 Dramatically improved mobile friendliness on Tempra Conflux, Cosmo Conflux and Cosmo themes.
Made minor improvements to the mobile friendliness on the Tempra Simple theme.
Added levels to the other three themes.
Added the group tags to the Tempra Conflux and Cosmo Conflux themes.
Added more screenshots and updated some of the existing ones.
Made a small cosmetic improvement to the theme list.
2017-01-12 14:01:35 +00:00
Azareal e835ca4148 Added an installer which automatically populates the configuration file with information you provide. It also seeds the database with the necessary tables and data.
Added the likes table. This is a sign of what's to come.
Improved the installation instructions in README.md
Fixed the SQL in data.sql so that it no longer errors out.
The Admin user now has a default password.
Fixed a status indicator which I overlooked in the previous commit.
The Status field for topics is now deprecated.
Improved the efficiency of plugin_bbcode
Added more bat and shell files to make it easier for you to get things done.
2017-01-10 06:51:28 +00:00
Azareal 7833ad72fc [url] tags now use a custom parser.
Added more images and updated others.
The [code] tag is now enabled by default.
Fixed some visual flaws in the profiles.
Profile comments are no longer overriden by Tempra Conflux's post layout CSS.
A lock emoji is now used instead of [Status|closed] blocks.
Moved more inline CSS into the stylesheets.
Usernames now link to the profiles in the Tempra Conflux, Cosmo and Cosmo Conflux themes.
2017-01-08 16:02:19 +00:00
Azareal bbbd0c381f Added the Cosmo and Cosmo Conflux themes. Freshly ported over from one of my other projects.
The porting is still underway, part of it relies on functionality which hasn't be implemented in Gosora yet like sidebars and alerts.

Restructured the BBCode parser plugin.
Added the [code] tag to the BBCode parser. Disabled by default for now.
Added a benchmark for comparing performance between when [code] is enabled and when it isn't.
Tweaked the templates to make them more flexible, thus allowing a wider variety of themes.
Images of the themes can now be found in the Theme Manager.
There's an emoji on each theme row to show which themes are mobile friendly and which aren't.
Fixed editing and deleting posts on Tempra Conflux.
Moved a large portion of the inline CSS in the topic_alt template into the stylesheets.
2017-01-07 06:31:04 +00:00
Azareal e90d96961f Added the BBCode plugin.
Restructured the plugin system.
Multiple plugins can bind to the same hook now (not available for variadic hooks yet!)
The parser is now benchmarked. The bench_round4 is run with both plugin_markdown and plugin_bbcode enabled.
Added a benchmark for the BBCode plugin.
Moved some of the template writing logic into a more generalised function.
URLs are now recognised by the system and linked.
Converted more custom errors into LocalError calls.
Faster and less bandwidth intensive Emojis on Edge.
Fixed a bug with replies not working.
2017-01-05 14:41:14 +00:00
Azareal 33c2f4ccb0 Added a custom router which is twice as fast as the old one.
Added support for SSL.
Added the email system. Not fully tested.
Added Email Verification.
Added the Emails Page in the Account Manager.
Email Activation is now fully supported.
Fixed CustomErrorJSQ() and added CustomError().
Added commented out tests for Vestigo.
Added tests for the new (possibly temporary) custom router.
Swapped some of the custom error blocks for the Account Manager with LocalError calls.
Moved the account menu into it's own template.
2017-01-03 07:47:31 +00:00
Azareal e47450d372 Added the theme system.
You can now switch between themes in the Control Panel.
The Alternate Post Layout teased in various screenshots and bits of inaccessible code is now the Tempra Conflux theme, while the original post layout is the Tempa Simple theme.
Dramatically increased the speed at which the static files are served.
Added a benchmark for static files.
Eliminated the name parameter in various custom page structs.
Added the TopicsPage struct for the /topics/ route.
Added the ForumPage struct for the /forum/{id} route.
Added the ForumsPage struct for the /forums/ route.
The static file route now serves 404s when a file doesn't exist instead of nearly crashing the server.
Reduced the number of unnecessary allocations on some of the routes.
Added gradients to Tempra Conflux.
Added position: sticky; to the userinfo blocks in Tempra Conflux.
Added a notice on the generated template files.
2017-01-01 15:45:43 +00:00
Azareal bcaa646f68 Added an alternate topic layout. This might serve as the foundation of a second theme. You'll be able to switch between the two with ease once the theme system is in.
The profile route is now compiled again. A custom struct is now used for it instead of the generic Page struct.
Added the group list to the Control Panel.
Tweaked the navbar CSS.
Non-mods can no longer post in locked topics.
Locked topics now have a gray background on the topic view header, the forum view, and the topiclist,
The reply content box no longer shows up on topics which don't have any replies.
2016-12-26 04:44:07 +00:00