Commit dba1e9e

Silvio Tomatis  ·  2026-10-30 20:12:10 -0400 EDT
parent bdd5983
pgs: document http-pass acl type in acl help and validation error (#224)

The acl command already accepts --type http-pass (password login form),
but the -type flag help and the validation error omitted it. Also note
that for http-pass the -acl value is the password.
2 files changed,  +4, -4
+1, -1
......@@ -236,7 +236,7 @@ This means only you can access the site through a web tunnel or by downloading t
236236 },
237237 {
238238 fmt.Sprintf("acl %s", projectName),
239- "Access control for project",
239+ "Access control for project (--type public, pico, pubkeys, http-pass)",
240240 },
241241 {
242242 fmt.Sprintf("cache %s", projectName),
+3, -3
......@@ -239,12 +239,12 @@ func Middleware(handler *UploadAssetHandler) pssh.SSHServerMiddleware {
239239 return err
240240 case "acl":
241241 aclCmd, write := flagSet("acl", sesh)
242- aclType := aclCmd.String("type", "", "access type: public, pico, pubkeys")
242+ aclType := aclCmd.String("type", "", "access type: public, pico, pubkeys, http-pass")
243243 var acls arrayFlags
244244 aclCmd.Var(
245245 &acls,
246246 "acl",
247- "list of pico usernames or sha256 public keys, delimited by commas",
247+ "list of pico usernames or sha256 public keys, delimited by commas (for http-pass: the password)",
248248 )
249249 if !flagCheck(aclCmd, projectName, cmdArgs) {
250250 return nil
......@@ -253,7 +253,7 @@ func Middleware(handler *UploadAssetHandler) pssh.SSHServerMiddleware {
253253
254254 if !slices.Contains([]string{"public", "pubkeys", "pico", "http-pass"}, *aclType) {
255255 err := fmt.Errorf(
256- "acl type must be one of the following: [public, pubkeys, pico], found %s",
256+ "acl type must be one of the following: [public, pubkeys, pico, http-pass], found %s",
257257 *aclType,
258258 )
259259 opts.bail(err)