1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 21:39:57 +00:00
Commit Graph

48 Commits

Author SHA1 Message Date
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
Tobias Beer
6bbf36f903 Update docs for delimiter in environment variables (#3049)
fixes #2954
2018-04-24 22:06:09 +01:00
Rizwan
302b6a93de Documentation change to "tiddlywiki.info Files" (#3068)
Correct syntax to include of read-only parameter in "includeWiki" - shown in example
2018-01-09 17:30:44 +00:00
Aurelien Navarre
9b2d916946 Clarify current limitations on node.js and TiddlyWiki (#1227) 2017-12-03 21:47:37 +00:00
Jermolene
bd2ff7a4c9 Docs update: add link to Termux for Android docs 2017-11-15 17:41:47 +00:00
Jermolene
021b5e072b Updated GettingStarted material about saving changes 2017-11-13 14:00:01 +00:00
Jermolene
29364cbd08 Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
Mateusz Piotrowski
4e278d0cd7 Add missing wiki directory to command example (#2950)
All the other commands seem to assume that the user is not in the wiki directory, but rather in the parent directory: `tiddlywiki mynewwiki --init server` and `tiddlywiki mynewwiki --server`. This is why `tiddlywiki --build index` fails. A solution to this problem is to add the wiki name to the command.
2017-09-16 15:04:27 +01:00
Marxsal
f2f5afa106 Doc: Adding comment to release notes re archived releases (#2882)
* Doc: Adding comment to release notes to indicate where archived releases can be found.

* Adding note about node.js to Release tiddler and Installing on Node.js tiddler
2017-06-09 15:33:24 +01:00
Jermolene
eee18aab40 Docs: Fix typo 2017-02-21 08:47:00 +00:00
Thomas Elmiger
8307f7c3ca Tiny optimisation for Naming of System Tiddlers.tid (#2773)
* Replacement icon stopwatch on

As discussed in issue #2690

* Replacement icon stopwatch off

As discussed in issue #2690

* Added missing tag "Resources" (Community Resource)

* Tried to make a sentence clearer

CamelCase words are NOT joined with hyphens (copy-paste error?). 
Copied "directly" from the line below to make the meaning even clearer.
2017-02-21 08:28:53 +00:00
Jermolene
3708f6c8e4 Major refactoring of filesystemadaptor
The code here had got a bit broken by some PRs that I should have
checked more carefully. I’ve done a major refactoring which will
hopefully make it easier to understand, and fixes a number of problems:

* Problem with eg .md tiddlers not being deleted correctly
* Problem with Windows path separators not being usable within
$:/config/FileSystemPaths on Windows
* Problem with filename clashes not being detected correctly when
saving to a different directory via $:/config/FileSystemPaths
* Enables slashes within tiddler titles to be mapped into folders
* Enables plain text files like .md and .css to be saved with .meta
files instead of as .tid files (see #2558)
* No longer replaces spaces with underscores

As this is such a major update, I’d be grateful if Node.js users could
give it a careful run through — in particular, you’ll need to try
creating new tiddlers of various types and ensure that the expected
files are created.
2017-02-11 12:56:42 +00:00
Jermolene
36c0af0fd4 Docs: Fix typo in example filter 2017-02-11 12:47:56 +00:00
Marxsal
a393705cef Clarifying Tiddlywiki node.js launch instructions. (#2662) 2016-12-16 17:39:20 +00:00
Jermolene
ad9769451d Add filename-uri-decoded support for tiddlywiki.files 2016-12-15 17:13:32 +00:00
Jermolene
b8cbc07c54 Add support for uri decoded components in tiddlywiki.files files 2016-11-14 15:14:25 +00:00
Jermolene
537cfcbf79 Addendum to #2610
* Ensure we don’t try to read tiddlers from `.meta` files
* Improve docs
2016-10-15 18:06:17 +01:00
Jermolene
1b41b44684 Improve support for bulk loading tiddlers under Node.js
Fixes #2610
2016-10-15 16:23:17 +01:00
Myeongjin
80256b4dab Update document in tiddlywiki.com edition
* Add string '.htm' to 'Saving with TiddlyIE'
* Change external links to match locale with wiki language
* Add instructions for use to 'Saving on Android'
* Change string in 'task'
* Change instructions for use in 'Saving on iPad/iPhone'
* Add newline to 'TiddlyDesktop Releases'
* Remove caption from 'Serving TW5 from Android'
* Change link to external in tiddlers which tagged 'Editions'
* Remove string 'index.html' from 'Some of the things you can do with TiddlyWiki'
* Change link 'TiddlyWiki Groups' to 'Forums' in tiddlers which tagged 'Community'
* Remove CamelCase link 'TiddlyWiki' from tiddlers tagged 'Community'
* Change string 'done' to 'Upgrade' in 'UpgradeMechanism'
* Change buttons to images in 'How to export tiddlers'
* Add images about buttons to tiddlers
* Add quotation mark to text 'edit' in 'Signing the Contributor License Agreement'
* Rename 'UsingSVG' to 'Using SVG'
* Change link 'TypedBlockWikiText' to 'Typed Blocks in WikiText' in 'Using SVG'
* Add tiddler 'Using Stamp'
* Add 'rel="noopener noreferrer"' to external links
* Add description about 'rel="noreferrer"' to 'HTML in WikiText'
* Add link of prerelease version about translators edition, and how to translate on Node.js, in 'Translate TiddlyWiki into your language'
* Change string 'dropdown' to 'tab' in 'Installing a plugin from the plugin library'
* Add download button to 'Empty Edition'
2016-07-06 01:10:51 +09:00
Myeongjin
2edaa5fbce Update tiddlywiki.com edition (#2454)
* Change button texts to latest version

* Move tiddler files to appropriate categorys
2016-05-20 07:46:11 -06:00
Xavier Cazin
ea8b81935a Improvements to Android and fr-FR docs (#2418)
* A third way to use TW5 on Android

small improvements to Android/Node.js doc tiddlers

* fr-FR translation for the link button

* replace _ with space in file name
2016-05-02 11:08:27 +01:00
Myeongjin
5f68f411c8 Replace '_' to space in tw5.com edition (#2417)
* Move tiddler 'thumbnail Macro (Examples)' to directory 'macros/examples'

* Replace '_' to space in tw5.com edition
2016-05-02 08:34:30 +01:00
Xavier Cazin
727b7b1ed0 A third way to use TW5 on Android (#2415) 2016-04-30 21:47:09 +01:00
Jermolene
0151363b74 House style for tw5.com is to use -ise not -ize 2016-04-26 07:42:52 +01:00
nome
1ae428e323 Make tiddler file paths configurable (#2379)
When saving new tiddlers on node.js, allow the user to override the path of the
generated .tid file. This is done by creating a tiddler
$:/config/FileSystemPaths which contains one or more filter expressions, one
per line. These filters are applied in turn to the tiddler to be saved, and
the first output produced is taken as a logical path relative to the wiki's
tiddlers directory. Any occurences of "/" in the logical path are replaced with
the platform's path separator, the extension ".tid" is appended, illegal
characters are replaced by "_" and the path is disambiguated (if necessary) in
order to arrive at the final tiddler file path. If none of the filters matches,
or the configuration tiddler does not exist, fall back to the previous file
naming scheme (i.e. replacing "/" by "_").

This implies we will now, for tiddlers matching the user-specified filters,
create directory trees below the tiddlers directory. In order to avoid
cluttering it with empty directory trees when renaming or removing tiddlers, any
directories that become empty by deleting a tiddler file are removed
(recursively).

Benefits of this configuration option include the ability to organize git
repositories of TiddlyWikis running on node.js, ability to replace characters
that cause trouble with particular operating systems or workflows (e.g. '$' on
unix) and the ability to replicate tiddler "paths" in the filesystem (by
including a filter like "[!has[draft.of]]") without forcing such a (potentially
problematic) change on all users.
2016-04-25 08:36:32 +01:00
nome
37823f64e9 Add build targets to server edition
Define for the server edition the same build targets as for the empty

edition, but using the correct template so that the "offline" version

(target "index") works correctly when accessed via HTTP. With this,

`tiddlywiki --build index` is equivalent to the save button.



While the process of setting up TiddlyWiki on Node.js is well documented

and easy enough, the options for  publishing such a wiki to an offline

version (scriptably, e.g. for push-to-deploy setups) are decidedly

non-obvious. With the added build steps, the user only needs to know

three simple commands:



tiddlywiki --init server

tiddlywiki --server

tiddlywiki --build index



and optionally



tiddlywiki --build static
2016-04-03 20:22:11 +01:00
Jermolene
ebb3a62d9a Docs updates 2015-09-27 22:53:46 +01:00
Jermolene
16546a5e2e Rename "configurations" to "platforms"
Because “configurations” was too overloaded with other meanings.
“Platforms” seems like the closest common usage for us
2015-06-20 09:24:14 +01:00
Roma Hicks
5b7a7268d8 Changed structure to use less space. 2015-04-27 21:40:20 -05:00
Roma Hicks
f9c50d9a6d Added text notifying users of issue #1434 2015-04-27 21:31:18 -05:00
Jermolene
ba0ddb939c Re-establish "Configurations" TOC heading 2015-04-12 19:57:06 +01:00
Jermolene
47dc16a179 Docs tweaks 2015-03-25 22:15:51 +00:00
Tobias Beer
0ee06bb144 moved tw on node.js to editions
removed empty toplevel "TiddlyWiki Configurations", also from French

added TiddlyDesktop to Editions
2015-02-01 20:04:10 +01:00
alexhough
225b6ac950 changed to use <<version>> 2015-01-26 22:26:00 +00:00
alexhough
910d59c166 change to current version 2015-01-23 09:16:16 +00:00
Astrid Elocson
388464190d Use railroad diagrams to explain filter syntax 2015-01-03 20:16:46 +00:00
Astrid Elocson
e6ede67282 Further improvements suggested by felixhayashi 2014-12-28 16:16:24 +00:00
Astrid Elocson
597a5fb2f2 Update and make easier to understand 2014-12-28 10:07:30 +00:00
Jermolene
dcc33e52b3 Docs updates 2014-10-15 21:56:32 +01:00
Jermolene
15e9e21d2a Readme updates for Node.js 2014-09-20 15:06:33 +01:00
Jermolene
7ed7aba8d0 Docs updates 2014-09-19 15:02:40 +01:00
Jermolene
c63488d155 Docs updates for new file locations 2014-09-17 20:01:00 +01:00
Jermolene
cbfc9fcc56 More docs updates 2014-09-16 15:19:52 +01:00
buggyj
d27e157cec missing wikilinks on doc 2014-09-16 14:24:53 +02:00
Jermolene
f187122c35 Lots more docs updates 2014-09-12 16:05:37 +01:00
Jermolene
2e72162b0c Phrasing updates 2014-09-12 14:24:06 +01:00
Jermolene
def4aca200 Update filter docs 2014-09-10 23:42:13 +01:00
Jermolene
08d588fb08 Adjust some content directories 2014-09-10 19:36:54 +01:00