File based ACLs

Use file based access control lists

You can apply file based access control lists per folder by placing a file called .goshs in that folder. The files content is like:

{
  "auth":"<user>:<hash>",
  "block":[
    "file1",
    "file2",
    "folder/"
  ]
}

Custom Basic Authentication

The setting auth let’s you define a custom basic authentication for the corresponding folder. The hash you need to enter as a password replacement can be generated using goshs as well using --hash:

goshs --hash
Enter password: *******
Hash: $2a$14$hh50ncgjLAOQT3KI1RlVYus3gMecE4/Ul2HakUp6iiBCnl2c5M0da

Block and hide

The block mode will hide the folders and files from the listing and restrict access to them regardless.

Warning

Please be aware that a file inside a blocked folder will be accessible unless you define a new .goshs file within that blocked folder.