Commit Graph

80 Commits

Author SHA1 Message Date
Azareal fdb6304e32 Mostly a mid-way technical commit to make reading diffs easier on me.
Split the relativeTime function into relativeTime and relativeTimeFromString.
Refactored the installer.
Made a lot of progress with PgSQL and MSSQL support, mostly MSSQL.
Made a lot of progress on the automated testing suite.
Added eqcss to the file extension list.
..depressed..
Fixed various bugs here and there.
gen_mysql.go is now properly excluded when the pgsql or mssql build tag is passed.
The BBCode plugin is now always initialised prior to it's test.
We've begun transitioning towards deserializing database times directly into time.Times rather than doing it every time on the spot.
Added more dev flags.
The tests now make use of a test database rather than the production database.
2017-10-14 08:39:22 +01: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 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 99da1fcbaa Added support for word filters.
Added support for temporary bans.
Moved the Gosora specific template logic out of main.go and into template_init.go

Added an internal temporary group API.
We now use h1s in the theme headers. There may be some issues with the themes other than Shadow which we may need to resolve.
Added ARIA attributes in a few places for improved accessibility.
Added support for inputs in links for the .edit_field API.
Removed a few unneccesary prepared statements.
2017-08-27 10:33:45 +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 166d96e3b2 You can now dismiss alerts.
Refactored the API system.
Fixed a bug in the default topic where the forum didn't have a time set.
The JS is now run in strict mode.
Fixed a bug in the titles where they broke onto multiple lines.
Fixed a bug in create topic where the datetime wasn't getting set for the forum.
Fixed a bug in create reply where the local cache wasn't getting updated.
Fixed a bug in create reply where the wrong forum was getting updated.

Phased out jQuery in a few bits of JS to make it easier to understand.
2017-08-18 13:16:56 +01:00
Azareal f41c281e43 Added support for HTTP/2 Push.
The themes are still going to be a little broken for a while, but here's the progress I've made.

Renamed the topics_trow_assign hook to topics_topic_row_assign.
Added more debug code to the generated router.
Added a robots.txt file.
Gosora now responds to favicon.ico requests with a 404 rather than the topic list.
Fixed the tests and some of the benchmarks.
Changed the default UserCacheCapacity from 100 to 120.
Changed the default TopicCacheCapacity from 100 to 200.
Added the last replyer to the topics list and the forum pages.
Added the BulkCascadeGetMap method to the UserStore.
Refactored the topics list and forum page to load the users with a call to the UserStore rather than via a join.
WebSockets now work on SSL.
Fixed a race condition when the user permissions are initialised at the start of a request.
Fixed a race condition when the user permissions for the OP of a topic are initialised.
The rows.Close() calls are deferred once more, so that we can catch problems with recover()
Improved support for struct pointers in the template compiler.
Added a pin emoji to pinned topics to make them stand-out on the Shadow theme, we have some other ideas in mind for this, but I'd like to get Shadow fully functional for this commit.
Fixed a bug an issue with Chrome not detecting XHTML style closes on <form>s.
Fixed a visual issue with `color` not being set for textarea elements for the Shadow theme.
Fixed a function which wasn't getting renamed for PGSQL.

Added seven new UserStore tests.
2017-08-06 16:22:18 +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 02a0cbb6bb More work on the Shadow theme.
Switched gopsutil with a temporary more stable fork.
Ping PostgreSQL upon connecting. We need a global solution for connection drops. A connection timeout, perhaps?
Added the rowmenu CSS class for styling sidebar menus.
Added the real_first_child CSS class, we might be able to get around using it by redoing the <form> nesting.
Added the rowlist CSS class.
Added the bgavatars CSS class.
Added avatars to the User Manager.
Added limited responsivity to the Shadow Theme, I might have broken some things in the other themes, I'll fix that soon!
A per-theme post-avatar-bg.jpg file is now used for the first topic layout rather than the global white-dot.jpg file.
2017-07-29 11:36:39 +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 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 e099dfd40e Added the query generator. It's a work in progress and in constant flux.
Added forum descriptions.
Began work on the Advanced Forum Editor. Not to be confused with the Quick Forum Editor. You can access it by going to /panel/forums/edit/{forumid} We'll fix it so the Forum Manager links to it in the next commit.
Fixed the Linux shell scripts.
Fixed an issue with relative timess being off by an hour due to timezones.
Added reply count and author names to the topic list and forum pages.
Improved the look of the forum list, forum page, and topic list.
Added an overlay effect for when the alert list is open on mobile.
You can now close the alert list by clicking on the bell.
Removed the "Report:" prefix from report posts.
Fixed a bug in the template system where "and" and "or" wouldn't work on non-boolean values.
Improved the debug logging in the template system.
Fixed a bug in the forum creator where the "Hidden?" value was inverted.
Fixed a visual bug in the profile where the Ban button rendered in a glitchy way.
Added support for hidden fields to the JS Framework for inline editing rows.
Fixed a bug with the like counter rendering on-top of the alert list.
Atom's stripping trailing tabs for some reason, so don't be confused if there are a bunch of weird changes.
2017-06-05 12:57:27 +01:00
Azareal 9b1489b90f Happy 100th commit! For the 100th commit, I've revamped a good portion of the user interface, and we don't plan on stopping! There's more to come!
Each theme has more of a distinct feel in the control panel now. I moved a large portion of the inline CSS into global.css, tweaked some core code which didn't line up, and added CSS text insertions to make things more flexible.

Revamped the alerts interface. We have more changes coming up!
Added screenshots for Tempra Cursive and Tempra Conflux Mobile to the README.
Added a .htaccess file, just in case someone plops Gosora in Apache's /www/ folder to stop the contents of config.go from becoming publically visible. Never put Gosora in your /www/ folder, Gosora is a standalone program which does NOT use Apache or any other webserver.
Fixed a bug in the inline forum editor.
Added a hand-written Markdown parser which is much faster than the previous Regex based one. This is still a work in progress.
Added support for strikethrough and underline elements to the Markdown parser.
Fixed the missing semicolons in global.js
Revamped the form CSS.
Author bits on the theme manager now link to the author's website.
Improved the profiles a little.
The code in the stylesheets now have a more consistent style.
Fixed a bug in the Cosmo theme relating to the fact that Gosora doesn't have sidebars yet.

There are many more changes which aren't listed here.
If weirdness regarding lines or spacing occurs, I'm experimenting with a new text editor. I hope to have this fixed by the next commit.
2017-05-29 15:52:37 +01: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 df5f70ee6b You can now post in any forum you want via the Board selector.
Added a lock indicator for forums you don't have permission to post in.
Added a New Topic option in forums you have permission to post in.
General is now the default forum for topics.
/topics/ no longer shows topics for forums you aren't able to access.
2017-02-05 14:41:53 +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 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 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
Azareal 9f2efce516 The design is now responsive. It looks decent on mobile phones, tablets, laptops and desktop computers.
The router is now benchmarked. The custom router we'll use to replace it will also be benchmarked once it's completed.
Added a placeholder page for the Control Panel Dashboard.
Tightened some of the control panel route permission checks.
Moved the Control Panel menu into it's own template.
Added permission checks to the links on the Control Panel menu.
2016-12-24 13:14:40 +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 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 6a320edbb4 Added the ability to assign users as moderators without also giving them the administrative tools.
Profile owners can now moderate their own profiles.
Fixed an issue with database entries being set as null.
A message now appears when there aren't any topics in a forum or in the global topics list.
Added the link to the current user's profile to the main menu.

Database Changes.
not nulled some columns.
Added is_mod column to users_groups.
Added the Moderator usergroup.
2016-12-07 13:46:14 +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