Arlen22 / TiddlyServer

v2 - A static file server that can also save files and mount TiddlyWiki folders
https://arlen22.github.io/tiddlyserver/
MIT License
257 stars 36 forks source link

Help required to setup tiddlyserver in read only way #114

Closed parijathakumar closed 2 years ago

parijathakumar commented 3 years ago

Hai ! I am new to tiddlyserver. On my laptop, I am currently using TiddlyWiki by running the built-in webserver with nodejs. I am storing my tiddlers in github. Recently, I've setup an Ubuntu server on AWS and trying to setup tiddlyserver. I want my wiki to be always accessible for me to read on my mobile, tab, office laptop etc. I will always edit my tiddlers on my local laptop, commit and push the changes to github, then pull them to the AWS server. Don't want to edit them directly.

  1. I want the wiki to ask for a username and password.
  2. The wiki should not be writable.

I am able to achieve this with the buitin webserver of TiddlyWiki. But that serves only one wiki folder. I have multiple folders for different topics. I've tried different ways by reading the tiddlyserver's documentation but with no luck.

I've started with a single wiki_folder first like below ....

{
  "tree": "./my_tiddlers/some_wiki",
  "bindInfo": {
    "port": 8080,
    "bindWildcard": true,
    "localAddressPermissions": {
      "*" : {
        "datafolder": false,
        "loginlink": false,
        "mkdir": false,
        "putsaver": false,
        "registerNotice": false,
        "transfer": false,
        "upload": false,
        "websockets": false,
        "writeErrors": false
      }
    }
  },
  "putsaver": {
    "enabled": false
  }
}

That setup is holding me back at the following page ....

image

If I remove the "localAddressPermissions" block, then the wiki is opening fine. But no username and password. Also, anyone can edit and save the tiddlers. I don't want both these things. How to proceed ?

Arlen22 commented 3 years ago

Set "datafolder": true. Otherwise data folders cannot be loaded by that address or user.

Arlen22 commented 3 years ago

As far as making it readonly, you need to set that up in the datafolder. TiddlyServer loads the data folder when first requested and then keeps the data folder running until you close TiddlyServer. It passes the request directly to the processing part of the built-in webserver, so anything not directly related to TiddlyServer needs to be done in the data folder itself.

TiddlyServer also passes in the username for the request if you are logged into TiddlyServer.

fgerling commented 3 years ago

I also tried to set up wikis in read-only but wasn't able to find any documentation about it for datafolders. Arlen22, do you know if it is possible to set up TiddlyServer in a way so that it is read-only by default and writable only if one authenticate?

Arlen22 commented 2 years ago

Data folders work exactly the same as Node TiddlyWiki so you should ask this on the TiddlyWiki google group.

I apologize for not getting back to you sooner.