Commit Graph

275 Commits

Author SHA1 Message Date
b379829839 Now object uses my string and vector aswell. 2021-11-13 09:53:08 +01:00
b6cae73521 Added a new SharedResource class. It contains a mutex over Resource (for now). These can be used as a base for classes that you don't intend to just query from a database every time. E.g. rbac rank data. 2021-11-12 10:00:41 +01:00
946c799a3b is_numeric, is_int, is_uint,and is_zero helpers for string. 2021-11-09 22:54:04 +01:00
9bc41ad6e4 For attribute for HTMLTag. 2021-11-09 22:53:30 +01:00
8bd6f0aea6 Added a new execute method to Platform, and moved the execute method from the crash handler to platform linux. 2021-11-09 19:46:08 +01:00
c94c465d78 Added a mutex class. 2021-11-09 19:38:07 +01:00
d8db74b0ed Added a virtual get_executable_path method to Platform. 2021-11-09 19:27:43 +01:00
3dce2b69d9 Fix erase, and small fixes for utf8, and parse_utf8. 2021-11-09 19:23:36 +01:00
19cb8ad6d8 Ported utf8 functionality from godot's string. 2021-11-09 18:13:39 +01:00
eb8c105f72 Merge branch 'master' of github.com:Relintai/rcpp_cms 2021-11-09 17:47:57 +01:00
0bca7735e1 Added a new Platform class. 2021-11-09 17:47:51 +01:00
d637c2132c Added a super simple arg parser. 2021-11-09 17:47:39 +01:00
e8b822c64a Small fix. 2021-11-04 11:17:43 +01:00
cc0ca4762a Removed stray crash cond. 2021-11-03 15:43:22 +01:00
c21a86c9d2 Initial platform setup, and added godot's crash handler (will need to be heavily reworked!). 2021-11-03 15:42:16 +01:00
80c3b97a6b Added new helper methods to HTMLBuilder. 2021-11-02 12:26:46 +01:00
0a53e84fb4 Added new helpers to the Request, and smaller fixes. 2021-11-02 12:25:04 +01:00
dadd431f1c Added bool_num, and bool_str to the String. 2021-11-02 12:24:33 +01:00
212a144215 Swap and simple sort for the vector. 2021-11-02 12:23:59 +01:00
43b7a352a5 A bit more work on the rbac admin interface. 2021-11-02 00:18:57 +01:00
a330d0f51a Implement the rbac rank editor. 2021-11-01 23:48:25 +01:00
7fecc3e9ff Added helper methods for writing numbers into HTMLBuilder. 2021-11-01 22:47:48 +01:00
aaa48e390b Added a few number to string conversion methods form the godot engine to the string. 2021-11-01 22:41:19 +01:00
a19bcea0f0 Added my Math class. 2021-11-01 22:18:08 +01:00
2c8e5e33b6 Work on the rbac controller's admin panel. 2021-11-01 21:21:03 +01:00
68ecd088c5 Added more helpers to Request. 2021-11-01 21:20:42 +01:00
e7d4772ef3 Added get_url_root_parent helper to Request. 2021-11-01 20:57:43 +01:00
1a09dd13b0 Add f() (finish/finalize) to HTMLBuidler. 2021-11-01 20:56:13 +01:00
b1be711eb4 Better chaining support for the html builder. 2021-11-01 20:53:22 +01:00
f7b5952d2a Did most of the remaining std::string and vector to String and Vector conversions. 2021-11-01 19:53:35 +01:00
3f190e9a53 Same for the hasher. 2021-11-01 19:16:43 +01:00
e977de894a Now the http backends are also using String. 2021-11-01 19:11:27 +01:00
adc73d593d Prefix the helper error macros so they differ from trantor's logger declarations. 2021-11-01 19:11:03 +01:00
041f824448 Erase, substr for String, and fixed comparisons. 2021-11-01 19:10:12 +01:00
dd966c9248 FormValidator and HTMLBuilder now uses my string and vector aswell. 2021-11-01 18:00:34 +01:00
21558cb09a The database sub system now uses only my string. 2021-11-01 17:49:10 +01:00
faac12d3b1 Now QueryBuilder is using my string. 2021-11-01 17:31:04 +01:00
cfb5f877c8 Now instead of having an escaped version of the methods that has string parmeters in QueryBuilder, they have an unescaped version, and the base version escapes. Having it like this is a lot safer. 2021-11-01 17:23:08 +01:00
6073ef90c9 Fix typo. 2021-11-01 17:00:55 +01:00
02c4294cda Now QueryBilder, QueryResult, and TableBullder are returned wrapped into a Ref<> from the database subsystem by default. 2021-11-01 16:57:22 +01:00
20b59847fe Small fixes and improvements to the string. 2021-11-01 01:39:11 +01:00
3ae9ae5127 Added copy assignment operator to string. 2021-11-01 01:02:18 +01:00
37ae4faa29 Add log and containers folders to the compile. 2021-11-01 00:43:22 +01:00
ef7b39bfb1 Added 2 url helpers to Request. 2021-11-01 00:38:26 +01:00
ad4e3bec3c std::string conversion operator for my string. 2021-11-01 00:32:02 +01:00
2079d5bd6e Added a few operators to String to simplify mixing it with std::strings. 2021-10-31 23:55:44 +01:00
7ef1c76e4a Added error macros and a simple logger. 2021-10-31 23:34:08 +01:00
3c1a60c898 Added my string, queue, and vector implementations. 2021-10-31 23:33:48 +01:00
304a2a19c9 Added a simple new Model and Controller class. 2021-10-31 21:44:44 +01:00
8e4bb75bcb Implement redirects. 2021-10-31 02:50:06 +02:00
001c3ee717 Fix compile. 2021-10-31 02:49:54 +02:00
dbb616b9e0 Added http status code enum. 2021-10-31 02:39:54 +02:00
6aae520ed4 Added doctype declaration. 2021-10-30 23:32:06 +02:00
b3c1b6ccac Added content quick tag. 2021-10-30 23:31:54 +02:00
74389bb71c Comment out 2 prints. 2021-08-23 00:13:16 +02:00
214b268aae Now int data in the session will be saved to the database. 2021-08-22 23:53:26 +02:00
83ea2c0587 Fix warning. 2021-08-22 23:01:39 +02:00
4546d583d1 Cleaned up Resource and User. 2021-08-22 22:38:08 +02:00
8fa6548e44 Added a reference map to Request. Also fixed 2 warnings. 2021-08-22 22:17:32 +02:00
8318e0257a Added reference support to the session. 2021-08-22 22:03:10 +02:00
928475d733 Added more things to QueryBuilder. 2021-08-22 21:44:20 +02:00
d2cff831bd Now SHA256 also from Reference. 2021-08-22 21:06:47 +02:00
4c8920777f Remove the simple getters/setters from Resource. They are not needed anymore. 2021-08-22 20:57:37 +02:00
f9df80e197 Fix Instancing Ref<>'s. 2021-08-22 20:50:26 +02:00
dd653ae60a Now QueryBuilder, QueryResult and TableBuilder are inherited from Reference. 2021-08-22 20:41:59 +02:00
2c8efb0180 More cleanups and moved save from FileBasedUser to User. 2021-08-21 20:15:29 +02:00
b309705f10 Removed the properties, as this implementation did not work with polymorphism. 2021-08-21 20:06:53 +02:00
c5dcb3106e Implemented int property serialization in to_json(). 2021-08-21 17:12:48 +02:00
f586f1ae3a Forgot to save. 2021-08-21 16:40:17 +02:00
464576468b Call parent constructors. Todo: I need to figure out how godot manages to get away without doing this. 2021-08-21 16:39:38 +02:00
c372eaa8cf Implemented properties into Resource. I used the simplest implementation I could come up with. If they work well I will make them better. 2021-08-21 16:36:52 +02:00
af37189fcf Initial Resource implementation. 2021-08-21 14:40:30 +02:00
584cff535f Added a new Resource class. Similar idea as in godot, but this will work differently. 2021-08-21 13:53:23 +02:00
f897b42b37 Added a godot's Reference class and a few smaller headers. 2021-08-21 13:47:58 +02:00
ae88f5b746 Placeholder html attribute. 2021-08-20 20:32:23 +02:00
7e8a7671e4 More work on the form vlaidator. 2021-08-20 20:32:09 +02:00
127563e6ca Implement logout. 2021-08-20 19:29:39 +02:00
f8ba0b26c5 More improvements to form validation. 2021-08-20 19:18:26 +02:00
3bc7bd98c6 Even more work on from validation. 2021-08-20 18:00:50 +02:00
0abb42bd61 More form validators. 2021-08-20 17:26:56 +02:00
cd59ae4860 Form validator initial implementation. 2021-08-20 15:54:12 +02:00
4228448fc1 Added and and or to the query builder, and implemented offset and limit for the sqlite query builder. 2021-08-20 13:14:06 +02:00
1ae34a3500 Added more getters to the query result. 2021-08-20 12:58:37 +02:00
af05bd037c More work on the query builder. 2021-08-20 12:49:57 +02:00
5050f31ba0 Update sql statement for the query builder. 2021-08-20 12:11:27 +02:00
2c5293f959 Lost of work on the query/table builders. 2021-08-20 01:32:43 +02:00
d2a0f25369 Lots of work on the table builder. 2021-08-19 23:55:16 +02:00
8ebb648d37 More work on the query builders. 2021-08-19 22:03:22 +02:00
8de082ffba Started reworking the QueryBuilder. Now instead just creating a query string (when finished) it will actually be able to handle querying, escapes, and also prepared statements. 2021-08-19 14:12:02 +02:00
711d1eed6f Added get_or_create_session helper to Request. 2021-08-05 19:34:11 +02:00
b55cb85855 implement get_parameter to Request. 2021-08-05 18:24:55 +02:00
543f1eed30 Added http method support to the request class. 2021-08-05 17:11:13 +02:00
6ea8d3e39a Added the value tag to the html builder. 2021-08-05 17:10:51 +02:00
0b8dcea37a Reword a comment. 2021-08-04 22:04:33 +02:00
2a2b3a6d60 Actually make session_setup_middleware work. 2021-08-04 21:58:25 +02:00
e62d012ec1 Added a middleware func to SessionManager that can set up request's session property. 2021-08-04 21:36:09 +02:00
8fc5eca9d4 Reset the singleton pointer in SessionManager's destructor. 2021-08-04 21:22:06 +02:00
652543ef19 Fix include guard. 2021-08-04 21:10:43 +02:00
c4dd81995e Added a session manager. 2021-08-04 21:02:34 +02:00
9e6645bad6 Added a session pointer to request. 2021-08-04 20:33:21 +02:00
2521c28a9a Added a http session class. 2021-08-04 20:32:51 +02:00
e19bd5b7ef Added a new data map property to Request for storing stuff like a session object, etc. 2021-08-04 15:44:52 +02:00
714eb02819 Added cookie support to the request. Implemented it for the drogon/trantor backend. 2021-08-04 15:36:26 +02:00
a86b5c2670 Added escape methods to the Database class. Implemented them for the MySQL, and Sqlite backend. 2021-07-08 18:52:59 +02:00
95e54b3a41 Also added an SHA256 abstract class to core, with swappable implementation support. 2021-07-07 14:21:36 +02:00
4c891a373e Fix DRequest. File support is still todo. 2021-07-06 22:06:18 +02:00
92ce00a88c Fixed routing in the brynet backend. 2021-07-06 20:23:13 +02:00
a16222e29e Fix newly introduced crash in the Brynet backend. 2021-07-06 20:15:36 +02:00
5c2d97ebbb Fix response allocation in BryRequest. 2021-07-06 20:08:11 +02:00
29dabe752f Made Request a base inheritable class, and made DRequest inherit from it. Also added BryRequest for the brynet backend. Also made DWebApplication inherit from WebApplication. 2021-07-06 20:06:38 +02:00
a47cb57da7 Renamed BryWebApplication to WebApplication, and moved it and HandlerInstance and Request to a new http folder. Their dependencies with brynet will be removed, they will have subclasses per backend when/if needed. 2021-05-27 17:37:23 +02:00
a34995e1b7 Moved every brynet based http class in core to a new bry_http folder. 2021-05-27 17:06:42 +02:00
843e8153ff Moved the html helpers to a html folder. 2021-05-27 16:57:38 +02:00
0c0123889b Renamed the Application class to BryWebApplication. 2021-05-27 16:52:53 +02:00
7279035237 Moved the database related classes in core to a subfolder aswell. 2021-05-15 13:54:28 +02:00
3a00179b3b Moved the http server to a subfolder in core. 2021-05-15 13:48:46 +02:00
679c6d37c1 Removed the namespaces from brynet. 2021-05-14 17:49:39 +02:00
c7ae476853 Add a ddb (default database) member to DatabaseManager. 2021-05-01 21:53:21 +02:00
c6033ab136 Added loop one method to http server. 2021-05-01 17:37:10 +02:00
d4ccc6775d Update brynet to the latest. 2021-04-30 16:10:14 +02:00
8c483b4f8e Removed static members from application. 2021-04-28 22:58:13 +02:00
614a496b7d Application is not a singleton anymore, as I think having multiple ones can be useful. HttpServer has an application pointer now (temporarily), it will be subclassed later. 2021-04-28 22:50:05 +02:00
c5ea34afdc Don't check for connection closed in send and send_file. Sometimes the connection closed callback gets called before send, but the connection still seems to be alive. Will work on it later. 2021-04-28 21:48:34 +02:00
b8624f190a Remove static handlers from http server. 2021-04-28 21:17:57 +02:00
23d085794c Added a mutex for writing/reading _request_map in HTTPServer. 2021-02-09 09:48:08 +01:00
67e740e35b Fix file chunking with downloads. Also fixed a bunch of std::shared_ptr misuses, and made Application::send_file use Request's file chunking. Also the framework will properly handle client disconnects now. 2021-02-09 01:25:24 +01:00
9a3404a7ac Fix a few path/folder related issues with paged article. Also improved a few error messages. 2021-02-08 11:53:04 +01:00
42758e57ad Revert everything back to bf688577fb . 2021-02-08 11:01:15 +01:00
46565958a1 Fix compile. The new drogon/trantor based server still needs lots of work/cleanups to replace brynet though. 2021-02-03 20:33:36 +01:00
7d000bb5b5 Work on fixing compile. 2021-02-03 19:43:54 +01:00
647694b576 Started migrating to trantor. Took lots of core utility classes from drogon aswell. At the moment the project doesn't compiles! 2021-02-03 02:18:37 +01:00
5cc22461fd Added an _old postfix to a few methods in HttpServer temporarily. 2021-02-02 18:26:22 +01:00
bf688577fb Updated brynet to 1.0.9. 2021-01-29 17:26:17 +01:00
4b64bf5864 Implemented chunked file downloads. For some reason if a file is too big and has to be sent in more that 43 chunks it crashes, it might be a bug in brynet (it always crashes at the 43th chunk, with every file and chunk size setting.), will figure out the problem later. 2021-01-08 02:55:41 +01:00
8e429cee7d Added file support to the paged article. Will not work well with big files at the moment. 2021-01-06 03:57:18 +01:00
d2751d83e2 Disable the emphasized parser in markdown_to_html, so links with underscores work properly. 2021-01-05 19:27:53 +01:00
f146a6a7bc Added 2 pagination helpers to Utils. 2020-12-28 23:13:54 +01:00
2e48e3c4ec Added a url stack to Request, for easier route handling. Also made the main routing middleware use it. 2020-12-28 19:15:27 +01:00
e1dd9c59a0 Added charset helper itno HTMLTag. 2020-12-27 22:38:31 +01:00
ba90610e3e Removed bbcpp. 2020-12-27 03:36:56 +01:00
6c56380d90 Added maddy and switched to markdown from bbcode in ListPage. 2020-12-27 03:35:41 +01:00
e20f1c98a2 Implemented more tags. 2020-12-27 02:38:09 +01:00
6a01c57c36 Added a new Utils class containing helper methods. 2020-12-26 17:49:59 +01:00
f2ea46f5d7 Add missing newline. 2020-12-26 17:48:00 +01:00
7e24a87c57 Add rel and rel_stylesheet into HTMLTag. 2020-12-26 00:17:59 +01:00
8f5c1fa4cc Add footer string into request. 2020-12-26 00:17:36 +01:00
4ea3702768 Added and implemented a HTML builder. 2020-12-11 19:55:19 +01:00
8d61eca08e Renamed form.h and cpp to form_validator.h and cpp. 2020-12-11 17:14:00 +01:00
195f8db964 Added a head and body string to Request, and removed themes. I think themes added unnecessary complexity, and code non-locality (The view methods would have been in a different class.). I think in a language which have headers this is unwanted (The code will be broken up with the mvc pattern, but the methods don't need to be in separate classes.). Themes are still easily implementable by either adding different css links to the new head variable, or by inheritance. 2020-12-11 16:54:41 +01:00
a6b29c04a4 Started working on settings. 2020-12-08 16:22:18 +01:00