c05c0d3df6
* 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
|
||
---|---|---|
bin | ||
boot | ||
core | ||
editions | ||
languages | ||
licenses | ||
plugins/tiddlywiki | ||
themes/tiddlywiki | ||
.gitignore | ||
.jshintignore | ||
.npmignore | ||
contributing.md | ||
license | ||
package.json | ||
readme.md | ||
tiddlywiki.js |
Welcome to TiddlyWiki, a non-linear personal web notebook that anyone can use and keep forever, independently of any corporation.
TiddlyWiki is a complete interactive wiki in JavaScript. It can be used as a single HTML file in the browser or as a powerful Node.js application. It is highly customisable: the entire user interface is itself implemented in hackable WikiText.
Learn more and see it in action at https://tiddlywiki.com/
Developer documentation is in progress at https://tiddlywiki.com/dev/
Installing TiddlyWiki on Node.js
- Install Node.js
- either from your favourite package manager: typically
apt-get install nodejs
on Debian/Ubuntu Linux or Termux for Android, orbrew install node
on a Mac - or directly from http://nodejs.org
- either from your favourite package manager: typically
- Open a command line terminal and type:
npm install -g tiddlywiki
If it fails with an error you may need to re-run the command as an administrator:
sudo npm install -g tiddlywiki
(Mac/Linux) - Check TiddlyWiki is installed by typing:
tiddlywiki --version
- In response, you should see TiddlyWiki report its current version (eg "5.1.16"; you may also see other debugging information reported)
- Try it out:
tiddlywiki mynewwiki --init server
to create a folder for a new wiki that includes server-related componentstiddlywiki mynewwiki --server
to start TiddlyWiki- Visit http://127.0.0.1:8080/ in your browser
- Try editing and creating tiddlers
- Optionally, make an offline copy:
- click the save changes button in the sidebar, OR
tiddlywiki mynewwiki --build index
The -g
flag causes TiddlyWiki to be installed globally. Without it, TiddlyWiki will only be available in the directory where you installed it.
If you are using Debian or Debian-based Linux and you are receiving a node: command not found
error though node.js package is installed, you may need to create a symbolic link between nodejs
and node
. Consult your distro's manual and whereis
to correctly create a link. See github issue 1434
Example Debian v8.0: sudo ln -s /usr/bin/nodejs /usr/bin/node
You can also install prior versions like this:
npm install -g tiddlywiki@5.1.13
Using TiddlyWiki on Node.js
TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on TiddlyWikiFolders, TiddlerFiles and TiddlyWikiFiles.
For example, the following command loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in static HTML:
tiddlywiki --verbose --load mywiki.html --rendertiddler ReadMe ./readme.html
Running tiddlywiki
from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces.
The first argument is the optional path to the TiddlyWikiFolder to be loaded. If not present, then the current directory is used.
The commands and their individual arguments follow, each command being identified by the prefix --
.
tiddlywiki [<wikipath>] [--<command> [<arg>[,<arg>]]]
The available commands are:
- build
- clearpassword
- editions
- fetch
- help
- import
- init
- load
- makelibrary
- output
- password
- render
- rendertiddler
- rendertiddlers
- save
- savetiddler
- savetiddlers
- server
- setfield
- unpackplugin
- verbose
- version
Upgrading TiddlyWiki on Node.js
If you've installed TiddlyWiki on Node.js on the usual way, when a new version is released you can upgrade it with this command:
npm update -g tiddlywiki
On Mac or Linux you'll need to add sudo like this:
sudo npm update -g tiddlywiki
Also see
-
TiddlyWikiFolders
-
MultiTiddlerFileSyntax
-
MultiTiddlerFiles
-
TiddlerFiles
-
Generating Static Sites with TiddlyWiki
-
How to build a TiddlyWiki5 from individual tiddlers
-
Using TiddlyWiki for GitHub project documentation
-
Using a custom path prefix with the client-server edition
-
Building TiddlyWikiClassic
-
Customising Tiddler File Naming
-
Environment Variables on Node.js
-
Scripts for TiddlyWiki on Node.js
-
Serving TW5 from Android
-
Working with the TiddlyWiki5 repository
- Internet Information Services
This readme file was automatically generated by TiddlyWiki