this repo has no description smallweb.run
smallweb
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

add ability to whitelist an user for a single key

pomdtr 2b8f14d5 f3dbb790

+13 -3
+13 -3
cmd/up.go
··· 166 166 } 167 167 } 168 168 169 - for _, authorizedKeysPath := range []string{ 170 - filepath.Join(os.Getenv("HOME"), ".ssh", "authorized_keys"), 169 + authorizedKeysPaths := []string{ 171 170 filepath.Join(k.String("dir"), ".smallweb", "authorized_keys"), 172 - } { 171 + filepath.Join(k.String("dir"), ".smallweb", "authorized_keys"), 172 + } 173 + 174 + if user := ctx.User(); user != "_" { 175 + authorizedKeysPaths = append(authorizedKeysPaths, filepath.Join(k.String("dir"), user, "authorized_keys")) 176 + } 177 + 178 + for _, authorizedKeysPath := range authorizedKeysPaths { 179 + if _, err := os.Stat(authorizedKeysPath); err != nil { 180 + continue 181 + } 182 + 173 183 ok, err := validatePublicKey(authorizedKeysPath, key) 174 184 if err != nil { 175 185 if errors.Is(err, os.ErrNotExist) {