Commit Graph

30 Commits

Author SHA1 Message Date
Azareal 2545d4adde Converted more queries over to the new OO builder syntax.
Renamed accBuilder to Accumulator so that it can be used in type hints outside the query generator.
The DbInit accumulator is now initialised in the caller rather than the callee.
2017-11-12 03:29:05 +00:00
Azareal ca83771eb4 Travis doesn't like passwords 2017-10-31 01:27:38 +00:00
Azareal 9ad66ac882 Tweaked the config file to get Travis to work. 2017-10-31 01:22:05 +00: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 2ef7726080 More debug data and moved the template detailed debugs to the TemplateDebug as they shove the other data off the console.
Tweaked a few things in the forum permissions functions.
2017-09-23 22:28:50 +01:00
Azareal 11c60b3cbe You can now search for whatever IP you want in the IP Searcher.
Removed the Uncategorised Forum.
Added the Backup Page for super admins. Not quite functional yet.
Forums are now sorted properly again.
Fixed a bug in DirtyGet() where invalid IDs would trigger a panic.
Fixed a bug where alternate themes wouldn't work without setting them as default first and restarting Gosora.
2017-09-23 20:57:13 +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 87c07ace6a Oops, forgot config.go 2017-09-13 16:11:17 +01:00
Azareal 01bef7a320 The route handlers now use camelCase.
Updated the default config.go
2017-09-11 11:24:03 +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 dd8f68b6d2 Added the Social Groups plugin. This is still under construction.
Made a few improvements to the ForumStore, including bringing it's API closer in line with the other datastores, adding stubs for future subforum functionality, and improving efficiency in a few places.
The auth interface now handles all the authentication stuff.
Renamed the debug config variable to debug_mode.
Added the PluginPerms API.
Internal Errors will now dump the stack trace in the console.
Added support for installable plugins.
Refactored the routing logic so that the router now handles the common PreRoute logic(exc. /static/)
Added the CreateTable method to the query generator. It might need some tweaking to better support other database systems.
Added the same CreateTable method to the query builder.
Began work on PostgreSQL support.

Added the string-string hook type
Added the pre_render hook type.
Added the ParentID and ParentType fields to forums.
Added the get_forum_url_prefix function.
Added a more generic build_slug function.
Added the get_topic_url_prefix function.
Added the override_perms and override_forum_perms functions for bulk setting and unsetting permissions.
Added more ExtData fields in a few structs and removed them on the Perms struct as the PluginPerms API supersedes them there.
Plugins can now see the router instance.
The plugin initialisation handlers can now throw errors.
Plugins are now initialised after all the forum's subsystems are.
Refactored the unit test logic. For instance, we now use the proper .Log method rather than fmt.Println in many cases.
Sorry, we'll have to break Github's generated file detection, as the build instructions aren't working, unless I put them at the top, and they're far, far more important than getting Github to recognise the generated code as generated code.
Fixed an issue with mysql.go's _init_database() overwriting the dbpassword variable. Not a huge issue, but it is a "gotcha" for those not expecting a ':' at the start.
Fixed an issue with forum creation where the forum permissions didn't get cached.
Fixed a bug in plugin_bbcode where negative numbers in rand would crash Gosora.
Made the outputs of plugin_markdown and plugin_bbcode more compliant with the tests.
Revamped the phrase system to make it easier for us to add language pack related features in the future.
Added the WidgetMenu widget type.
Revamped the theme again. I'm experimenting to see which approach I like most.
- Excuse the little W3C rage. Some things about CSS drive me crazy :p

Tests:
Added 22 bbcode_full_parse tests.
Added 19 bbcode_regex_parse tests.
Added 27 markdown_parse tests.
Added four UserStore tests. More to come when the test database functionality is added.
Added 18 name_to_slug tests.

Hooks:
Added the pre_render hook.
Added the pre_render_forum_list hook.
Added the pre_render_view_forum hook.
Added the pre_render_topic_list hook.
Added the pre_render_view_topic hook.
Added the pre_render_profile hook.
Added the pre_render_custom_page hook.
Added the pre_render_overview hook.
Added the pre_render_create_topic hook.

Added the pre_render_account_own_edit_critical hook.
Added the pre_render_account_own_edit_avatar hook.
Added the pre_render_account_own_edit_username hook.
Added the pre_render_account_own_edit_email hook.
Added the pre_render_login hook.
Added the pre_render_register hook.
Added the pre_render_ban hook.

Added the pre_render_panel_dashboard hook.
Added the pre_render_panel_forums hook.
Added the pre_render_panel_delete_forum hook.
Added the pre_render_panel_edit_forum hook.
Added the pre_render_panel_settings hook.
Added the pre_render_panel_setting hook.
Added the pre_render_panel_plugins hook.
Added the pre_render_panel_users hook.
Added the pre_render_panel_edit_user hook.
Added the pre_render_panel_groups hook.
Added the pre_render_panel_edit_group hook.
Added the pre_render_panel_edit_group_perms hook.
Added the pre_render_panel_themes hook.
Added the pre_render_panel_mod_log hook.
Added the pre_render_error hook.
Added the pre_render_security_error hook.

Added the create_group_preappend hook.
Added the intercept_build_widgets hook.
Added the simple_forum_check_pre_perms hook.
Added the forum_check_pre_perms hook.
2017-07-09 13:06:04 +01:00
Azareal 8c1d8d5c64 Split database.go's contents off into their own functions for reusability's sake. 2017-06-14 10:55:47 +01:00
Azareal fab2db0936 Added the Control Panel Dashboard.
Bumped the version requirements upto Go 1.8
Added gopsutil as a dependency.

Added the minify_templates and super_debug config.go options.
Cleaned up the console.
config.go is a little more organised now.
2017-05-07 09:31:41 +01:00
Azareal 27df532617 Authenticated SMTP is now fully functional.
Tweaked the newlines in the validation email.
2017-03-16 05:06:58 +00:00
Azareal 3662a298d4 Added support for authenticated SMTP. I'm going to do a few tests on this tonight.
Added 87 new emoji shortcodes. We now have all of the Unicode v1.1 emojis covered.
Added support for #fid hashlinks.
Added the :(, :O, :o, and :p smiley codes.

Fixed a bug where the topic data wasn't getting updated after creating a reply.

Added the get_forum function.
Added the get_forum_copy function.
Added the build_forum_url function.
2017-03-15 08:34:14 +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 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 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 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 78a6eae0e8 Added the Group Permissions system.
Added the account activation system (just manual activations, email ones are coming later o.o).
Changed the benchmark test to an interface{} struct versus a typed one.
Changed the compiled template holders from a map of functions to handle variables.
Added elses for loops in the template compiler.
Added the list setting type.
Added friendlier values to the setting page :)
Added a link to the profile on the User Manager and new mini-tag mark-up to go with it.
2016-12-21 02:30:32 +00:00
Azareal b9885e9d7a Simplified adding variant hooks.
The benchmark now uses ten replies instead of one for a more relevant result.
Slices are now used instead of maps for itemLists.
The compiled template engine now supports slice loops.
More routes are compiled now.
Fixed a bug with the sorting of the itemLists in the templates.
Guests can no longer see the reply creation forms.
Fixed the notice system.
2016-12-18 12:56:06 +00:00
Azareal 7b1f27bf41 Added the ability to compile templates down to Pure Go code.
I'm slowly rolling this feature out to the various routes and doing tests.

Added the notice system.
Added the "You are banned" notice.
Added the Sendmail experimental plugin for sending emails without needing a SMTP server.
Added the debug flag for tuning down the amount of noise in the console.
Converted a system notice over to the notice system.
Changed the Activation Function signature to allow it to return errors which abort the process of plugin activation.
Plugins can now set tags. These will be visible in the Plugin Manager at a later date to specify a small snippet of additional information.
Variadic hooks are now first class citizens of the Plugin API rather than just an experiment.
SessionCheck() and the new SimpleSessionCheck() can now halt further processing of a route.
Deleted plugins are no longer shown on the Plugin Manager.
The registration form no longer allows users with blank names, emails or passwords to register.
The registration form now blocks some extremely common passwords.
Added the new status CSS to the /forum/ route.
Simplified some of the range loops in the templates.
2016-12-16 10:37:42 +00:00
Azareal ec2c02d7c9 Added the plugin system.
Added the report system.
Rebranded the project.
Improved the installation instructions.
Changed the open / close status CSS.

Added the Hello World plugin.
Added the Skeleton plugin.
2016-12-11 16:06:17 +00:00
Azareal 12abd657e1 Added emojis. The emoji picker is coming soon, as is the font file. More emojis coming soon ^_^
Added the ability to ban and unban users.

Improved the installation instructions.
Changed the collation of the tables from utf8_general_ci to utf8mb4_general_ci.
Changed the group ID order.
Custom pages are now templates rather than little snippets being inserted into a template.
Changed the collation of the driver to utf8mb4_general_ci.
Added a default_group config setting.
Ban flag is overwritten for admins and super mods.
2016-12-08 14:11:18 +00:00
Azareal 72d7beefe9 Added the profile system.
Added the profile comment system.
Added group tags.
Improved the avatar placement logic.
Users without avatars will now get noavatars. Customisable in config.go
Only admins can see the Control Panel link now.
Fixed a problem with Git not including /uploads/ which can crash the program.

Database changes:
Added active column to forums.
Added tag column to users_groups.
Added the users_replies table.
Commented out the replies_reports table.
2016-12-07 09:34:09 +00:00
Azareal 30ecdf8d93 Added the forum cache. The rest of the code now uses it instead than firing queries on every request.
Added the ability for admins to delete forums.
Added the ability for admins to edit forums.
Added the Uncategorised Forum for topics with an ID of 0. Possibly for deleted forums in the future?
Added the uncategorised forum visibility switch.
Creating forums now has an anti-CSRF session check. The same is true with the newly implemented forum deletion and modification features.
Cleaned up some of the error code.
2016-12-06 10:26:48 +00:00
Azareal 689b1a804b Static files are now served from memory. This feature's a little experimental, so it will need a lot of testing i.i
Added an executable file. Only works on Windows, if it doesn't work, then try building it for yourself with build.bat or go build
Tweaked run.bat to make it more firewall friendly. It now generates an executable.
Moved the files around to make it more organised.
Added build.bat which you can use to build the program for you and install the libraries the software depends on.
2016-12-05 07:21:17 +00:00