Skip to content

Commit e1f91a3

Browse files
Update README and package description
1 parent dfc062c commit e1f91a3

File tree

2 files changed

+48
-36
lines changed

2 files changed

+48
-36
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tiddly-wiki-server"
3-
description = "An efficient web server for TiddlyWikis."
3+
description = "An efficient, low-maintenance web server for TiddlyWikis."
44
repository = "https://github.com/nathanielknight/tiddly-wiki-server"
55
version = "0.3.0-alpha"
66
edition = "2021"

README.md

+47-35
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,96 @@
11
# TiddlyWiki Server
22

33
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)
4-
[![Join the chat at https://gitter.im/tiddly-wiki-server/community](https://badges.gitter.im/tiddly-wiki-server/community.svg)](https://gitter.im/tiddly-wiki-server/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
54

6-
This is a web server for [TiddlyWiki]. It uses TiddlyWiki's [web server
7-
API] to save tiddlers in a [SQLite database]. It should come with a
8-
slightly altered empty TiddlyWiki that includes an extra tiddler store (for
9-
saved tiddlers) and the [TiddlyWeb plugin] (which is necessary to make use of
10-
the web server API).
5+
This is an efficient, low-maintenance web server for [TiddlyWiki]. It uses the [web server
6+
API] provided by the [TiddlyWeb plugin] to save tiddlers in a [SQLite database]. It's written in Rust.
117

128
[TiddlyWiki]: https://tiddlywiki.com/
139
[web server API]: https://tiddlywiki.com/#WebServer
1410
[SQLite]: https://sqlite.org/index.html
1511
[TiddlyWeb plugin]: https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/tiddlyweb
1612

13+
## Running the Server
14+
15+
The easiest way to run `tiddly-wiki-server` is with Docker Compose. You can grab
16+
the [compose file](./docker-compose.yml) from this project and then start a
17+
server with
18+
19+
```sh
20+
docker compose up
21+
```
22+
23+
To run the server directly,
24+
25+
1. Build or install the executable (e.g. by checking out this repository and
26+
running `cargo install --path .`).
27+
1. Run the server:
28+
```sh
29+
tiddly-wiki-server --bind 0.0.0.0 --port 3032 --dbpath ./tiddlers.sqlite
30+
```
31+
32+
If the database doesn't exit, `tiddly-wiki-server` will create and initialize
33+
it.
34+
35+
See the `tiddly-wiki-server --help` for instructions on changing the bound
36+
address, port, database path, etc.
37+
1738
## Motivation
1839

1940
TiddlyWiki 5 has a [NodeJS based web server] that re-uses much of the front-end
2041
JavaScript for maximum compatibility. However, this server needs about 70 MB of
2142
memory to start, and can easily consume 100 MB or more. This is fine for running
22-
on a workstation, but a cheap VPS quickly gets crowded running services of this
23-
size.
43+
on a workstation, but a cheap VPS quickly gets crowded running services that size.
2444

2545
[NodeJS based web server]: https://tiddlywiki.com/static/WebServer.html
2646

2747
In rudimentary benchmarks it looks like `tiddly-wiki-server` uses about 10 MB of
28-
memory (with no optimizations), which I find much more manageable.
29-
30-
31-
## Setup
32-
33-
To create a TiddlyWiki backed by this server:
48+
memory, which I find much more manageable. It's also easier to deploy!
3449

35-
1. Build or install the executable on your server (e.g. by checking out this
36-
repository and running `cargo install --path .`).
37-
1. Set up the directory you want to run the server in: a. Copy the
38-
`empty.html.template` file into the directory. b. Create a `files/` folder
39-
to hold [static files].
40-
1. Run `tiddly-wiki-server`.
4150

51+
## License
4252

43-
## Docker Setup
53+
This project is made available under [The Prosperity Public License 3.0.0],
54+
which gives you broad permissions for:
4455

45-
To run in Docker:
56+
* personal and not-for-profit use
57+
* reading and modifying the source code
58+
* trying out the software commercially
4659

47-
```sh
48-
docker run --rm -p 3032:3032 -v "$(pwd)/data:/srv/data" $(docker build -q .)
49-
```
60+
but _doesn't_ let you build a business on the author's work.
5061

51-
This will use the same port and data directory (namely, `./data`) as `cargo run`.
62+
If you're uncertain if your use case might be infringing or you want to use it
63+
under a different license, reach out to @natknight.
5264

5365

66+
[The Prosperity Public License 3.0.0]: https://prosperitylicense.com/versions/3.0.0
5467

5568
## Differences from TiddlyWiki
5669

5770
The initial page that this project serves has a few changes compared to the
58-
empty wiki you can download from tiddlywiki.com/empty.html. It has:
71+
empty wiki you can download from http://tiddlywiki.com/empty.html. It has:
5972

6073
* the [TiddlyWeb plugin] to let TiddlyWiki save data to the server, and
6174
* any data that you entered or imported.
6275
* no `noscript` section for browsers that disable JavaScript (this is
6376
considered a bug)
6477

65-
It was created by following this procedure:
78+
This modified wiki was created by following this procedure:
6679

6780
1. Download an empty TiddlyWiki from tiddlywiki.com/empty.html
6881
1. Add the TiddlyWeb plugin via the [plugin library]
6982
1. Add a `script` element to the very end of the HTML document with
7083
- `class="tiddlywiki-tiddler-store"`
7184
- `type="application/json`
72-
- The contents `@@TIDDLY-WIKI-SERVER-EXTRA-TIDDLERS-@@N41yzvgnloEcoiY0so8e2dlri4cbYopzw7D5K4XRO9I@@`
7385

7486
[plugin library]: https://tiddlywiki.com/static/Installing%2520a%2520plugin%2520from%2520the%2520plugin%2520library.html
7587

76-
The server replaces the contents of the `script` tag with the saved tiddlers.
77-
Since tiddlers can contain escaped (sometimes twice-escaped) code in various
78-
programming and/or markup languages, creating a separate tiddler store is much
79-
easier than dynamically modifying the core TiddlyWiki tiddlers.
80-
88+
The empty wiki is then embedded in the `tiddly-wiki-server` binary; when the
89+
page is loaded, it inserts the stored tiddlers into the empty wiki and serves
90+
it. The result isn't _exactly_ what you'd get by loading the content into a
91+
regular TiddlyWiki and saving it, but it has all the same features, including
92+
that you can always download a copy and have a full, working TiddlyWiki with all
93+
of your tiddlers.
8194

8295
## Contributing
8396

@@ -86,7 +99,6 @@ setup a TiddlyWiki with it and see if it behaves the way you'd expect. The
8699
server aims to have feature parity with the first-party NodeJS server; any
87100
discrepancy is a potential bug, which I'd be very grateful to have reported!
88101

89-
90102
## Code of Conduct
91103

92104
Contributors are expected to abide by the [Contributor Covenant](https://www.contributor-covenant.org/).

0 commit comments

Comments
 (0)