A TiddlyWiki HTTP Server written in Go.
- Automatic backup on each save.
- No external dependencies.
- Customizable settings.
- Easy to deploy.
- Works on macOS, Linux and Windows.
- Download the latest build for your platform.
- Extract the archive.
cdinto the directory that was just created.- Put the TeddlyWiki's
empty.htmlfile inside thewwwsubfolder. - Rename the
empty.htmlfile toindex.html. - Run the server:
./twserver. - Open your web browser and browse to: http://localhost:8080.
All server settings can be tweaked using a configuration file located beside the server binary.
The configuration file must use the same name as the binary and must be saved with the .json extension.
- Create a configuration file in
JSONformat (on Linux/macOS):
touch twserver.json- Open the file with your favorite text editor and write the following values (default):
{
"Port": 8080,
"DocumentRootDir": "./www",
"IndexFile": "index.html",
"BackupDir": "./backup",
"BackupFileFormat": ":name:.:date:.html",
"ServeDirs": []
}- Tweak the values as needed, save the file and restart the server.
By default, the HTTP server only serves the index file and rejects any other request. To serve one or more custom directories containing extra resources (such as images), you have to add them by tweaking the ServeDirs value in the configuration file.
- Example: Add the
imagesdirectory located in./imagesand accessed via the URL<wiki_url>/img/:
{
"ServeDirs": [
{
"URL": "/img/",
"Path": "./images"
}
]
}- Any image from the
./imagesdirectory can now be reached via<wiki_url>/img/and can be displayed inside any wiki post.
Building is done with the go tool. If you have setup your GOPATH correctly, the following should work:
go get github.com/k4rian/twserver-go
go build -ldflags "-w -s" github.com/k4rian/twserver-goA Docker image is available on Docker Hub under k4rian/twserver and its corresponding source repository on GitHub.