68c805c8ad6353f71fa973bb2386655f2e6800f0

Author
Christian Rocha <christian@rocha.is>
Committer
Christian Rocha <christian@rocha.is>
Date

Message

Change allow-no-keys to allow-keyless in config

Diff

 1diff --git a/config/config.go b/config/config.go
 2index 168ba4c56d4187238a0d05cc45b1b9229f548fc2..028e173fa76c5bc21894f353af32ae930edbbf44 100644
 3--- a/config/config.go
 4+++ b/config/config.go
 5@@ -13,14 +13,14 @@ import (
 6 )
 7 
 8 type Config struct {
 9-	Name        string `yaml:"name"`
10-	Host        string `yaml:"host"`
11-	Port        int    `yaml:"port"`
12-	AnonAccess  string `yaml:"anon-access"`
13-	AllowNoKeys bool   `yaml:"allow-no-keys"`
14-	Users       []User `yaml:"users"`
15-	Repos       []Repo `yaml:"repos"`
16-	Source      *git.RepoSource
17+	Name         string `yaml:"name"`
18+	Host         string `yaml:"host"`
19+	Port         int    `yaml:"port"`
20+	AnonAccess   string `yaml:"anon-access"`
21+	AllowKeyless bool   `yaml:"allow-keyless"`
22+	Users        []User `yaml:"users"`
23+	Repos        []Repo `yaml:"repos"`
24+	Source       *git.RepoSource
25 }
26 
27 type User struct {
28diff --git a/config/defaults.go b/config/defaults.go
29index 0eaceb131042bda44378cdacd11bdc670361f4a6..85499246ae7f34649d6d0969fa30358b9f9bc5b7 100644
30--- a/config/defaults.go
31+++ b/config/defaults.go
32@@ -10,7 +10,7 @@ port: %d
33 anon-access: %s
34 
35 # Allow users with no private keys read-only access. Any password is accepted.
36-allow-no-keys: false
37+allow-keyless: false
38 
39 # Customize repo display in menu
40 repos:
41diff --git a/config/git.go b/config/git.go
42index bd7372a8b0eee0c657f1e6a022f44c9e581f5c61..c2569b20f1b6b06f54faac2319dd116840d1f7d1 100644
43--- a/config/git.go
44+++ b/config/git.go
45@@ -24,7 +24,7 @@ func (cfg *Config) AuthRepo(repo string, pk ssh.PublicKey) gm.AccessLevel {
46 }
47 
48 func (cfg *Config) PasswordHandler(ctx ssh.Context, password string) bool {
49-	return (cfg.AnonAccess != "no-access") && cfg.AllowNoKeys
50+	return (cfg.AnonAccess != "no-access") && cfg.AllowKeyless
51 }
52 
53 func (cfg *Config) PublicKeyHandler(ctx ssh.Context, pk ssh.PublicKey) bool {