• Stars
    star
    123
  • Rank 289,240 (Top 6 %)
  • Language
    HTML
  • License
    BSD 3-Clause "New...
  • Created almost 8 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

TiddlyWiki (actually TiddlyWeb) server for Google App Engine

TiddlyWiki App Engine Server

This is a minimal Google App Engine app, written in Go, that can serve as the back end for a personal TiddlyWiki

The TiddlyWiki5 implementation has a number of back end options. This app implements the backend expected by the “TiddlyWeb and TiddlySpace components” plugin.

The usual way to deploy TiddlyWeb is to run a fairly complex Python web server program. I'd rather not. Instead I implemented a minimal Go server that responds appropriately to the (relatively few) needed JSON API calls.

Authentication

The TiddlyWeb JSON API envisions a multiuser system in which different users have access to different sets of tiddlers. This Go server contains none of that: it assumes that all users have full access to everything, although it does record who created which tiddlers. The only access control is that the app.yaml here requires HTTPS and administrator login for all URLs, and as a “belt and suspenders” measure, the app itself also refuses to serve to non-admins, as checked by user.IsAdmin.

See the "Re Authentication" comment in tiddly.go for information about making the server publicly read-only (it's not quite perfect).

Data model

The app stores the current tiddlers in Cloud Datastore as Tiddler entities. It also stores every version of every tiddler as TiddlerHistory entities. Currently nothing reads the TiddlerHistory, but in case of a mistake that wipes out important Tiddler contents it should be possible to reconstruct lost data from the TiddlerHistory.

The TiddlyWiki downloaded as index.html that runs in the browser downloads (through the JSON API) a master list of all tiddlers and their metadata when the page first loads and then lazily fetches individual tiddler content on demand.

Deployment

Create an Google App Engine standard app and deploy with

appcfg.py -A your-app -V your-version update .

Then visit https://your-app.appspot.com/. As noted above, only admins will have access to the content.

Plugins

TiddlyWiki supports extension through plugins. Plugins need to be in the downloaded index.html, not lazily like other tiddlers. Therefore, installing a plugin means updating a local copy of index.html and redeploying it to the server.

Macros

TiddlyWiki allows tiddlers with the tag $:/tags/Macro to contain global macro definitions made available to all tiddlers. The lazy loading of tiddler bodies interferes with this: something has to load the tiddler body before the macros it contains take effect. To work around this, the app includes the body of all macro tiddlers in the initial tiddler list (which otherwise does not contain bodies). This is sufficient to make macros take effect on reload.

For some reason, no such special hack is needed for $:/tags/Stylesheet tiddlers.

Synchronization

If you set Control Panel > Info > Basics > Default tiddlers by clicking “retain story ordering”, then the story list (the list of tiddlers shown on the page) is written to the server as it changes and is polled back from the server every 60 seconds. This means that if you have the web site open in two different browsers (for example, at home and at work), changes to what you're viewing in one propagate to the other.

TiddlyWiki base image

The TiddlyWiki code is stored in and served from index.html, which (as you can see by clicking on the Tools tab) is TiddlyWiki version 5.1.21.

Plugins must be pre-baked into the TiddlyWiki file, not stored on the server as lazily loaded Tiddlers. The index.html in this directory is 5.1.21 with the TiddlyWeb and Markdown plugins added. The TiddlyWeb plugin is required, so that index.html talks back to the server for content.

The process for preparing a new index.html is:

  • Open tiddlywiki-5.1.21.html in your web browser.
  • Click the control panel (gear) icon.
  • Click the Plugins tab.
  • Click "Get more plugins".
  • Click "Open plugin library".
  • Type "tiddlyweb" into the search box. The "TiddlyWeb and TiddlySpace components" should appear.
  • Click Install. A bar at the top of the page should say "Please save and reload for the changes to take effect."
  • Click the icon next to save, and an updated file will be downloaded.
  • Open the downloaded file in the web browser.
  • Repeat, adding any more plugins.
  • Copy the final download to index.html.

More Repositories

1

2fa

Two-factor authentication on the command line
Go
1,538
star
2

rf

A refactoring tool for Go
Go
668
star
3

c2go

C to Go translation tool supporting Go toolchain migration
Go
497
star
4

pdf

PDF reader
Go
488
star
5

letsencrypt

Manage TLS certificates automatically via LetsEncrypt.org
Go
466
star
6

grind

Grind polishes Go programs.
Go
461
star
7

goversion

Print version used to build Go executables
Go
265
star
8

gt

go test but faster (cached)
Go
253
star
9

corpus

Corpus of interesting Go code
Go
193
star
10

qr

QR codes
Go
192
star
11

web

basic web site serving framework
Go
154
star
12

tmplfunc

Go templates invoked as functions
Go
145
star
13

tlogdb

Reusable transparent log database
Go
141
star
14

benchstat

Benchstat computes and compares statistics about benchmarks.
Go
139
star
15

go-import-redirector

HTTP server for a custom 'go get' domain
Go
114
star
16

quote

Pithy sayings.
Go
99
star
17

diff

Diff(1)
Go
91
star
18

tmp

/tmp
Go
89
star
19

swtch

swtch.com web server
Go
88
star
20

github

Go
88
star
21

markdown

Basic Markdown parser and HTML generator
Go
71
star
22

zipmerge

Go
52
star
23

rsc

Automatically exported from code.google.com/p/rsc
Go
50
star
24

xstd

importable versions of parts of the Go standard library
Go
49
star
25

dbstore

Data structure interface to database/sql
Go
48
star
26

cmd

Commands
Go
48
star
27

binaryregexp

Go regexp for binary/latin-1 data
Go
44
star
28

getopt

getopt(3)-style Go flag parser
Go
43
star
29

benchgraffiti

benchmark graffiti (formerly code.google.com/p/benchgraffiti)
Go
39
star
30

todo

Trivial to-do lists
Go
35
star
31

pprof_mac_fix

Assembly
35
star
32

quine

Quines
Go
35
star
33

grepdiff

grep for diffs
Go
34
star
34

mailgun

Utilities for interacting with mailgun.com.
Go
28
star
35

sizeof

print sizes of Go data structures
Go
26
star
36

sqlite

Go sqlite3 database/sql driver
Go
24
star
37

nop

No-op
Go
24
star
38

perf2pprof

Convert Linux perf traces to Go pprof format
Go
22
star
39

plan9vmware

Ancient source code for Plan 9 VMware tools
C
21
star
40

x86

x86 code manipulation
Go
21
star
41

edit

Byte buffer editor
Go
21
star
42

tcat

Table cat
Go
20
star
43

arm

arm code manipulation
Go
20
star
44

devweb

Development web server
Go
19
star
45

empty

Empty repository.
16
star
46

gitfs

Remote Git repos as fs.FS file systems.
Go
14
star
47

compilebench

Compiler benchmarking
Go
13
star
48

ghostscript-9.06

Ghostscript 9.06 (GPL-, not AGPL-licensed)
C
10
star
49

gocachelogstat

Go
10
star
50

hello

hello
Go
10
star
51

cloud

vaporware
Go
9
star
52

sampler

sampler
Go
9
star
53

toolstash

Save, run, and restore a known good copy of the Go toolchain.
Go
9
star
54

script

Script engine, especially good for tests
Go
5
star
55

vgotest1

vgotest1
Go
2
star
56

legacytest

legacytest
Go
2
star
57

vgotest3

vgotest3 imports vgotest-backward
Go
2
star
58

deptest5-d

Go
1
star
59

dt1-a

1
star
60

go-get-test-pdf

Go
1
star
61

dt2-main

Go
1
star
62

goobjdump

Go objdump file dumper
Go
1
star
63

go-get-issue-9357

Go
1
star
64

vgotest-backward

vgotest backward
Go
1
star
65

vgotest5

vgotest5
Go
1
star
66

ppc64

ppc64 code manipulation
Go
1
star
67

re1

Regexp code for https://swtch.com/~rsc/regexp/
C
1
star