TiddlyServer: Unable to set authAccounts

Could you provide an example of authAccounts use ? I’ve been trying to make it work and nothing seems to pass validation. The closest thing I guess shoud work (if I understand documentation correctly) is :

{
	"tree": "./webroot",

	"authAccounts": {
		"permissions": {
			"putsaver": true,
			"writeErrors": true,
			"upload": true,
			"mkdir": true,
			"websockets": true,
			"registerNotice": true
		},
		"clientKeys": {"user": {"hash", "salt"}},
	},
	
	"bindInfo": {
		"bindAddress": ["127.0.0.1"],
	},
	"putsaver": {
		"backupFolder": "../backups"
	},
	"$schema": "./settings-2-1.schema.json"
}

Instead it throws an invalid character error between hash and salt.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Many thanks Arlen22!

It’s working perfectly! Below is my final settings.json in case it helps SleepyGinger or anyone else. This configuration has 3 tiddlywikis, that are only accessible to user jav of group av:

{
       "tree": { 
         "RememberAll": {
           "$element": "folder",
           "path": "~/tiddly/RememberAll/",
           "$options": [
             {"$element": "auth", "authList": ["av"] } ]
         },

         "Biblioteca": {
           "$element": "folder",
           "path": "~/tiddly/library",
           "$options": [
             {"$element": "auth", "authList": ["av"] } ]
         },

         "Cardo": {
           "$element": "folder",
           "path": "~/tiddly/Cardo/",
           "$options": [
             {"$element": "auth", "authList": ["av"] } ]
         },
        },
        "bindInfo": {
                "port": 8080,
		"bindAddress": ["127.0.0.1"]
	},
	"putsaver": {
		"backupFolder": "../backups", 
                "gzipBackups": true
	},
        "authAccounts": {
            "av": {
                "clientKeys": {
                  "jav": { "publicKey": "«key copied from failed login»", "cookieSalt": "«my salt»" }
                }, 
                "permissions": {
                  "mkdir": true,
                  "putsaver": true,
                  "registerNotice": true,
                  "upload": true,
                  "websockets": true,
                  "writeErrors": true,
                  "loginlink": true
                }
            }
        },
	"$schema": "./settings-2-1.schema.json",
        "authCookieAge": 864000
}

Thank you sooooo much @zevarela this helped more than youll ever know. 😄

Replace your folder path string, with this object:

{ 
  "$element": "folder", 
  "path": "your folder path string", 
  "$options": [
    {"$element": "auth", "authList": ["av"] }
  ]
},

The authList array contains the authAccounts keys that are allowed to access this folder.

Here’s a short video I made that demonstrates the login process. Let me know here if you have any further questions. https://youtu.be/UfAiyubP8nY

@ohare93 , also, it’s better to open a new issue for a new or only partially related problem. It helps to keep things simpler and I still get notified the same.

Yes, you can make a group the top level, and then apply everything to that.

  "tree": {
	"$element": "group",
	"$children":  {
	  "Personal": "tw/Personal",
	  "WikiFiles": "/home/pi/SyncThing/WikiFiles"
	},
	"$options": [{"$element": "auth", "authList": ["jmo"] } ]
  },