qswiki
Ir para arquivo
2021-10-08 00:11:58 +02:00
cache cache: MapCache: Introduce MapCache, thread-safe cache (key/value store) 2021-10-08 00:08:00 +02:00
database PermissionsDao: Add save() 2021-10-05 21:51:31 +02:00
gateway get header-only library dependencies using git submodules 2020-03-18 22:21:03 +01:00
handlers Adjust to new Template::getPage() returning value, not reference 2021-10-08 00:11:58 +02:00
sandbox Sandbox: Remove multiple stages 2021-10-03 23:53:56 +02:00
setup setup: Fix broken FTS DELETE op 2021-09-23 17:13:08 +02:00
submodules submodules: update cpp-httplib 2021-09-29 18:28:18 +02:00
template/quitesimple template: Remove user_changepw, it's usersettings now 2021-04-16 16:37:34 +02: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
.gitmodules gitmodules: update qssb.h repo location 2020-08-23 17:20:25 +02:00
authenticator.cpp Authenticator: Introduce AUTH_DEFAULT_SALT_SIZE 2021-10-03 17:01:03 +02:00
authenticator.h Authenticator: Introduce AUTH_DEFAULT_SALT_SIZE 2021-10-03 17:01:03 +02: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
cli.cpp CLI: Begin 'page' and 'pageperms' commands 2021-10-05 21:57:20 +02:00
cli.h CLI: Begin 'page' and 'pageperms' commands 2021-10-05 21:57:20 +02:00
cliconsole.cpp Introduce CLI 2021-10-03 17:05:46 +02:00
cliconsole.h Introduce CLI 2021-10-03 17:05:46 +02:00
cliserver.cpp Introduce CLI 2021-10-03 17:05:46 +02:00
cliserver.h Introduce CLI 2021-10-03 17:05:46 +02:00
config.cpp Add usersettings template and config values 2021-03-26 22:45:09 +01:00
config.h Add usersettings template and config values 2021-03-26 22:45:09 +01: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 don't link with boost anymore as regex is handled by std now 2020-04-19 17:02:21 +02: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 Add version.{h,cpp}: Returning version info 2021-10-03 23:01:19 +02: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 utils: split: Rename all splitBy*() variants to split() 2021-04-18 13:35:02 +02:00
parser.h don't link with boost anymore as regex is handled by std now 2020-04-19 17:02:21 +02:00
permissions.cpp Permissions: Add toString() 2021-10-03 17:01:48 +02:00
permissions.h Permissions: Add toString() 2021-10-03 17:01:48 +02:00
qswiki.cpp Template: Use MapCache, getPage(): Return value, not reference 2021-10-08 00:11:30 +02:00
random.cpp Random: Mark getRandom* const 2021-04-18 13:35:43 +02:00
random.h Random: Mark getRandom* const 2021-04-18 13:35:43 +02:00
README.md Update README.md: Document build with git submodules 2020-08-23 17:38:06 +02:00
request.cpp utils: split: Rename all splitBy*() variants to split() 2021-04-18 13:35:02 +02:00
request.h Let's make (git) history! 2018-11-03 17:12:20 +01:00
requestworker.cpp Adjust to new Template::getPage() returning value, not reference 2021-10-08 00:11:58 +02:00
requestworker.h RequestWorker: take unique ptr (fixes regression) 2019-09-29 21:34:21 +02: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 Template: Use MapCache, getPage(): Return value, not reference 2021-10-08 00:11:30 +02:00
template.h Template: Use MapCache, getPage(): Return value, not reference 2021-10-08 00:11:30 +02: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 Add usersettings template and config values 2021-03-26 22:45:09 +01:00
urlprovider.h Add usersettings template and config values 2021-03-26 22:45:09 +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 utils: introduce trim() 2021-10-03 16:51:04 +02:00
utils.h utils: introduce trim() 2021-10-03 16:51:04 +02: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
version.cpp Add version.{h,cpp}: Returning version info 2021-10-03 23:01:19 +02:00
version.h Add version.{h,cpp}: Returning version info 2021-10-03 23:01:19 +02: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 instead of switching distributions or searching for other wikis that I could use, 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 skills a little bit.

Of course, it's pretty straightforward at first. No really: Just use CGI. And indeed, that would have been more than enough for my use cases. 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, since it was mostly a playground for me, the code became unmaintainable. Furthermore, I wanted something quick and given that it was CGI, I didn't bother taking care of memory leaks. After initiating a FastCGI interface, they became an issue and then the task of avoiding memory leaks became too annoying. And of course, C does n ot 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 future C++ standards.

Features

To be fair, at this point it doesn't even have a "diff" between revisions yet and does not have features that would 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

On Linux namespaces are used to restrict the process to only access files it needs. It doesn't have access to other paths in the system. In addition, Seccomp is used to restrict the syscalls the qswiki process can call. As for "web security", all POST requests are centrally protected against CSRF attacks and all input is escaped against XSS attacks.

Building

Dependencies:

The first three are header-only libraries that are included as a git submodule. The others must be installed, e. g. by using your distributions standard method.

If all dependencies are available, run:

  git submodule init
  git submodule update
  make release

Setup

To be written