qswiki
Αναζήτηση αρχείου
2019-05-12 21:26:10 +02:00
cache Let's make (git) history! 2018-11-03 17:12:20 +01:00
database permissionsdao: no silent fallback to user-permissions if we find none for user 2019-05-03 16:00:36 +02:00
gateway httpgateway: set new max payload length config value 2019-05-04 00:02:17 +02:00
handlers handlerlogin: use std::atomic for counter and lockguard in ban check 2019-05-12 21:26:10 +02:00
setup user model: added enabled column 2019-05-03 15:56:16 +02:00
template template/quitesimple: hack to hide sidebar in portrait mode 2019-02-22 10:40:02 +01:00
tests Let's make (git) history! 2018-11-03 17:12:20 +01:00
.gitignore Let's make (git) history! 2018-11-03 17:12:20 +01:00
category.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
category.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
config.cpp httpgateway: set new max payload length config value 2019-05-04 00:02:17 +02:00
config.h httpgateway: set new max payload length config value 2019-05-04 00:02:17 +02:00
cookie.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
cookie.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
Dockerfile Begin a basic Dockerfile 2019-02-21 10:48:36 +01:00
headline.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
headline.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
htmllink.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
htmllink.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
iparser.h Parser: Function to exstract 'commands'/attributes (e. g. visible, renaming) 2018-11-04 19:33:06 +01:00
LICENCE Let's make (git) history! 2018-11-03 17:12:20 +01:00
logger.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
logger.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
Makefile Makefile: do not hard code g++ version. On ancient systems left up to user to set it properly... 2019-02-21 10:51:07 +01:00
page.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
page.h Page: add id field 2018-11-04 19:31:58 +01:00
parser.cpp Temporarily switch to boost::regex 2018-11-11 21:37:59 +01:00
parser.h Temporarily switch to boost::regex 2018-11-11 21:37:59 +01:00
permissions.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
permissions.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
qswiki.cpp Fixed: inverted boolean in check for enabled anon user 2019-05-03 23:26:08 +02:00
random.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
random.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
README.md Let's make (git) history! 2018-11-03 17:12:20 +01:00
request.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
request.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
requestworker.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
requestworker.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
response.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
response.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
revision.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
revision.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
searchresult.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
session.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
session.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
template.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
template.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
templatepage.cpp proper prefix in templates: wikiqs -> qswiki 2018-11-16 16:54:35 +01:00
templatepage.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
TODO updated TODO 2018-11-10 22:44:26 +01:00
urlprovider.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
urlprovider.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
user.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
user.h user model: added enabled column 2019-05-03 15:56:16 +02:00
utils.cpp Temporarily switch to boost::regex 2018-11-11 21:37:59 +01:00
utils.h Temporarily switch to boost::regex 2018-11-11 21:37:59 +01:00
varreplacer.cpp Let's make (git) history! 2018-11-03 17:12:20 +01:00
varreplacer.h Let's make (git) history! 2018-11-03 17:12:20 +01:00

qswiki

About

qswiki is a wiki software, intended for small wikis. Originally implemented in C, it's now written in C++.

History

A couple of years ago, I wanted to setup a personal wiki on my raspberry pi. However, the distribution I used back then did not have a PHP package for ARM. So I decided I would write one in C. Yes, that's an odd way to approach the problem and indeed, I may have had too much time back then. Also, I wanted to see how it's like to write a "web app" in C and wanted to sharpen my C a little bit.

Of course, it's pretty straightforward at first. No really. Just use CGI. And indeed, that's probably more than enough. Then I decided to play around and started using FastCGI (with the official library from now defunct fastcgi.com) and created a multi-threaded version. It initially used a "pile of files database", but that became too painful, so then I started using sqlite.

C++

Eventually the code became unmaintainable. Initially, I wanted something quick. I did not care about memory leaks (as it was CGI initially). After FastCGI, they became an issue. In the end, the task of avoiding memory leaks became too annoying. And of course, C does not include any "batteries" and while I could manage, this too was another good reason.

Overall, I am just continuing the experiment with C++17 now. It's not nearly as bad as you would expect perhaps. Some things are surprisingly convenient even. Still, the standard library is lacking and I would hope for a some better built-in Unicode support in the future.

Features

To be fair, at this point it doesn't even have a "diff" between revisions yet and does not have features that make you prefer it over other wikis.

  • CGI
  • HTTP server using the header only library cpp-httplib. It's more portable and more "future-proof" than FastCGI (since the official website disappeared, the library's future appears to be uncertain).
  • Support for user accounts. Passwords are stored using PBKDF2. sqlite database, but not too much of an effort to add other types of storage backends. sqlite is using the great header only library sqlite_modern_cpp
  • Relatively fine-grained permission system.
  • Categories
  • Templates
  • FTS search
  • Caching

Security

The most reasonable way would have been to add some sort sandboxing support right away, but this is lacking so far. As for "web security", all POST requests are centrally protected against CSRF attacks and all input is escaped against XSS attacks.

Building

Dependencies:

Given the fact those are header-only libraries, they are already included here, so you only need to run:

make release

Setup

To be written