Problem with: NodeJS + nginx proxy + LetsEncrypt

Hey! Great tutorial. I managed to get a default TW setup without a hitch. However, I can’t figure out how to substitute the default edition for another community edition that I use. I’ve RTFM’d, where I found mention of setting the TIDDLYWIKI_EDITION_PATH env variable to an existing directory full of community edition TW’s, but I still get “edition not found” errors. Any ideas?

Which command does create the error?

The following tiddlywiki command throws the error. After some late night fiddling, I found the node_modules directory that contains the tiddlywiki tool directories-- most notably the (default?) editions directory.

lluluthellama@raspberrypi:~ $ echo $TIDDLYWIKI_EDITION_PATH
/home/lluluthellama/editions
lluluthellama@raspberrypi:~ $ ls
Bookshelf  Documents  editions  Pictures   Public     Videos  wiki2  wiki4
Desktop    Downloads  Music     pironman5  Templates  wiki    wiki3
lluluthellama@raspberrypi:~ $ cd wiki4
lluluthellama@raspberrypi:~/wiki4 $ ls -a
.  ..
lluluthellama@raspberrypi:~/wiki4 $ cd ..
lluluthellama@raspberrypi:~ $ tiddlywiki wiki4 --init index
Error: Edition 'index' not found
lluluthellama@raspberrypi:~ $ cd /usr/local/lib/node_modules/tiddlywiki/
lluluthellama@raspberrypi:/usr/local/lib/node_modules/tiddlywiki $ ls
bin   contributing.md  editions   license   package.json          plugins    themes
boot  core             languages  licenses  playwright.config.js  readme.md  tiddlywiki.js
lluluthellama@raspberrypi:/usr/local/lib/node_modules/tiddlywiki $ cd editions/
lluluthellama@raspberrypi:/usr/local/lib/node_modules/tiddlywiki/editions $ ls
aws                dev           full            ko-KR            server              tour            twitter-archivist
classicparserdemo  dynaviewdemo  geospatialdemo  ko-KR-server     server-external-js  translators     tw.org
codemirrordemo     empty         highlightdemo   markdowndemo     share               tw5.com         upgrade
d3demo             es-ES         innerwikidemo   multiwikiserver  tahoelafs           tw5.com-docs    xlsx-utils
de-AT              es-ES-server  introduction    pluginlibrary    test                tw5.com-server  xlsx-utils-server
de-AT-server       fr-FR         ja-JP           prerelease       testcommonjs        tw5tank         zh-Hans
de-DE              fr-FR-server  katexdemo       resumebuilder    text-slicer         tw5tiddlyweb    zh-Hant
lluluthellama@raspberrypi:/usr/local/lib/node_modules/tiddlywiki/editions $

I’m currently trying to understand the tiddlywiki.info files better, specifically the innards of the build. The following terminal copy-and-paste is the default server tiddlywiki edition directory contents.

lluluthellama@raspberrypi:/usr/local/lib/node_modules/tiddlywiki/editions/server $ ls
tiddlywiki.info
lluluthellama@raspberrypi:/usr/local/lib/node_modules/tiddlywiki/editions/server $ cat tiddlywiki.info
{
        "description": "Basic client-server edition",
        "plugins": [
                "tiddlywiki/tiddlyweb",
                "tiddlywiki/filesystem",
                "tiddlywiki/highlight"
        ],
        "themes": [
                "tiddlywiki/vanilla",
                "tiddlywiki/snowwhite"
        ],
        "build": {
                "index": [
                        "--render","$:/plugins/tiddlywiki/tiddlyweb/save/offline","index.html","text/plain"],
                "static": [
                        "--render","$:/core/templates/static.template.html","static.html","text/plain",
                        "--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
                        "--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
                        "--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
        }
}lluluthellama@raspberrypi:/usr/local/lib/node_modules/tiddlywiki/editions/server $

EDIT: I should note that I now understand why I’m getting the “Edition not found” error since there is no index directory and respective .info file in said directory. I’m just banging my head against the wall trying to figure out what to do next.

If you run tiddlywiki wiki4 --init index – That’s it. There is no edition name: index

Try to run tiddlywiki wiki4 --init server, which can then be activated tiddlywiki wiki4 --listen


There is a problem with TW v5.3.5 – the command tiddlywiki --editions, which should show all possible editions does not work. This will be fixed with v5.3.6


You listed them at: That are all the possible editions installed with TW.

lluluthellama@raspberrypi:/usr/local/lib/node_modules/tiddlywiki/editions $ ls
aws                dev           full            ko-KR            server              tour            twitter-archivist
classicparserdemo  dynaviewdemo  geospatialdemo  ko-KR-server     server-external-js  translators     tw.org
codemirrordemo     empty         highlightdemo   markdowndemo     share               tw5.com         upgrade
d3demo             es-ES         innerwikidemo   multiwikiserver  tahoelafs           tw5.com-docs    xlsx-utils
de-AT              es-ES-server  introduction    pluginlibrary    test                tw5.com-server  xlsx-utils-server
de-AT-server       fr-FR         ja-JP           prerelease       testcommonjs        tw5tank         zh-Hans
de-DE              fr-FR-server  katexdemo       resumebuilder    text-slicer         tw5tiddlyweb    zh-Hant

Where some of them are servers, but most of them are “single file” configurations. It’s a bit complex to explain atm.

With TW v5.3.6 it should be easier with a development setup.

@jeremyruston – Is there a TW-preview published to NPM?

1 Like

Can you do ls /home/lluluthellama/editions

Important: I hope you did give your raspberry pi a really secure password. We are posting a lot of public information about your RasPi setup here, which can make significantly easier to attack your system, even if it is behind a proxy.

So on your system, there should be no default rpi user anymore. - right?

Try to run tiddlywiki wiki4 --init server, which can then be activated tiddlywiki wiki4 --listen

Again, I have no issue getting any of the currently available editions, including server to run. However, I have already been using a customization of the “Stroll” community edition for some time now and am looking to self-host it using this thread’s approach.

Can you do ls /home/lluluthellama/editions

lluluthellama@raspberrypi:~/editions $ ls
index
lluluthellama@raspberrypi:~/editions $ cd index/
lluluthellama@raspberrypi:~/editions/index $ ls
tiddlywiki.info

Important: I hope you did give your raspberry pi a really secure password. We are posting a lot of public information about your RasPi setup here, which can make significantly easier to attack your system, even if it is behind a proxy.

So on your system, there should be no default rpi user anymore. - right?

Yes, I’ve taken necessary measures to secure my pi, including removing the user and keeping my pi strictly locally accessible until I can get this customization obstacle sorted out. I am also refactoring all instances of my linux user username to match my tiddlywiki username for this reason. Not to mention the pi I’m working on it a completely fresh install of the operating system with no sensitive information on it.

I’ve wandered into the /usr/local/lib/node_modules/tiddlywiki/bin directory and am looking at how the build-site.sh was written. The following caught my eye:

node $TW5_BUILD_TIDDLYWIKI \
        ./editions/empty \
        --verbose \
        --output $TW5_BUILD_OUTPUT \
        --build empty emptyexternalcore \
        || exit 1

I’m thinking I might add a similar set of lines within the build-site.sh that points to a custom directory (let’s say it’s called lluluthellama_edition) that I will create in the /usr/local/lib/node_modules/tiddlywiki/editions directory.

EDIT: I am choosing to create said directory in the default editions directory (/usr/local/lib/node_modules/tiddlywiki/editions) since I may be misusing or there may be a bug (?) surrounding how the TIDDLYWIKI_EDITION_PATH environmental variable is being used. If I was a betting woman, I’d wager it’s a “me” problem. :joy:

Can you create a tiddlers directory as a subdirectory from index. It should have been created with the init command. May be that one is missing.

So I actually managed to figure it out, or at least a work around. Ended up not using the ~/editions directory. I used the /usr/local/lib/node_modules/tiddlywiki/editions directory, created a directory called lluluthellama_edition with a tiddlywiki.info file that originally was 1:1 copy of the .info file located at /usr/local/lib/node_modules/tiddlywiki/editions/server From there I modified the referenced tiddlywiki plugins as I needed. It’s working great.

However, there are some third party plugins from github that I’d to use. I’ve cloned a few into the following directory I’ve made: /usr/local/lib/node_modules/tiddlywiki/plugins/github, but I’ve not done anything more than that. If i want to import plugins that way, I suspect that, at minimum, I’ll need to restructure the cloned repositories to match the file/directory structure seen in all of the /usr/local/lib/node_modules/tiddlywiki/plugins/twiddlywiki plugins.

Out of curiosity (and in spite of the “You can’t import plugins within the client-server TW setup!” in the Plugin Libary Tiddler), I tried dragging, dropping, and importing third party plugins from other Tiddlywikis. It works and is persistent between web server restarts.

Is there a reason I shouldn’t do it this way?

I found my solution.

To answer my own question, yes, there is totally a reason to NOT load plugins in this way. The Plugin Tiddlers loaded in by draw and drop end up going to the directory as the rest of your tiddlers. This means if you erronously load a plugin in without its required dependencies, you’re going to F.U.B.R your tiddlywiki. The only solution is to find and/or grep through ALL of your tiddlers to find and delete the offending plugin tiddlers.

After repeating this mistake 5 or 6 times (lol), I found this command:

tiddlywiki --load <downloaded-tiddlywiki-HTML-file> --savewikifolder <name-of-output-wiki-directory>

Running this command resulted in exactly what I was looking for: a way to import community editions and/or mass import plugins. Even better, the imported plugins are stored within their own directory within whatever wiki directory you specify (away from your other tiddlers).

My situation is solved. I hope this helps future people!

To show exactly what I did:

lluluthellama@raspberrypi:~ $ pwd && ls
/home/lluluthellama
Bookshelf  Downloads   final_wiki2           Pictures   stroll-wiki  wiki
Desktop    editions    Music                 pironman5  Templates    wiki5
Documents  final_wiki  neotw-vue-empty.html  Public     Videos
lluluthellama@raspberrypi:~ $ wget https://giffmex.org/stroll/stroll.html
--2024-09-16 21:00:44--  https://giffmex.org/stroll/stroll.html
Resolving giffmex.org (giffmex.org)... 75.119.207.236
Connecting to giffmex.org (giffmex.org)|75.119.207.236|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3181924 (3.0M) [text/html]
Saving to: ‘stroll.html’

stroll.html               100%[=====================================>]   3.03M  4.84MB/s    in 0.6s

2024-09-16 21:00:45 (4.84 MB/s) - ‘stroll.html’ saved [3181924/3181924]

lluluthellama@raspberrypi:~ $ mkdir fake_wiki
lluluthellama@raspberrypi:~ $ tiddlywiki --load stroll.html --savewikifolder fake_wiki/
lluluthellama@raspberrypi:~ $ cd fake_wiki/
lluluthellama@raspberrypi:~/fake_wiki $ ls
plugins  tiddlers  tiddlywiki.info
lluluthellama@raspberrypi:~/fake_wiki $ cd plugins/
lluluthellama@raspberrypi:~/fake_wiki/plugins $ ls
ContextPlugin  edit-comptext  editor-autolist  link-to-tabs  relink  sidebar-resizer  Stories
lluluthellama@raspberrypi:~/fake_wiki/plugins $
1 Like