1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-29 11:30:28 +00:00
TiddlyWiki5/plugins/tiddlywiki
snlhnk c05c0d3df6 Module-ize server routes, add static file support and other enhancements(#2679)
* Module-ize server routes and add static file support (#2510)

* Refactor server routes to modules

New module type: serverroute

Caveats: Loading order is not deterministic but this would only matter
if two route modules attempted to use the same path regexp (that would
be silly).

* Add static assets plugin

This plugin allows the node server to fetch static assets in the /assets
directory. I felt that this was a feature that goes above the core
functionality. That is why I added it as a plugin. with the modular
route extensions this was a breeze.

* Add serverroute description to ModuleTypes

* Coding standards tweaks

* Fix filename typo

* Move support for attachments from a plugin into the core

* Missing "else"

* Refactor server handling

* Introduce a new named parameter scheme for commands
* Move the SimpleServer class into it's own module
* Deprecate the --server command because of the unwieldy syntax
* Add a new --listen command using the new syntax

For example:

tiddlywiki mywiki --listen host:0.0.0.0 port:8090

* Add check for unknown parameters

* Add support for multiple basic authentication credentials in a CSV file

Beware: Passwords are stored in plain text. If that's a problem, use an authenticating proxy and the trusted header authentication approach.

* Refactor module locations

* Rename "serverroute" module type to "route"

* Remove support for verifying optional named command parameters

The idea was to be able to flag unknown parameter names, but requiring a command to pre-specify all the parameter names makes it harder for (say) the listen command to be extensible so that plugins can add new optional parameters that they handle. (This is particularly in the context of work in progress to encapsulate authenticators into their own modules).

* Refactor the two authenticators into separate modules and add support for authorization

* Correct mistaken path.join vs. path.resolve

See https://stackoverflow.com/a/39836259

* Docs for the named command parameters

I'd be grateful if anyone with sufficient Windows experience could confirm that the note about double quotes in "NamedCommandParameters" is correct.

* Be consistent about lower case parameter names

* Do the right thing when we have a username but no password

With a username parameter but no password parameter we'll attribute edits to that username, but not require authentication.

* Remove obsolete code

* Add support for requiring authentication without restricting the username

* Refactor authorization checks

* Return read_only status in /status response

* Fix two code typos

* Add basic support for detecting readonly status and avoiding write errors

We now have syncadaptors returning  readonly status and avoid attempting to write to the server if it's going to fail

* Add readonly-styles

We hide editing-related buttons in read only mode

I've made this part of the tiddlyweb plugin but I think a case could be made for putting it into the core.

* Add custom request header as CSRF mitigation

By default we require the header X-Requested-With to be set to TiddlyWiki. Can be overriden by setting csrfdisable to "yes"

See https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Protecting_REST_Services:_Use_of_Custom_Request_Headers

* Add support for HTTPS

* First pass at a route for serving rendered tiddlers

cc @Drakor

* Tweaks to the single tiddler static view

Adding a simple sidebar

* Switch to "dash" separated parameter names

* Typo

* Docs: Update ServerCommand and ListenCommand

* First pass at docs for the new web server stuff

Writing the docs is turning out to be quite an undertaking, much harder than writing the code!

* Get rid of extraneous paragraphs in static renderings

* Rejig anonymous user handling

Now we can support wikis that are read-only for anonymous access, but allow a user to login for read/write access.

* More docs

Slowly getting there...

* Static tiddler rendering: Fix HTML content in page title

* Docs updates

* Fix server command parameter names

Missed off 30ce7ea

* Docs: Missing quotes

* Avoid inadvertent dependency on Node.js > v9.6.0

The listenOptions parameter of the plain HTTP version of CreateServer was only introduced in v9.6.0

cc @Drakor @pmario

* Typo
2018-07-18 16:54:43 +01:00
..
async Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
aws AWS Plugin: Less logging 2018-02-19 09:11:48 +00:00
bibtex BibTeX plugin: fix name of deserializer module 2018-05-15 14:02:27 +01:00
blog Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
browser-sniff Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
cecily Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
classictools Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
codemirror CodeMirror plugin: tweak for font-size (#3294) 2018-05-19 08:50:18 +01:00
codemirror-autocomplete CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
codemirror-closebrackets CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
codemirror-closetag codemirror update v5.37.0 (#3220) 2018-04-24 22:06:59 +01:00
codemirror-fullscreen-editing CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
codemirror-keymap-emacs CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
codemirror-keymap-sublime-text CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
codemirror-keymap-vim codemirror update v5.37.0 (#3220) 2018-04-24 22:06:59 +01:00
codemirror-mode-css CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
codemirror-mode-htmlembedded CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
codemirror-mode-htmlmixed CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
codemirror-mode-javascript codemirror update v5.37.0 (#3220) 2018-04-24 22:06:59 +01:00
codemirror-mode-markdown codemirror update v5.37.0 (#3220) 2018-04-24 22:06:59 +01:00
codemirror-mode-x-tiddlywiki CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
codemirror-mode-xml CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
codemirror-search-replace CodeMirror 5.36.0 modularized (#3184) 2018-04-06 17:34:50 +01:00
comments First stab at a threaded commenting plugin 2018-06-21 08:36:15 +01:00
d3 Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
dynaview DynaView: Only apply minimum height to tiddlers that are not yet visible 2018-05-25 11:08:27 +01:00
evernote fix for #3176 (#3177) 2018-03-19 15:56:28 +00:00
external-attachments Add "external-attachments" plugin 2017-10-11 17:54:03 +01:00
filesystem Add more colour to command line output 2017-09-04 14:55:12 +01:00
github-fork-ribbon Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
googleanalytics Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
hammerjs Revert "Add swipe,tap and press widget to hammerjs (#3214)" 2018-04-18 16:00:03 +01:00
help Use https for YouTube 2017-11-18 19:53:52 +00:00
highlight Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
internals Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
jasmine Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
jszip JSZip plugin: Update to v2.6.1 2018-01-11 21:31:58 +00:00
katex Don't misreport KaTeX plugin version 2018-04-13 09:24:04 +01:00
markdown Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
mobiledragdrop Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
nodewebkitsaver Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
pluginlibrary Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
powered-by-tiddlywiki Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
qrcode Fix broken QR code wifi example 2018-06-23 10:18:39 +01:00
railroad Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
savetrail SaveTrailPlugin: Fix syncer UI interactions 2017-09-20 16:28:11 +01:00
sax Major updates to text-slicer plugin 2017-12-14 14:16:54 +00:00
stacked-view Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
tahoelafs Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
text-slicer TextSlicer: Fix external links 2018-05-17 18:30:21 +01:00
tiddlyweb Module-ize server routes, add static file support and other enhancements(#2679) 2018-07-18 16:54:43 +01:00
translators Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
tw2parser Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00
tw5.com-docs Create a plugin and edition for tw5.com docs 2015-09-15 13:37:01 +01:00
twitter Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
upgrade Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
xlsx-utils Improve XLSX docs 2017-12-12 13:58:26 +00:00
xmldom Revert "Add text/vnd.tiddlywiki to system tiddlers within plugins that should be wikified (c.f. #2883)" 2017-06-24 17:48:32 +01:00