TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
7.97k stars 1.18k forks source link

Issues of deployment on openshift #533

Open ericmiao opened 10 years ago

ericmiao commented 10 years ago

Firstly, thanks for the good job on TiddlyWiki5. This is now my favorite personal note taking tool. Since it supports node.js, I tried to deploy it to OpenShift. There are two issues:

  1. It seems no matter how to specify the start script in package.json, OpenShift always looks for a server.js under the app's top directory. As there be could more such deployment issues with other vendors, I would like to see some sample files placed in a directory called "deployment/" for people to have a quick start. I'm proposing a change such as https://github.com/ericmiao/TiddlyWiki5/commit/800a5d31f511a93c265e8880efea9e1c42807ced
  2. The character "/", despite it's being escaped already to "%2F" in the URL generated, it seems OpenShift will still recognize and filter it, so those system tiddlers and tiddlers with "/" in the title will all fail to upload. I worked around this by escape "/" further to something else, e.g. "%SLASH%" as in https://github.com/ericmiao/TiddlyWiki5/commit/4e91836909561fbcf0a7d8e715b3599bc6dcdd4d

Although the two issues above are really something OpenShift should fix, I hope this can be fixed in a generic way so people can benefit when they start to deploy tiddlywiki on OpenShift.

Jermolene commented 10 years ago

Hi @ericmiao that's great, thanks.

  1. Great idea, I'd be pleased if you could create a pull request. Perhaps also worth including a readme.md?
  2. This one is trickier. Making the encoding more complex has a significant impact on every component in the ecosystem, and in this case would break compatibility with TiddlyWeb. Is what TW5 is doing now in any sense wrong in terms of HTTP or URL RFCs? Perhaps we could support plugin middleware modules that perform URL massaging, and then create an 'openshift' plugin.

In any case, it seems desirable to get as close as possible to the point where an unmodified TW5 repo can be deployed to openshift. The addition of server.js breaks that at the moment, of course.

Finally, could you please sign the Contributor License Agreement, as described in contributors.md.

ericmiao commented 10 years ago

Sorry @Jermolene for the late reply, I've signed the CLA-individual and send the pull request to you. The 2nd one is trickier yes, I'll double check but I don't think TW5 is doing something wrong in terms of HTTP or URL RFCs, I think it's just OpenShift is being over-smart and doing some really nasty URL inspection there.

putrinolab1 commented 9 years ago

Hi @Jermolene and @ericmiao,

We too are installing TiddlyWiki 5 on OpenShift as described in @ericmiao's documentation found here: http://ericmiao.github.io/blog/2014/04/05/setup-personal-tiddlywiki-on-openshift/

Unfortunately, after the installation, we are receiving the error message: Internal JavaScript Error Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser Uncaught TypeError: Cannot read property 'Draft of 'New Tiddler 5'' of undefined

This seems to be the problem with any new Tiddler that is created create: they seem to NOT be able to be renamed to the name we give it and NOT able to save the data. Attached are some screen shots of the issue.

Might the issue be file permissions? Did you encounter this issue as well? Are you still using TiddlyWiki on OpenShift?

Any help or insights into this would be GREATLY appreciated.

screen shot 2015-06-18 at 9 26 33 am screen shot 2015-06-18 at 9 26 46 am

Jermolene commented 9 years ago

Just for the record, the post above has been moved to this ticket: #1842

pmario commented 9 years ago

imo one should be closed

Jermolene commented 9 years ago

I think they are different issues; this one is about the encoding of slashes, and #1842 is about @victorganic/@putrinolab1's JS error