1
1
# TiddlyWiki Server
2
2
3
3
[ ![ 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 )
5
4
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.
11
7
12
8
[ TiddlyWiki ] : https://tiddlywiki.com/
13
9
[ web server API ] : https://tiddlywiki.com/#WebServer
14
10
[ SQLite ] : https://sqlite.org/index.html
15
11
[ TiddlyWeb plugin ] : https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/tiddlyweb
16
12
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
+
17
38
## Motivation
18
39
19
40
TiddlyWiki 5 has a [ NodeJS based web server] that re-uses much of the front-end
20
41
JavaScript for maximum compatibility. However, this server needs about 70 MB of
21
42
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.
24
44
25
45
[ NodeJS based web server ] : https://tiddlywiki.com/static/WebServer.html
26
46
27
47
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!
34
49
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 ` .
41
50
51
+ ## License
42
52
43
- ## Docker Setup
53
+ This project is made available under [ The Prosperity Public License 3.0.0] ,
54
+ which gives you broad permissions for:
44
55
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
46
59
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.
50
61
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 .
52
64
53
65
66
+ [ The Prosperity Public License 3.0.0 ] : https://prosperitylicense.com/versions/3.0.0
54
67
55
68
## Differences from TiddlyWiki
56
69
57
70
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:
59
72
60
73
* the [ TiddlyWeb plugin] to let TiddlyWiki save data to the server, and
61
74
* any data that you entered or imported.
62
75
* no ` noscript ` section for browsers that disable JavaScript (this is
63
76
considered a bug)
64
77
65
- It was created by following this procedure:
78
+ This modified wiki was created by following this procedure:
66
79
67
80
1 . Download an empty TiddlyWiki from tiddlywiki.com/empty.html
68
81
1 . Add the TiddlyWeb plugin via the [ plugin library]
69
82
1 . Add a ` script ` element to the very end of the HTML document with
70
83
- ` class="tiddlywiki-tiddler-store" `
71
84
- ` type="application/json `
72
- - The contents ` @@TIDDLY-WIKI-SERVER-EXTRA-TIDDLERS-@@N41yzvgnloEcoiY0so8e2dlri4cbYopzw7D5K4XRO9I@@ `
73
85
74
86
[ plugin library ] : https://tiddlywiki.com/static/Installing%2520a%2520plugin%2520from%2520the%2520plugin%2520library.html
75
87
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.
81
94
82
95
## Contributing
83
96
@@ -86,7 +99,6 @@ setup a TiddlyWiki with it and see if it behaves the way you'd expect. The
86
99
server aims to have feature parity with the first-party NodeJS server; any
87
100
discrepancy is a potential bug, which I'd be very grateful to have reported!
88
101
89
-
90
102
## Code of Conduct
91
103
92
104
Contributors are expected to abide by the [ Contributor Covenant] ( https://www.contributor-covenant.org/ ) .
0 commit comments