Skip to content

Commit

Permalink
Change allow-no-keys to allow-keyless in config
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Oct 6, 2021
1 parent 5ff41c0 commit 68c805c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (
)

type Config struct {
Name string `yaml:"name"`
Host string `yaml:"host"`
Port int `yaml:"port"`
AnonAccess string `yaml:"anon-access"`
AllowNoKeys bool `yaml:"allow-no-keys"`
Users []User `yaml:"users"`
Repos []Repo `yaml:"repos"`
Source *git.RepoSource
Name string `yaml:"name"`
Host string `yaml:"host"`
Port int `yaml:"port"`
AnonAccess string `yaml:"anon-access"`
AllowKeyless bool `yaml:"allow-keyless"`
Users []User `yaml:"users"`
Repos []Repo `yaml:"repos"`
Source *git.RepoSource
}

type User struct {
Expand Down
2 changes: 1 addition & 1 deletion config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ port: %d
anon-access: %s
# Allow users with no private keys read-only access. Any password is accepted.
allow-no-keys: false
allow-keyless: false
# Customize repo display in menu
repos:
Expand Down
2 changes: 1 addition & 1 deletion config/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (cfg *Config) AuthRepo(repo string, pk ssh.PublicKey) gm.AccessLevel {
}

func (cfg *Config) PasswordHandler(ctx ssh.Context, password string) bool {
return (cfg.AnonAccess != "no-access") && cfg.AllowNoKeys
return (cfg.AnonAccess != "no-access") && cfg.AllowKeyless
}

func (cfg *Config) PublicKeyHandler(ctx ssh.Context, pk ssh.PublicKey) bool {
Expand Down

0 comments on commit 68c805c

Please sign in to comment.