colorful rat Ratfactor.com > Dave's Repos

htmlwarden

A flat HTML file Wiki in PHP
git clone http://ratfactor.com/repos/htmlwarden/htmlwarden.git

Files

README.md

HTML WARDen Icon

HTML WARDen

An HTML file wiki in PHP and vanilla JavaScript. No DB, no 3rd party libraries.

Read quite a bit more about this project including a multi-part “making of” article series titled The Wiki Weekend here:

https://ratfactor.com/htmlwarden/

Installation/setup

Clone this repo to a directory accessible on a web server somewhere running PHP.

$ cp example_settings.php settings.php

Edit settings.php and tweak it for your setup. The comments should explain what each option does.

You’ll need to set write permissions to the pages directory to match either the user or group PHP runs under. It is likely your web server’s user/group. Setting permisions may look something like:

$ chgrp -R www pages
$ chmod 0775 pages
$ chmod 0775 pages/archives

You’ll also need to either make index.php the default “index” page for the directory (this is a web server setting) or go to index.php directly in the browser.

Usage

To edit pages, you’ll need to be logged in.

Logins require a link. It will look something like this:

https://example.com/wiki/login.php?login=1234

Where the login above corresponds with an entry in settings.php like so:

'1234'=>'Guest'

If you want a login form instead, you’ll need to make it. Have it submit by POST to the login.php page.

“Pages” are saved as the inner bodies of an HTML document:

You can compare versions with normal command line diff tools. On POSIX systems (such as Linux), this will show changes made since a particular archived version of the foo.html page:

diff pages/archive/1749345875_foo.html pages/foo.html

That’s about it. The source is small, so you can probably figure out how to add things pretty easily if you’re at all familiar with PHP or JavaScript. No libraries of any kind are used.

License and what you can do with it

I’m releasing this under the GNU GPLv3 license. Please see the LICENSE text file in this repo.

In short, you can download, modify, and distribute this program.