mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 17:20:53 +02:00
Post work for #2637
Improve test cases, config settings, also show SSH config settings on admin config panel.
This commit is contained in:
1 parent
83c74878df
commit
8055a0bdac
15 files changed
+237
-197
No files matched your search
@@ -3,7 +3,7 @@ Gogs - Go Git Service [
|

|
||||||
|
|
||||||
##### Current version: 0.8.46
|
##### Current version: 0.8.47
|
||||||
|
|
||||||
| Web | UI | Preview |
|
| Web | UI | Preview |
|
||||||
|:-------------:|:-------:|:-------:|
|
|:-------------:|:-------:|:-------:|
|
||||||
|
|||||||
+1
-1
@@ -136,7 +136,7 @@ func runServ(c *cli.Context) {
|
|||||||
|
|
||||||
setup("serv.log")
|
setup("serv.log")
|
||||||
|
|
||||||
if setting.DisableSSH {
|
if setting.SSH.Disabled {
|
||||||
println("Gogs: SSH has been disabled")
|
println("Gogs: SSH has been disabled")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-16
@@ -71,13 +71,13 @@ SSH_PORT = 22
|
|||||||
SSH_LISTEN_PORT = %(SSH_PORT)s
|
SSH_LISTEN_PORT = %(SSH_PORT)s
|
||||||
; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
|
; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
|
||||||
SSH_ROOT_PATH =
|
SSH_ROOT_PATH =
|
||||||
; override engine choice to check public keys (default: 'ssh-keygen' when
|
; Directory to create temporary files when test publick key using ssh-keygen,
|
||||||
; DISABLE_SSH is set to false else 'native')
|
; default is system temporary directory.
|
||||||
SSH_PUBLICKEY_CHECK =
|
SSH_KEY_TEST_PATH =
|
||||||
; directory to create temporary files when using ssh-keygen (default: /tmp)
|
; Path to ssh-keygen, default is 'ssh-keygen' and let shells find out which one to call.
|
||||||
SSH_WORK_PATH =
|
SSH_KEYGEN_PATH = ssh-keygen
|
||||||
; path to ssh-keygen (default: result of `which ssh-keygen`)
|
; Indicate whether to check minimum key size with corresponding type
|
||||||
SSH_KEYGEN_PATH =
|
MINIMUM_KEY_SIZE_CHECK = false
|
||||||
; Disable CDN even in "prod" mode
|
; Disable CDN even in "prod" mode
|
||||||
OFFLINE_MODE = false
|
OFFLINE_MODE = false
|
||||||
DISABLE_ROUTER_LOG = false
|
DISABLE_ROUTER_LOG = false
|
||||||
@@ -98,6 +98,13 @@ ENABLE_GZIP = false
|
|||||||
; Landing page for non-logged users, can be "home" or "explore"
|
; Landing page for non-logged users, can be "home" or "explore"
|
||||||
LANDING_PAGE = home
|
LANDING_PAGE = home
|
||||||
|
|
||||||
|
; Define allowed algorithms and their minimum key length (use -1 to disable a type)
|
||||||
|
[ssh.minimum_key_sizes]
|
||||||
|
ED25519 = 256
|
||||||
|
ECDSA = 256
|
||||||
|
RSA = 2048
|
||||||
|
DSA = 1024
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
; Either "mysql", "postgres" or "sqlite3", it's your choice
|
; Either "mysql", "postgres" or "sqlite3", it's your choice
|
||||||
DB_TYPE = mysql
|
DB_TYPE = mysql
|
||||||
@@ -139,15 +146,6 @@ ENABLE_REVERSE_PROXY_AUTHENTICATION = false
|
|||||||
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
|
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
|
||||||
; Enable captcha validation for registration
|
; Enable captcha validation for registration
|
||||||
ENABLE_CAPTCHA = true
|
ENABLE_CAPTCHA = true
|
||||||
; Do not check minimum key size with corresponding type
|
|
||||||
ENABLE_MINIMUM_KEY_SIZE_CHECK = false
|
|
||||||
|
|
||||||
; define allowed algorithms and their minimum key length (use -1 to disable a type)
|
|
||||||
[service.minimum_key_sizes]
|
|
||||||
ED25519 = 256
|
|
||||||
ECDSA = 256
|
|
||||||
RSA = 2048
|
|
||||||
DSA = 1024
|
|
||||||
|
|
||||||
[webhook]
|
[webhook]
|
||||||
; Hook task queue length
|
; Hook task queue length
|
||||||
|
|||||||
@@ -960,6 +960,19 @@ config.static_file_root_path = Static File Root Path
|
|||||||
config.log_file_root_path = Log File Root Path
|
config.log_file_root_path = Log File Root Path
|
||||||
config.script_type = Script Type
|
config.script_type = Script Type
|
||||||
config.reverse_auth_user = Reverse Authentication User
|
config.reverse_auth_user = Reverse Authentication User
|
||||||
|
|
||||||
|
config.ssh_config = SSH Configuration
|
||||||
|
config.ssh_enabled = Enabled
|
||||||
|
config.ssh_start_builtin_server = Start Builtin Server
|
||||||
|
config.ssh_domain = Domain
|
||||||
|
config.ssh_port = Port
|
||||||
|
config.ssh_listen_port = Listen Port
|
||||||
|
config.ssh_root_path = Root Path
|
||||||
|
config.ssh_key_test_path = Key Test Path
|
||||||
|
config.ssh_keygen_path = Keygen ('ssh-keygen') Path
|
||||||
|
config.ssh_minimum_key_size_check = Minimum Key Size Check
|
||||||
|
config.ssh_minimum_key_sizes = Minimum Key Sizes
|
||||||
|
|
||||||
config.db_config = Database Configuration
|
config.db_config = Database Configuration
|
||||||
config.db_type = Type
|
config.db_type = Type
|
||||||
config.db_host = Host
|
config.db_host = Host
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.8.46.0227"
|
const APP_VER = "0.8.47.0227"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
|
|||||||
+3
-3
@@ -457,10 +457,10 @@ func (repo *Repository) cloneLink(isWiki bool) *CloneLink {
|
|||||||
|
|
||||||
repo.Owner = repo.MustOwner()
|
repo.Owner = repo.MustOwner()
|
||||||
cl := new(CloneLink)
|
cl := new(CloneLink)
|
||||||
if setting.SSHPort != 22 {
|
if setting.SSH.Port != 22 {
|
||||||
cl.SSH = fmt.Sprintf("ssh://%s@%s:%d/%s/%s.git", setting.RunUser, setting.SSHDomain, setting.SSHPort, repo.Owner.Name, repoName)
|
cl.SSH = fmt.Sprintf("ssh://%s@%s:%d/%s/%s.git", setting.RunUser, setting.SSH.Domain, setting.SSH.Port, repo.Owner.Name, repoName)
|
||||||
} else {
|
} else {
|
||||||
cl.SSH = fmt.Sprintf("%s@%s:%s/%s.git", setting.RunUser, setting.SSHDomain, repo.Owner.Name, repoName)
|
cl.SSH = fmt.Sprintf("%s@%s:%s/%s.git", setting.RunUser, setting.SSH.Domain, repo.Owner.Name, repoName)
|
||||||
}
|
}
|
||||||
cl.HTTPS = fmt.Sprintf("%s%s/%s.git", setting.AppUrl, repo.Owner.Name, repoName)
|
cl.HTTPS = fmt.Sprintf("%s%s/%s.git", setting.AppUrl, repo.Owner.Name, repoName)
|
||||||
return cl
|
return cl
|
||||||
|
|||||||
+54
-60
@@ -16,7 +16,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -35,10 +34,7 @@ const (
|
|||||||
_TPL_PUBLICK_KEY = `command="%s serv key-%d --config='%s'",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s` + "\n"
|
_TPL_PUBLICK_KEY = `command="%s serv key-%d --config='%s'",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s` + "\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var sshOpLocker = sync.Mutex{}
|
||||||
sshOpLocker = sync.Mutex{}
|
|
||||||
SSHUnknownKeyType = fmt.Errorf("unknown key type")
|
|
||||||
)
|
|
||||||
|
|
||||||
type KeyType int
|
type KeyType int
|
||||||
|
|
||||||
@@ -83,19 +79,18 @@ func (key *PublicKey) GetAuthorizedString() string {
|
|||||||
func extractTypeFromBase64Key(key string) (string, error) {
|
func extractTypeFromBase64Key(key string) (string, error) {
|
||||||
b, err := base64.StdEncoding.DecodeString(key)
|
b, err := base64.StdEncoding.DecodeString(key)
|
||||||
if err != nil || len(b) < 4 {
|
if err != nil || len(b) < 4 {
|
||||||
return "", errors.New("Invalid key format")
|
return "", fmt.Errorf("Invalid key format: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
keyLength := int(binary.BigEndian.Uint32(b))
|
keyLength := int(binary.BigEndian.Uint32(b))
|
||||||
|
|
||||||
if len(b) < 4+keyLength {
|
if len(b) < 4+keyLength {
|
||||||
return "", errors.New("Invalid key format")
|
return "", fmt.Errorf("Invalid key format: not enough length")
|
||||||
}
|
}
|
||||||
|
|
||||||
return string(b[4 : 4+keyLength]), nil
|
return string(b[4 : 4+keyLength]), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseKeyString parses any key string in openssh or ssh2 format to clean openssh string (rfc4253)
|
// parseKeyString parses any key string in OpenSSH or SSH2 format to clean OpenSSH string (RFC4253)
|
||||||
func parseKeyString(content string) (string, error) {
|
func parseKeyString(content string) (string, error) {
|
||||||
// Transform all legal line endings to a single "\n"
|
// Transform all legal line endings to a single "\n"
|
||||||
s := strings.Replace(strings.Replace(strings.TrimSpace(content), "\r\n", "\n", -1), "\r", "\n", -1)
|
s := strings.Replace(strings.Replace(strings.TrimSpace(content), "\r\n", "\n", -1), "\r", "\n", -1)
|
||||||
@@ -158,50 +153,53 @@ func parseKeyString(content string) (string, error) {
|
|||||||
return keyType + " " + keyContent + " " + keyComment, nil
|
return keyType + " " + keyContent + " " + keyComment, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract key type and length using ssh-keygen
|
// writeTmpKeyFile writes key content to a temporary file
|
||||||
|
// and returns the name of that file, along with any possible errors.
|
||||||
|
func writeTmpKeyFile(content string) (string, error) {
|
||||||
|
tmpFile, err := ioutil.TempFile(setting.SSH.KeyTestPath, "gogs_keytest")
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("TempFile: %v", err)
|
||||||
|
}
|
||||||
|
defer tmpFile.Close()
|
||||||
|
|
||||||
|
if _, err = tmpFile.WriteString(content); err != nil {
|
||||||
|
return "", fmt.Errorf("tmpFile.WriteString: %v", err)
|
||||||
|
}
|
||||||
|
return tmpFile.Name(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SSHKeyGenParsePublicKey extracts key type and length using ssh-keygen.
|
||||||
func SSHKeyGenParsePublicKey(key string) (string, int, error) {
|
func SSHKeyGenParsePublicKey(key string) (string, int, error) {
|
||||||
// The ssh-keygen in Windows does not print key type, so no need go further.
|
// The ssh-keygen in Windows does not print key type, so no need go further.
|
||||||
if setting.IsWindows {
|
if setting.IsWindows {
|
||||||
return "", 0, nil
|
return "", 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpFile, err := ioutil.TempFile(setting.SSHWorkPath, "gogs_keytest")
|
tmpName, err := writeTmpKeyFile(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", 0, err
|
return "", 0, fmt.Errorf("writeTmpKeyFile: %v", err)
|
||||||
}
|
}
|
||||||
tmpName := tmpFile.Name()
|
|
||||||
defer os.Remove(tmpName)
|
defer os.Remove(tmpName)
|
||||||
|
|
||||||
if ln, err := tmpFile.WriteString(key); err != nil {
|
stdout, stderr, err := process.Exec("SSHKeyGenParsePublicKey", setting.SSH.KeygenPath, "-lf", tmpName)
|
||||||
tmpFile.Close()
|
|
||||||
return "", 0, err
|
|
||||||
} else if ln != len(key) {
|
|
||||||
tmpFile.Close()
|
|
||||||
return "", 0, fmt.Errorf("could not write complete public key (written: %d, should be: %d): %s", ln, len(key), key)
|
|
||||||
}
|
|
||||||
tmpFile.Close()
|
|
||||||
|
|
||||||
stdout, stderr, err := process.Exec("CheckPublicKeyString", setting.SSHKeyGenPath, "-lf", tmpName)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", 0, fmt.Errorf("public key check failed with error '%s': %s", err, stderr)
|
return "", 0, fmt.Errorf("Fail to parse public key: %s - %s", err, stderr)
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(stdout, "is not a public key file.") {
|
if strings.Contains(stdout, "is not a public key file") {
|
||||||
return "", 0, SSHUnknownKeyType
|
return "", 0, ErrKeyUnableVerify{stdout}
|
||||||
}
|
}
|
||||||
|
|
||||||
fields := strings.Split(stdout, " ")
|
fields := strings.Split(stdout, " ")
|
||||||
if len(fields) < 4 {
|
if len(fields) < 4 {
|
||||||
return "", 0, fmt.Errorf("invalid public key line: %s", stdout)
|
return "", 0, fmt.Errorf("Invalid public key line: %s", stdout)
|
||||||
}
|
}
|
||||||
|
|
||||||
length, err := strconv.Atoi(fields[0])
|
|
||||||
if err != nil {
|
|
||||||
return "", 0, err
|
|
||||||
}
|
|
||||||
keyType := strings.Trim(fields[len(fields)-1], "()\r\n")
|
keyType := strings.Trim(fields[len(fields)-1], "()\r\n")
|
||||||
return strings.ToLower(keyType), length, nil
|
return strings.ToLower(keyType), com.StrTo(fields[0]).MustInt(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract the key type and length using the golang ssh library
|
// SSHNativeParsePublicKey extracts the key type and length using the golang SSH library.
|
||||||
|
// NOTE: ed25519 is not supported.
|
||||||
func SSHNativeParsePublicKey(keyLine string) (string, int, error) {
|
func SSHNativeParsePublicKey(keyLine string) (string, int, error) {
|
||||||
fields := strings.Fields(keyLine)
|
fields := strings.Fields(keyLine)
|
||||||
if len(fields) < 2 {
|
if len(fields) < 2 {
|
||||||
@@ -215,14 +213,13 @@ func SSHNativeParsePublicKey(keyLine string) (string, int, error) {
|
|||||||
|
|
||||||
pkey, err := ssh.ParsePublicKey(raw)
|
pkey, err := ssh.ParsePublicKey(raw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if strings.HasPrefix(err.Error(), "ssh: unknown key algorithm") {
|
if strings.Contains(err.Error(), "ssh: unknown key algorithm") {
|
||||||
return "", 0, SSHUnknownKeyType
|
return "", 0, ErrKeyUnableVerify{err.Error()}
|
||||||
}
|
}
|
||||||
return "", 0, err
|
return "", 0, fmt.Errorf("ssh.ParsePublicKey: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// The ssh library can parse the key, so next we find out what key exactly we
|
// The ssh library can parse the key, so next we find out what key exactly we have.
|
||||||
// have.
|
|
||||||
switch pkey.Type() {
|
switch pkey.Type() {
|
||||||
case ssh.KeyAlgoDSA:
|
case ssh.KeyAlgoDSA:
|
||||||
rawPub := struct {
|
rawPub := struct {
|
||||||
@@ -253,16 +250,18 @@ func SSHNativeParsePublicKey(keyLine string) (string, int, error) {
|
|||||||
return "ecdsa", 521, nil
|
return "ecdsa", 521, nil
|
||||||
case "ssh-ed25519": // TODO replace with ssh constant when available
|
case "ssh-ed25519": // TODO replace with ssh constant when available
|
||||||
return "ed25519", 256, nil
|
return "ed25519", 256, nil
|
||||||
default:
|
|
||||||
return "", 0, fmt.Errorf("no support for key length detection for type %s", pkey.Type())
|
|
||||||
}
|
}
|
||||||
return "", 0, fmt.Errorf("SSHNativeParsePublicKey failed horribly, please investigate why")
|
return "", 0, fmt.Errorf("Unsupported key length detection for type: %s", pkey.Type())
|
||||||
}
|
}
|
||||||
|
|
||||||
// CheckPublicKeyString checks if the given public key string is recognized by SSH.
|
// CheckPublicKeyString checks if the given public key string is recognized by SSH.
|
||||||
//
|
//
|
||||||
// The function returns the actual public key line on success.
|
// The function returns the actual public key line on success.
|
||||||
func CheckPublicKeyString(content string) (_ string, err error) {
|
func CheckPublicKeyString(content string) (_ string, err error) {
|
||||||
|
if setting.SSH.Disabled {
|
||||||
|
return "", errors.New("SSH is disabled")
|
||||||
|
}
|
||||||
|
|
||||||
content, err = parseKeyString(content)
|
content, err = parseKeyString(content)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
@@ -280,30 +279,25 @@ func CheckPublicKeyString(content string) (_ string, err error) {
|
|||||||
keyType string
|
keyType string
|
||||||
length int
|
length int
|
||||||
)
|
)
|
||||||
if setting.SSHPublicKeyCheck == setting.SSH_PUBLICKEY_CHECK_NATIVE {
|
if setting.SSH.StartBuiltinServer {
|
||||||
keyType, length, err = SSHNativeParsePublicKey(content)
|
keyType, length, err = SSHNativeParsePublicKey(content)
|
||||||
} else if setting.SSHPublicKeyCheck == setting.SSH_PUBLICKEY_CHECK_KEYGEN {
|
|
||||||
keyType, length, err = SSHKeyGenParsePublicKey(content)
|
|
||||||
} else {
|
} else {
|
||||||
log.Error(4, "invalid public key check type: %s", setting.SSHPublicKeyCheck)
|
keyType, length, err = SSHKeyGenParsePublicKey(content)
|
||||||
return "", fmt.Errorf("invalid public key check type")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Trace("invalid public key of type '%s' with length %d: %s", keyType, length, err)
|
|
||||||
return "", fmt.Errorf("ParsePublicKey: %v", err)
|
return "", fmt.Errorf("ParsePublicKey: %v", err)
|
||||||
}
|
}
|
||||||
log.Trace("Key type: %s", keyType)
|
log.Trace("Key info [native: %v]: %s-%d", setting.SSH.StartBuiltinServer, keyType, length)
|
||||||
|
|
||||||
if !setting.Service.EnableMinimumKeySizeCheck {
|
if !setting.SSH.MinimumKeySizeCheck {
|
||||||
return content, nil
|
return content, nil
|
||||||
}
|
}
|
||||||
if minLen, found := setting.Service.MinimumKeySizes[keyType]; found && length >= minLen {
|
if minLen, found := setting.SSH.MinimumKeySizes[keyType]; found && length >= minLen {
|
||||||
return content, nil
|
return content, nil
|
||||||
} else if found && length < minLen {
|
} else if found && length < minLen {
|
||||||
return "", fmt.Errorf("key not large enough - got %d, needs %d", length, minLen)
|
return "", fmt.Errorf("Key length is not enough: got %d, needs %d", length, minLen)
|
||||||
}
|
}
|
||||||
return "", fmt.Errorf("key type '%s' is not allowed", keyType)
|
return "", fmt.Errorf("Key type is not allowed: %s", keyType)
|
||||||
}
|
}
|
||||||
|
|
||||||
// saveAuthorizedKeyFile writes SSH key content to authorized_keys file.
|
// saveAuthorizedKeyFile writes SSH key content to authorized_keys file.
|
||||||
@@ -311,7 +305,7 @@ func saveAuthorizedKeyFile(keys ...*PublicKey) error {
|
|||||||
sshOpLocker.Lock()
|
sshOpLocker.Lock()
|
||||||
defer sshOpLocker.Unlock()
|
defer sshOpLocker.Unlock()
|
||||||
|
|
||||||
fpath := filepath.Join(setting.SSHRootPath, "authorized_keys")
|
fpath := filepath.Join(setting.SSH.RootPath, "authorized_keys")
|
||||||
f, err := os.OpenFile(fpath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600)
|
f, err := os.OpenFile(fpath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -379,7 +373,7 @@ func addKey(e Engine, key *PublicKey) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Don't need to rewrite this file if builtin SSH server is enabled.
|
// Don't need to rewrite this file if builtin SSH server is enabled.
|
||||||
if setting.StartSSHServer {
|
if setting.SSH.StartBuiltinServer {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return saveAuthorizedKeyFile(key)
|
return saveAuthorizedKeyFile(key)
|
||||||
@@ -529,12 +523,12 @@ func deletePublicKey(e *xorm.Session, keyID int64) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Don't need to rewrite this file if builtin SSH server is enabled.
|
// Don't need to rewrite this file if builtin SSH server is enabled.
|
||||||
if setting.StartSSHServer {
|
if setting.SSH.StartBuiltinServer {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
fpath := filepath.Join(setting.SSHRootPath, "authorized_keys")
|
fpath := filepath.Join(setting.SSH.RootPath, "authorized_keys")
|
||||||
tmpPath := filepath.Join(setting.SSHRootPath, "authorized_keys.tmp")
|
tmpPath := fpath + ".tmp"
|
||||||
if err = rewriteAuthorizedKeys(key, fpath, tmpPath); err != nil {
|
if err = rewriteAuthorizedKeys(key, fpath, tmpPath); err != nil {
|
||||||
return err
|
return err
|
||||||
} else if err = os.Remove(fpath); err != nil {
|
} else if err = os.Remove(fpath); err != nil {
|
||||||
@@ -576,7 +570,8 @@ func RewriteAllPublicKeys() error {
|
|||||||
sshOpLocker.Lock()
|
sshOpLocker.Lock()
|
||||||
defer sshOpLocker.Unlock()
|
defer sshOpLocker.Unlock()
|
||||||
|
|
||||||
tmpPath := filepath.Join(setting.SSHRootPath, "authorized_keys.tmp")
|
fpath := filepath.Join(setting.SSH.RootPath, "authorized_keys")
|
||||||
|
tmpPath := fpath + ".tmp"
|
||||||
f, err := os.OpenFile(tmpPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
|
f, err := os.OpenFile(tmpPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -592,7 +587,6 @@ func RewriteAllPublicKeys() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
fpath := filepath.Join(setting.SSHRootPath, "authorized_keys")
|
|
||||||
if com.IsExist(fpath) {
|
if com.IsExist(fpath) {
|
||||||
if err = os.Remove(fpath); err != nil {
|
if err = os.Remove(fpath); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
+38
-32
@@ -1,39 +1,45 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gogits/gogs/modules/setting"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
. "github.com/smartystreets/goconvey/convey"
|
||||||
|
|
||||||
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSSHKeyVerification(t *testing.T) {
|
func init() {
|
||||||
setting.SSHWorkPath = "/tmp"
|
setting.NewContext()
|
||||||
setting.SSHKeyGenPath = "/usr/bin/ssh-keygen"
|
}
|
||||||
|
|
||||||
keys := map[string]string{
|
func Test_SSHParsePublicKey(t *testing.T) {
|
||||||
"dsa-1024": string("ssh-dss AAAAB3NzaC1kc3MAAACBAOChCC7lf6Uo9n7BmZ6M8St19PZf4Tn59NriyboW2x/DZuYAz3ibZ2OkQ3S0SqDIa0HXSEJ1zaExQdmbO+Ux/wsytWZmCczWOVsaszBZSl90q8UnWlSH6P+/YA+RWJm5SFtuV9PtGIhyZgoNuz5kBQ7K139wuQsecdKktISwTakzAAAAFQCzKsO2JhNKlL+wwwLGOcLffoAmkwAAAIBpK7/3xvduajLBD/9vASqBQIHrgK2J+wiQnIb/Wzy0UsVmvfn8A+udRbBo+csM8xrSnlnlJnjkJS3qiM5g+eTwsLIV1IdKPEwmwB+VcP53Cw6lSyWyJcvhFb0N6s08NZysLzvj0N+ZC/FnhKTLzIyMtkHf/IrPCwlM+pV/M/96YgAAAIEAqQcGn9CKgzgPaguIZooTAOQdvBLMI5y0bQjOW6734XOpqQGf/Kra90wpoasLKZjSYKNPjE+FRUOrStLrxcNs4BeVKhy2PYTRnybfYVk1/dmKgH6P1YSRONsGKvTsH6c5IyCRG0ncCgYeF8tXppyd642982daopE7zQ/NPAnJfag= nocomment"),
|
testKeys := map[string]struct {
|
||||||
"rsa-1024": string("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDAu7tvIvX6ZHrRXuZNfkR3XLHSsuCK9Zn3X58lxBcQzuo5xZgB6vRwwm/QtJuF+zZPtY5hsQILBLmF+BZ5WpKZp1jBeSjH2G7lxet9kbcH+kIVj0tPFEoyKI9wvWqIwC4prx/WVk2wLTJjzBAhyNxfEq7C9CeiX9pQEbEqJfkKCQ== nocomment\n"),
|
typeName string
|
||||||
"rsa-2048": string("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMZXh+1OBUwSH9D45wTaxErQIN9IoC9xl7MKJkqvTvv6O5RR9YW/IK9FbfjXgXsppYGhsCZo1hFOOsXHMnfOORqu/xMDx4yPuyvKpw4LePEcg4TDipaDFuxbWOqc/BUZRZcXu41QAWfDLrInwsltWZHSeG7hjhpacl4FrVv9V1pS6Oc5Q1NxxEzTzuNLS/8diZrTm/YAQQ/+B+mzWI3zEtF4miZjjAljWd1LTBPvU23d29DcBmmFahcZ441XZsTeAwGxG/Q6j8NgNXj9WxMeWwxXV2jeAX/EBSpZrCVlCQ1yJswT6xCp8TuBnTiGWYMBNTbOZvPC4e0WI2/yZW/s5F nocomment"),
|
length int
|
||||||
"ecdsa-256": string("ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFQacN3PrOll7PXmN5B/ZNVahiUIqI05nbBlZk1KXsO3d06ktAWqbNflv2vEmA38bTFTfJ2sbn2B5ksT52cDDbA= nocomment"),
|
content string
|
||||||
"ecdsa-384": string("ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBINmioV+XRX1Fm9Qk2ehHXJ2tfVxW30ypUWZw670Zyq5GQfBAH6xjygRsJ5wWsHXBsGYgFUXIHvMKVAG1tpw7s6ax9oA+dJOJ7tj+vhn8joFqT+sg3LYHgZkHrfqryRasQ== nocomment"),
|
}{
|
||||||
"ecdsa-512": string("ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBACGt3UG3EzRwNOI17QR84l6PgiAcvCE7v6aXPj/SC6UWKg4EL8vW9ZBcdYL9wzs4FZXh4MOV8jAzu3KRWNTwb4k2wFNUpGOt7l28MztFFEtH5BDDrtAJSPENPy8pvPLMfnPg5NhvWycqIBzNcHipem5wSJFN5PdpNOC2xMrPWKNqj+ZjQ== nocomment"),
|
"dsa-1024": {"dsa", 1024, "ssh-dss AAAAB3NzaC1kc3MAAACBAOChCC7lf6Uo9n7BmZ6M8St19PZf4Tn59NriyboW2x/DZuYAz3ibZ2OkQ3S0SqDIa0HXSEJ1zaExQdmbO+Ux/wsytWZmCczWOVsaszBZSl90q8UnWlSH6P+/YA+RWJm5SFtuV9PtGIhyZgoNuz5kBQ7K139wuQsecdKktISwTakzAAAAFQCzKsO2JhNKlL+wwwLGOcLffoAmkwAAAIBpK7/3xvduajLBD/9vASqBQIHrgK2J+wiQnIb/Wzy0UsVmvfn8A+udRbBo+csM8xrSnlnlJnjkJS3qiM5g+eTwsLIV1IdKPEwmwB+VcP53Cw6lSyWyJcvhFb0N6s08NZysLzvj0N+ZC/FnhKTLzIyMtkHf/IrPCwlM+pV/M/96YgAAAIEAqQcGn9CKgzgPaguIZooTAOQdvBLMI5y0bQjOW6734XOpqQGf/Kra90wpoasLKZjSYKNPjE+FRUOrStLrxcNs4BeVKhy2PYTRnybfYVk1/dmKgH6P1YSRONsGKvTsH6c5IyCRG0ncCgYeF8tXppyd642982daopE7zQ/NPAnJfag= nocomment"},
|
||||||
}
|
"rsa-1024": {"rsa", 1024, "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDAu7tvIvX6ZHrRXuZNfkR3XLHSsuCK9Zn3X58lxBcQzuo5xZgB6vRwwm/QtJuF+zZPtY5hsQILBLmF+BZ5WpKZp1jBeSjH2G7lxet9kbcH+kIVj0tPFEoyKI9wvWqIwC4prx/WVk2wLTJjzBAhyNxfEq7C9CeiX9pQEbEqJfkKCQ== nocomment\n"},
|
||||||
|
"rsa-2048": {"rsa", 2048, "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMZXh+1OBUwSH9D45wTaxErQIN9IoC9xl7MKJkqvTvv6O5RR9YW/IK9FbfjXgXsppYGhsCZo1hFOOsXHMnfOORqu/xMDx4yPuyvKpw4LePEcg4TDipaDFuxbWOqc/BUZRZcXu41QAWfDLrInwsltWZHSeG7hjhpacl4FrVv9V1pS6Oc5Q1NxxEzTzuNLS/8diZrTm/YAQQ/+B+mzWI3zEtF4miZjjAljWd1LTBPvU23d29DcBmmFahcZ441XZsTeAwGxG/Q6j8NgNXj9WxMeWwxXV2jeAX/EBSpZrCVlCQ1yJswT6xCp8TuBnTiGWYMBNTbOZvPC4e0WI2/yZW/s5F nocomment"},
|
||||||
for name, pubkey := range keys {
|
"ecdsa-256": {"ecdsa", 256, "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFQacN3PrOll7PXmN5B/ZNVahiUIqI05nbBlZk1KXsO3d06ktAWqbNflv2vEmA38bTFTfJ2sbn2B5ksT52cDDbA= nocomment"},
|
||||||
keyTypeN, lengthN, errN := SSHNativeParsePublicKey(pubkey)
|
"ecdsa-384": {"ecdsa", 384, "ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBINmioV+XRX1Fm9Qk2ehHXJ2tfVxW30ypUWZw670Zyq5GQfBAH6xjygRsJ5wWsHXBsGYgFUXIHvMKVAG1tpw7s6ax9oA+dJOJ7tj+vhn8joFqT+sg3LYHgZkHrfqryRasQ== nocomment"},
|
||||||
if errN != nil {
|
"ecdsa-521": {"ecdsa", 521, "ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBACGt3UG3EzRwNOI17QR84l6PgiAcvCE7v6aXPj/SC6UWKg4EL8vW9ZBcdYL9wzs4FZXh4MOV8jAzu3KRWNTwb4k2wFNUpGOt7l28MztFFEtH5BDDrtAJSPENPy8pvPLMfnPg5NhvWycqIBzNcHipem5wSJFN5PdpNOC2xMrPWKNqj+ZjQ== nocomment"},
|
||||||
if errN != SSHUnknownKeyType {
|
}
|
||||||
t.Errorf("error parsing public key '%s': %s", name, errN)
|
|
||||||
continue
|
Convey("Parse public keys in both native and ssh-keygen", t, func() {
|
||||||
}
|
for name, key := range testKeys {
|
||||||
}
|
fmt.Println("\nTesting key:", name)
|
||||||
keyTypeK, lengthK, errK := SSHKeyGenParsePublicKey(pubkey)
|
|
||||||
if errK != nil {
|
keyTypeN, lengthN, errN := SSHNativeParsePublicKey(key.content)
|
||||||
t.Errorf("error parsing public key '%s': %s", name, errK)
|
So(errN, ShouldBeNil)
|
||||||
continue
|
So(keyTypeN, ShouldEqual, key.typeName)
|
||||||
}
|
So(lengthN, ShouldEqual, key.length)
|
||||||
// we know that ed25519 is currently not supported by native and returns SSHUnknownKeyType
|
|
||||||
if (keyTypeN != keyTypeK || lengthN != lengthK) && errN != SSHUnknownKeyType {
|
keyTypeK, lengthK, errK := SSHKeyGenParsePublicKey(key.content)
|
||||||
t.Errorf("key mismatch for '%s': native: %s(%d), ssh-keygen: %s(%d)", name, keyTypeN, lengthN, keyTypeK, lengthK)
|
So(errK, ShouldBeNil)
|
||||||
}
|
So(keyTypeK, ShouldEqual, key.typeName)
|
||||||
}
|
So(lengthK, ShouldEqual, key.length)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
+17
-17
@@ -282,7 +282,7 @@ func (fi bindataFileInfo) Sys() interface{} {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var _confAppIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x5a\x5b\x6f\xe3\x48\x76\x7e\xe7\xaf\xa8\xf1\x64\xd2\xdd\x01\x25\xf9\xd2\xee\xee\xf1\x8c\x37\x23\x4b\x94\xad\x6d\xdd\x86\x94\xbb\xa7\xa7\x61\xd0\xb4\x58\x92\x38\xa6\x48\x35\x8b\xb4\xdb\x83\x20\xd8\x41\x1e\x02\xe4\x35\x41\xf2\x12\x04\xc9\x43\x10\x60\x73\x41\x16\x79\xd9\x4d\x90\xa7\x41\xde\xbb\xff\xc3\x62\x36\xf9\x17\xf9\xce\xa9\xa2\x44\xb9\x3d\x4e\x16\x48\xe6\x62\x51\xc5\xaa\x53\x55\xe7\xf6\x7d\xa7\x4a\x1f\x8b\x81\xf3\xc2\x71\x05\xff\xe9\x0f\xdb\xdd\xce\x2b\x31\x3e\xe9\x7a\xa2\xd3\xed\x39\xd6\xc7\x62\xd4\x73\x9a\x9e\x23\xfa\xcd\xe7\x8e\x68\x9d\x34\x07\xc7\x8e\x27\x86\x03\xd1\x1a\xba\xae\xe3\x8d\x86\x83\x76\x77\x70\x2c\x5a\xa7\xde\x78\xd8\x47\xe3\xa0\xd3\x3d\xd6\x23\xad\xcf\x44\x73\xb9\x14\x49\xb0\x90\x22\x9f\x07\xb9\x50\xf3\xf4\x5a\x89\x34\x11\xf2\x4a\x66\x37\x62\x19\xcc\xf0\x22\xca\x63\x69\x35\x47\x23\x7f\xd0\xec\x3b\xe2\x50\x1c\xa7\x33\x75\x80\xbf\xe2\x38\xca\x85\x27\xb3\xab\x68\x22\x21\xa9\x35\x0f\x12\x74\x47\x5b\x34\x15\x37\x69\x21\xb2\x22\x11\x71\x3a\x09\xe2\xf8\xc6\x72\x4f\x07\xfe\xa9\x87\xd5\x1f\x8a\x59\x94\xa3\xb7\x13\xe5\x73\x99\x89\xad\x50\x5e\x6d\xd9\x62\x6b\x99\xa5\xe1\x96\x48\xd1\x90\x4b\x95\xa3\x25\x94\xd3\xa0\x88\x21\x4b\xe9\x3e\x2c\x01\x5b\xa7\x05\xe0\xbb\x65\xbd\xce\xe4\x32\x55\x51\x9e\x66\x37\x67\x96\x3b\x1c\x8e\xc5\xa1\xe5\xb5\xdc\xee\x68\xec\x8f\x5f\x8d\xa8\xdb\x45\xa0\xe6\x98\xa9\x6d\x24\x35\x07\x5e\x57\x4c\xe6\x41\xa6\x64\x6e\xd1\x17\x1f\xaa\x72\x3d\x07\x03\x05\xba\x75\xd2\x6c\x22\xcd\xbe\x13\x79\x2d\xd6\xe2\x45\x9e\x8a\x0b\x29\x96\x59\x74\x15\xe4\xd2\xea\x0c\xdd\x96\xe3\x8f\xdc\xee\x8b\xe6\x98\xa6\x99\x06\xb1\xa2\xfd\x1f\xc7\xe9\x45\x10\x8b\x45\xf0\x36\x5a\x14\x0b\x31\xc9\x64\x90\x47\x50\x65\x1c\x2d\xa0\x93\x74\x5a\x95\xb8\xc4\xd6\x0b\x25\x33\x5b\xd4\x76\xc4\x42\x06\x89\x12\x49\xaa\x7b\x5a\xfd\xe6\x57\x7e\xcb\x75\x9a\xe3\xee\x70\xe0\xf7\xba\xfd\x2e\x2d\xb0\xb6\x83\x19\x46\x41\x3e\x99\x0b\x52\x90\x78\x53\xc8\x42\x8a\x58\x26\xb3\x7c\x6e\x63\xce\x4b\x56\x7c\xa0\x44\x1c\x64\x30\x02\x1e\x30\x97\x8a\x2e\x60\xb9\xd1\x69\xaf\xe7\xbb\xce\x97\xa7\x8e\x37\xf6\xf1\xf7\xd4\xf1\x7b\xce\xe0\x78\x7c\x02\xb1\x3b\xdb\xf8\x07\xba\x2c\xa2\x33\xc8\x1f\x14\x8b\x0b\x2c\xac\xba\xd4\x48\x2a\xed\x19\x41\x26\xd9\x3b\x64\x28\xa2\x04\x1e\x02\x55\xbd\x5d\xc6\x29\x5a\xc9\x49\x2c\xe7\xab\x51\x6f\xe8\x42\x2d\xcd\x63\xf8\x9a\x3f\x38\xed\x43\xfa\xee\xf6\x86\xd0\x48\xa9\xe2\xc7\xc5\xb1\x98\xae\xe7\x9d\xde\x12\xb2\xb3\x29\x64\xa5\xde\x74\x01\x65\xa9\x5b\x42\x82\x49\x1e\x5d\x45\xf9\x8d\x98\x4a\x19\x5a\x1d\xc7\x69\xfb\xac\xce\x61\x1f\x6a\x34\x02\xf7\x21\xef\x45\x10\x43\x7d\x10\x77\x0e\x2f\x5c\xc8\xda\x24\xc5\x56\xce\x61\x89\x3c\x10\x79\x30\xb3\xc9\x38\xa1\xb8\xb8\x11\xcd\x24\xcc\xd2\x28\x14\x3f\xc1\xb8\x3a\xad\xa4\x99\x60\xae\xab\x20\x46\x1b\x0f\x82\xd1\xa0\xfb\xad\x04\xb3\x6b\xff\x0d\x23\x15\x40\xed\x5b\xe2\x3a\x8a\x63\x31\x0f\xae\x28\xb4\xe4\xca\x9f\x55\x7e\x13\x93\xb7\xf4\x49\x75\x51\x32\x4d\x0f\xc4\x3c\xcf\x97\xea\xa0\xd1\x80\x5b\xcb\x38\x85\x6b\xa8\xfa\x2c\x4d\x67\xb1\xac\x63\x93\x8d\x6b\x79\xd1\x28\x96\x21\x3c\x4f\x35\x76\xb7\x77\x1e\x37\x76\x76\x1a\x5e\xb1\x5c\xa6\x59\x5e\x9b\xa6\x59\xad\xb2\x81\x5a\x94\xd4\x5a\xf3\x2c\xc5\xf7\xbd\x4f\xf9\xa5\x59\xbe\x35\x3e\x71\xfa\x0e\xd4\x00\x1b\xf9\x7d\x67\xdc\xf4\xc7\xcd\x63\xa8\xe2\xfc\xe3\xe9\x74\x7f\xef\xf1\xde\x39\xbb\x40\x3d\x08\x17\x51\xb2\xe9\x08\xe4\xa4\xf7\x9b\x8c\xa2\x7a\xd3\x62\xfb\xdb\x1f\xfa\xd2\xbd\x22\x5c\x67\x34\xbc\x57\x44\x92\xe6\xc8\x31\xf7\x0b\x19\x0c\xc7\xdd\xd6\x6d\x07\xdc\xdf\x10\x93\x66\xb3\x20\x89\xbe\xd5\x61\x79\x9f\xac\xa1\x7b\xfc\xc1\x7a\xac\xd7\x8b\x20\xbb\x0c\xd3\x6b\xd6\x90\x93\x90\x91\x61\xde\x2c\x84\x07\x60\xdc\x05\xc2\xfd\x12\x31\x91\xcb\x44\x41\xbc\xe5\x0c\x9a\x47\x3d\xc7\x47\x86\x69\x23\x88\x07\x8e\x7f\x84\x90\x7e\x5e\x49\x17\xbd\x48\x71\x56\x98\x14\x2a\x4f\x17\xe2\xd4\xed\xd5\xbc\x09\xd9\xb2\xb2\x4d\xa4\x4e\x5e\x1b\xc5\x75\x94\x5c\x2a\x71\x3d\x97\x09\x14\x9a\x84\x32\x8b\x92\x99\xe8\x9b\x15\x41\x1c\xac\x8d\xd9\x83\xc5\x12\xab\x42\x86\xb5\x17\xc1\x2c\x41\x9e\xd3\x49\xdf\x87\x74\xdf\x6b\x91\x13\x78\x48\x93\xd6\x6b\x58\x15\x89\xee\xcc\x1a\xb9\xc3\xf1\x10\x6e\x81\x75\x91\x17\x5a\xed\x61\xbf\xd9\x1d\xe0\x1b\xe7\xed\x79\xaa\x72\x4e\xad\x34\x1e\x8d\x9f\x3c\x2c\xfb\x3f\x22\x7f\xfd\xe4\xa1\xee\x8e\x2f\x9f\x3c\x3c\x19\x8f\x47\xfe\x68\xe8\x8e\x1f\xa9\x86\xc5\x5f\x9a\xed\x36\xd2\xbd\xb5\x7a\x01\x01\x7b\x94\x6d\xb0\x75\x12\x2e\x1e\xb6\xfb\x5f\x3f\xa2\x7d\xf3\xda\x09\x54\xc4\x75\x9a\x5d\x92\xbf\x3d\x54\x05\x12\x1d\x76\xed\x79\x27\x42\x3b\xff\x23\xc4\x36\x5c\x40\xd1\xb6\x11\x12\x42\x69\xdc\xa9\x43\x5c\x37\x11\x0b\xac\x54\x4c\x02\x05\xe5\x11\xf2\x84\x29\xb9\x0c\xd2\x38\x74\x87\xe4\x3d\xd1\xc8\x54\x0d\xc3\x2b\x4a\x00\x34\xb8\x19\xe7\x70\x0e\x4a\xd0\x49\x7c\x63\x90\x2b\xe3\x79\xb5\x8e\x20\x28\x94\x84\x42\x24\x90\x24\x28\x02\x4b\x2c\x8d\xf6\xc5\x2f\xeb\x56\x6f\xd8\x6a\x22\xc5\xae\x15\x45\xba\x84\x82\x56\x4a\xbc\xad\x1f\x80\x92\xce\x12\x3c\xd1\x14\x40\x51\xc0\xda\x6c\x5c\x9a\x26\xb8\x0a\xa2\x98\x5e\x5b\xed\xae\xc7\x6e\x44\xdd\xd6\xae\xf3\x72\x2e\x19\x3c\x11\x9c\xe2\xa2\x88\xe2\x1c\xbe\x5b\x59\Line truncated
|
var _confAppIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x5a\x5b\x6f\xe3\x48\x76\x7e\xe7\xaf\xa8\xf1\x64\xd2\xee\x40\x17\xcb\x6e\x77\xf7\x78\xd7\x9b\x91\x25\xca\xd6\xb6\x6e\x43\x4a\xdd\xd3\xd3\x30\x68\x5a\x2c\x49\x1c\x53\xa4\x9a\x45\xda\xed\x41\x10\xec\x20\x0f\x01\xf2\x9a\x20\x79\x09\x82\xe4\x21\x08\xb0\xb9\x20\x8b\xbc\xec\x26\xc8\xd3\x20\xef\x3d\xff\x61\x31\x9b\xfc\x8b\x7c\xe7\x54\x51\xa2\xdc\x1e\x27\x0b\x24\x73\xb1\x78\xa9\x3a\x75\xce\xa9\x73\xf9\xce\x29\x7e\x2c\x06\xf6\x4b\xdb\x11\xfc\xa7\x3f\x6c\x77\x3b\xaf\xc5\xf8\xac\xeb\x8a\x4e\xb7\x67\x5b\x1f\x8b\x51\xcf\x6e\xba\xb6\xe8\x37\x5f\xd8\xa2\x75\xd6\x1c\x9c\xda\xae\x18\x0e\x44\x6b\xe8\x38\xb6\x3b\x1a\x0e\xda\xdd\xc1\xa9\x68\x4d\xdc\xf1\xb0\x8f\x87\x83\x4e\xf7\x54\xcf\xb4\x7e\x24\x9a\xab\x95\x88\xfd\xa5\x14\xd9\xc2\xcf\x84\x5a\x24\x37\x4a\x24\xb1\x90\xd7\x32\xbd\x15\x2b\x7f\x8e\x17\x61\x16\x49\xab\x39\x1a\x79\x83\x66\xdf\x16\xc7\xe2\x34\x99\xab\x23\xfc\x15\xa7\x61\x26\x5c\x99\x5e\x87\x53\x09\x4a\xad\x85\x1f\x63\x38\x9e\x85\x33\x71\x9b\xe4\x22\xcd\x63\x11\x25\x53\x3f\x8a\x6e\x2d\x67\x32\xf0\x26\x2e\xb8\x3f\x16\xf3\x30\xc3\x68\x3b\xcc\x16\x32\x15\x3b\x81\xbc\xde\xa9\x88\x9d\x55\x9a\x04\x3b\x22\xc1\x83\x4c\xaa\x0c\x4f\x02\x39\xf3\xf3\x08\xb4\x94\x1e\xc3\x14\x20\x3a\x31\x80\x7b\xcb\x7a\x93\xca\x55\xa2\xc2\x2c\x49\x6f\xcf\x2d\x67\x38\x1c\x8b\x63\xcb\x6d\x39\xdd\xd1\xd8\x1b\xbf\x1e\xd1\xb0\x4b\x5f\x2d\xb0\x52\xdb\x50\x6a\x0e\xdc\xae\x98\x2e\xfc\x54\xc9\xcc\xa2\x1b\x0f\xaa\x72\x5c\x1b\x13\x05\x86\x75\x92\x74\x2a\x8d\xdc\xb1\xbc\x11\x1b\xf2\x22\x4b\xc4\xa5\x14\xab\x34\xbc\xf6\x33\x69\x75\x86\x4e\xcb\xf6\x46\x4e\xf7\x65\x73\x4c\xcb\xcc\xfc\x48\x91\xfc\xa7\x51\x72\xe9\x47\x62\xe9\xbf\x0b\x97\xf9\x52\x4c\x53\xe9\x67\x21\x54\x19\x85\x4b\xe8\x24\x99\x95\x29\xae\x20\x7a\xae\x64\x5a\x11\xd5\x86\x58\x4a\x3f\x56\x22\x4e\xf4\x48\xab\xdf\xfc\xc2\x6b\x39\x76\x73\xdc\x1d\x0e\xbc\x5e\xb7\xdf\x25\x06\xab\x0d\xac\x30\xf2\xb3\xe9\x42\x90\x82\xc4\xdb\x5c\xe6\x52\x44\x32\x9e\x67\x8b\x0a\xd6\xbc\x62\xc5\xfb\x4a\x44\x7e\x8a\x4d\xc0\x05\xd6\x52\xe1\x25\x76\x6e\x34\xe9\xf5\x3c\xc7\xfe\x7c\x62\xbb\x63\x0f\x7f\x27\xb6\xd7\xb3\x07\xa7\xe3\x33\x90\x6d\xec\xe1\x1f\xe8\x32\x0f\xcf\x41\x7f\x90\x2f\x2f\xc1\x58\x99\xd5\x50\x2a\x6d\x19\x7e\x2a\xd9\x3a\x64\x20\xc2\x18\x16\x02\x55\xbd\x5b\x45\x09\x9e\x92\x91\x58\xf6\x17\xa3\xde\xd0\x81\x5a\x9a\xa7\xb0\x35\x6f\x30\xe9\x83\xfa\xfe\xde\x16\xd1\x50\xa9\xfc\x87\xc9\x31\x99\xae\xeb\x4e\xee\x10\x69\x6c\x13\x59\xab\x37\x59\x42\x59\xea\x0e\x11\x7f\x9a\x85\xd7\x61\x76\x2b\x66\x52\x06\x56\xc7\xb6\xdb\x1e\xab\x73\xd8\x87\x1a\x0d\xc1\x43\xd0\x7b\xe9\x47\x50\x1f\xc8\x5d\xc0\x0a\x97\xb2\x3a\x4d\x20\xca\x05\x76\x22\xf3\x45\xe6\xcf\x2b\xb4\x39\x81\xb8\xbc\x15\xcd\x38\x48\x93\x30\x10\x3f\xc1\xbc\x1a\x71\xd2\x8c\xb1\xd6\xb5\x1f\xe1\x19\x4f\xc2\xa6\x41\xf7\x3b\x31\x56\xd7\xf6\x1b\x84\xca\x87\xda\x77\xc4\x4d\x18\x45\x62\xe1\x5f\x93\x6b\xc9\xb5\x3d\xab\xec\x36\x22\x6b\xe9\x93\xea\xc2\x78\x96\x1c\x89\x45\x96\xad\xd4\x51\xbd\x0e\xb3\x96\x51\x02\xd3\x50\xb5\x79\x92\xcc\x23\x59\x83\x90\xf5\x1b\x79\x59\xcf\x57\x01\x2c\x4f\xd5\xf7\xf7\x1a\x4f\xea\x8d\x46\xdd\xcd\x57\xab\x24\xcd\xaa\xb3\x24\xad\x96\x04\xa8\x86\x71\xb5\xb5\x48\x13\xdc\x1f\x7c\xca\x2f\x0d\xfb\xd6\xf8\xcc\xee\xdb\x50\x03\xf6\xc8\xeb\xdb\xe3\xa6\x37\x6e\x9e\x42\x15\x17\x1f\xcf\x66\x87\x07\x4f\x0e\x2e\xd8\x04\x6a\x7e\xb0\x0c\xe3\x6d\x43\x20\x23\x7d\x78\xcb\xc8\xab\xb7\x77\xec\x70\xef\x43\x5b\x7a\x90\x84\x63\x8f\x86\x0f\x92\x88\x93\x0c\x31\xe6\x61\x22\x83\xe1\xb8\xdb\xba\x6b\x80\x87\x5b\x64\x92\x74\xee\xc7\xe1\xd7\xda\x2d\x1f\xa2\x35\x74\x4e\x3f\xe0\xc7\x7a\xb3\xf4\xd3\xab\x20\xb9\x61\x0d\xd9\x31\x6d\x32\xb6\x37\x0d\x60\x01\x98\x77\x09\x77\xbf\x82\x4f\x64\x32\x56\x20\x6f\xd9\x83\xe6\x49\xcf\xf6\x10\x61\xda\x70\xe2\x81\xed\x9d\xc0\xa5\x5f\x94\xc2\x45\x2f\x54\x1c\x15\xa6\xb9\xca\x92\xa5\x98\x38\xbd\xaa\x3b\xa5\xbd\x2c\x89\x89\xd0\xc9\xbc\x91\x5f\x87\xf1\x95\x12\x37\x0b\x19\x43\xa1\x71\x20\xd3\x30\x9e\x8b\xbe\xe1\x08\xe4\xb0\xdb\x58\xdd\x5f\xae\xc0\x15\x22\x6c\x65\xe9\xcf\x63\xc4\x39\x1d\xf4\x3d\x50\xf7\xdc\x16\x19\x81\x8b\x30\x69\xbd\xc1\xae\x22\xd0\x9d\x5b\x23\x67\x38\x1e\xc2\x2c\xc0\x17\x59\xa1\xd5\x1e\xf6\x9b\xdd\x01\xee\x38\x6e\x2f\x12\x95\x71\x68\xa5\xf9\x78\xf8\xc9\x6e\x31\xfe\x31\xd9\xeb\x27\xbb\x7a\x38\x6e\x3e\xd9\x3d\x1b\x8f\x47\xde\x68\xe8\x8c\x1f\xab\xba\xc5\x37\xcd\x76\x1b\xe1\xde\x5a\xbf\x00\x81\x03\x8a\x36\x10\x9d\x88\x8b\xdd\x76\xff\xcb\xc7\x24\x37\xf3\x4e\x49\x45\xdc\x24\xe9\x15\xd9\xdb\xae\xca\x11\xe8\x20\xb5\xeb\x9e\x09\x6d\xfc\x8f\xe1\xdb\x30\x01\x45\x62\xc3\x25\x84\xd2\x79\xa7\x06\x72\xdd\x58\x2c\xc1\xa9\x98\xfa\x0a\xca\xa3\xcc\x13\x24\x64\x32\x08\xe3\xd0\x1d\x82\xf7\x54\x67\xa6\xb2\x1b\x5e\x53\x00\xa0\xc9\xcd\x28\x83\x71\x50\x80\x8e\xa3\x5b\x93\xb9\x52\x5e\x57\xeb\x08\x84\x02\x49\x59\x88\x08\x12\x05\x45\xc9\x12\xac\x91\x5c\xfc\xb2\x66\xf5\x86\xad\x26\x42\xec\x46\x51\xa4\x4b\x28\x68\xad\xc4\xbb\xfa\x41\x52\xd2\x51\x82\x17\x9a\x21\x51\xe4\xd8\x6d\xde\x5c\x5a\xc6\xbf\xf6\xc3\x88\x5e\x5b\xed\xae\xcb\x66\x44\xc3\x36\xa6\xf3\x6a\x21\x39\x79\xc2\x39\xc5\x65\x1e\x46\x19\x6c\xb7\xc4\x71\x42\Line truncated
|
||||||
|
|
||||||
func confAppIniBytes() ([]byte, error) {
|
func confAppIniBytes() ([]byte, error) {
|
||||||
return bindataRead(
|
return bindataRead(
|
||||||
@@ -297,7 +297,7 @@ func confAppIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/app.ini", size: 10570, mode: os.FileMode(420), modTime: time.Unix(1456377168, 0)}
|
info := bindataFileInfo{name: "conf/app.ini", size: 11094, mode: os.FileMode(420), modTime: time.Unix(1456619628, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4297,7 +4297,7 @@ func confLocaleLocale_bgBgIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_bg-BG.ini", size: 75966, mode: os.FileMode(493), modTime: time.Unix(1456312008, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_bg-BG.ini", size: 75966, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4317,12 +4317,12 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_de-DE.ini", size: 52899, mode: os.FileMode(493), modTime: time.Unix(1456312010, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_de-DE.ini", size: 52899, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\xbd\xed\x72\x1c\x47\xae\x26\xfc\xbf\xae\xa2\xac\x09\x85\xac\x08\xaa\x1d\x1e\x9f\xf7\xdd\x0d\x87\x65\xaf\x24\x5a\x1f\xe7\x88\x22\x8f\x48\x79\x76\xd6\xa1\x68\x57\x77\x17\x9b\x35\xea\xae\xea\xa9\xaa\x16\x45\x4f\xcc\x1d\xec\x05\xec\xf5\xed\x95\x2c\xf0\x00\xc8\x44\x56\x55\x93\x92\xe7\xe8\x87\x58\x9d\x89\xfc\x46\x22\x01\x24\x80\x2c\x76\xbb\xf9\xaa\xec\x96\xf9\xe3\xfc\x49\xbe\x2b\xaa\x7a\x53\x76\x5d\xde\x95\x9b\xcb\x47\x57\x4d\xd7\x97\xab\xfc\x45\xd5\xd3\xef\xf6\x63\xb5\x2c\xb3\xec\xaa\xd9\x96\x04\xfa\x92\xfe\x64\xab\xa2\xbb\x5a\x34\x45\xbb\xa2\x84\x63\xfb\xce\xca\x4f\xbb\x4d\xd3\x32\xd0\xcf\xf2\x95\x5d\x95\x9b\x1d\x97\xa1\x3f\x59\x57\xad\xeb\x79\x55\xd3\xcf\x73\xfa\xca\x5f\xd5\x92\xd2\xec\x7b\x4b\x3a\xdd\xf7\x92\xb6\xdf\x59\xd2\xbb\x5d\xd6\x96\xeb\x8a\x7a\xd3\x52\xd2\x5b\xfd\xcc\xae\xcb\x45\x57\xf5\xdc\xd2\x5f\xe4\x2b\xfb\x58\xb6\x5d\xd5\x70\xed\xbf\xc8\x57\xb6\x2b\xd6\x0c\x70\x46\x7f\xb2\xbe\xdc\xee\x36\x05\x0a\x5c\xe8\x67\xb6\x29\xea\xf5\x5e\x60\x5e\xeb\x67\xb6\x6c\x4b\xca\x9a\xd7\xe5\x35\xa5\x3e\xc3\x8f\xd9\x6c\x96\xed\x69\x12\xe6\xbb\xb6\xb9\xac\x36\xe5\xbc\xa8\x57\xf3\xad\x0c\xf3\x1d\xa5\xe7\x9a\x9e\x53\x7a\xce\xe9\x18\x42\xb9\xa2\xa1\xce\x8b\x4e\xc7\x41\x73\x49\x23\x2f\xba\x0c\x55\xd5\xc5\xd6\x4a\xf3\x67\x56\x6e\x8b\x6a\xc3\xb3\xc6\x7f\xa9\xdf\x5d\x77\xdd\x60\x6a\xcf\xf4\x93\xe6\x60\xde\xdf\xec\x4a\x4c\xc1\xa3\x0b\xfa\xca\x96\xc5\xae\x5f\x5e\x15\xdc\x4d\xf9\xca\x08\x68\xd7\xd0\x5c\x34\xed\x0d\xe0\xec\x47\xd6\xb4\xeb\xa2\xae\x7e\x2f\x7a\x99\x9f\x53\xf7\x33\xdb\x56\x6d\xdb\xf0\xd4\x9e\xe0\x23\xa3\x91\xcf\xb9\x1e\x4a\x79\x43\x93\xe0\x6a\xe1\x9c\x6d\xb5\x6e\x65\x16\x39\xf3\x04\xbf\xb8\x16\xc9\xd3\x9a\x24\x2b\xd4\x76\xd9\xb4\x1f\x34\xf5\x39\x7f\x0e\xaa\xa4\xce\x69\x6e\xda\xaf\xa2\xa6\xf5\xd0\xdc\x13\xfc\x48\x00\xba\xac\x58\x6d\x69\x86\x77\x45\x5d\xf2\xd4\x3d\xe1\x5f\x34\x5f\xf4\x2b\x2b\x96\xcb\x66\x5f\xf7\xf3\xae\xec\xfb\xaa\x5e\xf3\x1a\x3c\x91\xa4\xfc\x5c\x93\x32\x97\x17\xd2\x6e\x9a\x7d\x58\x65\x4a\xff\x2b\xfd\xcc\xcf\xe4\xa7\xe4\xb9\x42\xc8\x0c\x25\xa9\xc9\xbe\xfa\x58\xf5\x55\x29\x8d\xd9\x8f\x6c\xb7\xdf\x6c\x68\x3e\xff\xbe\x2f\xbb\x9e\xb3\xce\xe8\x37\xcd\x80\xfc\xce\xaa\xae\xdb\xa3\xc4\x2b\x7c\x64\xb4\xa8\xf5\x12\xc3\x79\x86\x8f\x2c\xfb\xb5\x2b\x8b\x76\x79\xf5\x3e\x93\xbf\xe8\x2d\x7f\x30\x52\x1e\x5a\x6e\xc6\x30\xc5\x2e\x69\xc1\x1a\xc8\x96\xcd\x8a\x7f\x3c\xa3\x3f\x54\x75\x55\x77\x7d\xb1\xd9\xbc\xcf\xf4\x83\xc1\xe4\x4b\x96\xa0\xaf\x7a\xcc\x83\x26\xe6\xe7\x7d\xb9\xeb\x78\x0d\xf3\xe7\x55\xdb\xf5\x8f\xfa\x8a\xb0\xf8\xed\xbe\xce\x56\xcd\xf2\x03\xed\x0f\xde\xeb\x68\xf9\xd5\x65\x4e\xd3\xf5\x80\x76\x48\xbb\xaf\x6b\x9a\xa0\xfc\x45\x43\x93\x46\xcd\x54\xd4\xfe\x31\xa0\x8f\xf2\xdd\xa6\x2c\x3a\x02\x29\x8b\x55\xfe\x43\x91\xf7\x45\xbb\x2e\xfb\xc7\xf7\xe6\x0b\xda\x97\x1f\xee\xe5\x57\x6d\x79\xf9\xf8\xde\xfd\xee\xde\x8f\x2f\xf6\x54\x6c\x53\xd5\x65\xf7\xc3\x37\xc5\x8f\xf9\xb2\xa0\x1c\x9a\xc6\x9b\x7c\x51\x5e\xf2\x36\xa4\xb6\x72\xc2\xff\x7a\xcd\x5b\xf0\xa6\xbf\xe2\x06\x09\x17\xe8\xa3\xcb\x99\x06\x7c\x95\xf1\x02\x10\x8d\x98\xaf\x16\x46\xef\xd0\x21\x24\xb7\xb4\x00\x27\x37\xe7\xff\xf9\xfa\x28\x3f\x23\xa2\xb7\x6e\x4b\x7c\xd3\x7f\x54\xe2\xbb\x9c\x46\x7b\x51\x1d\x3f\x9d\x65\x54\xd6\x26\xe4\xb8\xe8\x8b\x05\xf7\x3d\xac\x3f\x67\xca\xf6\x0c\x79\xd8\xa4\x4c\x46\x41\x32\xbb\x3e\x59\x96\xa9\x2d\x4e\x75\x28\x5d\x08\x75\xbc\x61\xe2\x40\xe9\x61\x66\xcf\x64\xce\xa8\xaa\xfc\xd5\x9b\x37\xa7\xc7\x4f\xf3\xb2\x5e\xd3\xcc\xe4\xd7\x55\x7f\x95\xef\xfb\xcb\xff\x3e\x5f\x97\x75\xd9\x16\x9b\xf9\xb2\xe2\x49\x69\x09\x65\x73\x9a\x25\x19\xe2\x2c\xeb\xba\x0d\xd1\x2e\x60\xc1\xf9\xf9\xeb\xfc\x84\x31\x61\x57\xf4\x57\xe8\x48\x7f\x95\x75\x7f\xdf\xf0\x44\x85\x06\x2f\xae\xca\x1c\xdb\x01\x40\xcd\xe5\x70\x5e\xf2\x95\xf6\x75\x96\xff\xb0\x68\x7f\x74\xfd\x2b\x16\x5d\xb3\xd9\xf7\x5a\xf2\xfa\xaa\xac\xb1\x50\x84\x4a\x6d\x4f\x84\xd0\x8e\x95\x59\x56\xb6\xed\x9c\x48\x72\x7f\xc3\xcb\xa3\x7d\x39\xd4\x8a\x54\x46\xbb\xa4\x6e\x7a\x5a\xfe\x1c\xe5\xa4\x8a\xaa\xfe\x58\x6c\xaa\x15\x2d\x52\x9c\xc8\xb4\x2c\x12\x57\x0d\xad\x37\x97\x26\x8c\x6e\xae\x31\x45\xb4\x77\xe9\xc4\xc8\xef\xcd\xee\x81\x84\xdf\x7b\x74\x6f\x96\xd5\xcd\x5c\xe8\x0b\x13\xfb\x55\xd5\x15\x0b\x22\xfc\x72\x10\xb5\x46\x47\xff\xca\x78\x27\x5d\x51\x88\x3c\x81\xe0\x35\xe1\xc3\x0d\x67\x0a\x23\x65\x41\x27\x00\xc8\x94\x12\x28\x3f\x76\xa3\x66\x01\x2f\x84\xa0\x85\x84\xd1\x98\x33\x5b\x68\xc3\xca\x27\xbb\xdd\xa6\x5a\x4a\xd3\x2f\x24\x2f\x22\x28\x1f\xf5\x3a\x29\x1e\x0e\x08\x66\x79\x0e\xcd\xa8\xd7\x4c\xf0\xf2\xe4\xe4\x40\xf9\xab\x92\x76\xdc\xd5\x7e\x2d\xc7\xdd\xa6\xd9\xaf\xbe\x02\x21\xb2\x95\x8b\x74\x28\x7f\xdb\x50\x87\x81\x55\x01\x20\x36\xf1\x84\x08\x0a\x73\x17\x6d\xb9\x6d\x7a\x9e\x38\x2d\xc6\x14\xf4\xba\xa2\x4c\x1a\x69\x57\x7c\xa4\x73\xb3\x6f\x64\x2b\xaf\x68\xab\x2e\xb9\x62\xa2\x7c\x7b\x62\x11\x64\x3b\x11\xfd\x91\x2d\x65\x69\x29\xee\x02\x6a\xbb\xa7\x5d\x78\x45\x95\xf1\xc4\x33\x8b\x43\x55\x4e\xf5\x13\x43\xa2\x7a\x40\x1d\x68\xc7\x37\x74\x1c\xf3\x42\x1f\xe3\x43\x7f\xfb\xfa\xa9\x57\xc5\xe5\x25\xf5\xaa\xa3\xdd\xf4\x32\x5f\x6e\x1a\xda\x8a\xef\xde\xbe\xee\x78\xa3\x5Line truncated
|
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\xbd\xeb\x72\xdc\x48\xae\x27\xfe\x9d\x4f\xc1\xf6\x84\xc3\x76\x84\x5c\x8e\xee\x3e\xff\xff\x6e\x74\xb4\xdd\x2b\x4b\xed\xcb\x1c\xcb\xd2\x48\x72\xf7\xce\x76\x38\xd8\xac\x22\x55\xc5\x71\x15\x59\x43\xb2\x24\x6b\x26\xe6\x0d\xf6\x01\xf6\xf9\xf6\x49\x16\xf8\x01\xc8\x0b\xc9\x92\xec\x9e\xe3\x0f\x16\x2b\x13\x79\x47\x22\x01\x24\x80\xcc\xb7\xdb\xac\x28\xbb\x45\xfa\x3c\x3d\x4c\xb7\x79\x55\xaf\xcb\xae\x4b\xbb\x72\x7d\xf5\x74\xd5\x74\x7d\x59\xa4\xaf\xab\x9e\x7e\xb7\xd7\xd5\xa2\x4c\x92\x55\xb3\x29\x09\xf4\x0d\xfd\x49\x8a\xbc\x5b\xcd\x9b\xbc\x2d\x28\xe1\xd8\xbe\x93\xf2\xf3\x76\xdd\xb4\x0c\xf4\xb3\x7c\x25\xab\x72\xbd\xe5\x32\xf4\x27\xe9\xaa\x65\x9d\x55\x35\xfd\xbc\xa0\xaf\xf4\x6d\x2d\x29\xcd\xae\xb7\xa4\xd3\x5d\x2f\x69\xbb\xad\x25\x7d\xd8\x26\x6d\xb9\xac\xa8\x37\x2d\x25\x9d\xeb\x67\x72\x53\xce\xbb\xaa\xe7\x96\x7e\x95\xaf\xe4\xba\x6c\xbb\xaa\xe1\xda\x7f\x91\xaf\x64\x9b\x2f\x19\xe0\x8c\xfe\x24\x7d\xb9\xd9\xae\x73\x14\xb8\xd4\xcf\x64\x9d\xd7\xcb\x9d\xc0\xbc\xd3\xcf\x64\xd1\x96\x94\x95\xd5\xe5\x0d\xa5\x1e\xe1\xc7\x6c\x36\x4b\x76\x34\x09\xd9\xb6\x6d\xae\xaa\x75\x99\xe5\x75\x91\x6d\x64\x98\x1f\x28\x3d\xd5\xf4\x94\xd2\x53\x4e\xc7\x10\xca\x82\x86\x9a\xe5\x9d\x8e\x83\xe6\x92\x46\x9e\x77\x09\xaa\xaa\xf3\x8d\x95\xe6\xcf\xa4\xdc\xe4\xd5\x9a\x67\x8d\xff\x52\xbf\xbb\xee\xa6\xc1\xd4\x9e\xe9\x27\xcd\x41\xd6\xdf\x6e\x4b\x4c\xc1\xd3\x4b\xfa\x4a\x16\xf9\xb6\x5f\xac\x72\xee\xa6\x7c\x25\x04\xb4\x6d\x68\x2e\x9a\xf6\x16\x70\xf6\x23\x69\xda\x65\x5e\x57\xff\xc8\x7b\x99\x9f\xd3\xe0\x67\xb2\xa9\xda\xb6\xe1\xa9\x3d\xc1\x47\x42\x23\xcf\xb8\x1e\x4a\x79\x4f\x93\x10\xd4\xc2\x39\x9b\x6a\xd9\xca\x2c\x72\xe6\x09\x7e\x71\x2d\x92\xa7\x35\x49\x96\xab\xed\xaa\x69\x3f\x69\xea\x2b\xfe\x1c\x54\x49\x9d\xd3\xdc\xb8\x5f\x79\x4d\xeb\xa1\xb9\x27\xf8\x11\x01\x74\x49\x5e\x6c\x68\x86\xb7\x79\x5d\xf2\xd4\x1d\xf2\x2f\x9a\x2f\xfa\x95\xe4\x8b\x45\xb3\xab\xfb\xac\x2b\xfb\xbe\xaa\x97\xbc\x06\x87\x92\x94\x5e\x68\x52\x12\xe4\xb9\xb4\xdb\x66\xe7\x56\x99\xd2\xff\x4a\x3f\xd3\x33\xf9\x29\x79\x41\x21\x64\xba\x92\xd4\x64\x5f\x5d\x57\x7d\x55\x4a\x63\xf6\x23\xd9\xee\xd6\x6b\x9a\xcf\xbf\xef\xca\xae\xe7\xac\x33\xfa\x4d\x33\x20\xbf\x93\xaa\xeb\x76\x28\xf1\x16\x1f\x09\x2d\x6a\xbd\xc0\x70\x8e\xf0\x91\x24\xbf\x75\x65\xde\x2e\x56\x1f\x13\xf9\x8b\xde\xf2\x07\x23\xe5\xbe\xe5\x66\x0c\x53\xec\x92\x16\xac\x81\x64\xd1\x14\xfc\xe3\x88\xfe\x50\xd5\x55\xdd\xf5\xf9\x7a\xfd\x31\xd1\x0f\x06\x93\x2f\x59\x82\xbe\xea\x31\x0f\x9a\x98\x5e\xf4\xe5\xb6\xe3\x35\x4c\x5f\x55\x6d\xd7\x3f\xed\x2b\xc2\xe2\xf3\x5d\x9d\x14\xcd\xe2\x13\xed\x0f\xde\xeb\x68\xf9\xed\x55\x4a\xd3\xf5\x88\x76\x48\xbb\xab\x6b\x9a\xa0\xf4\x75\x43\x93\x46\xcd\x54\xd4\xfe\x31\xa0\x0f\xd2\xed\xba\xcc\x3b\x02\x29\xf3\x22\xfd\x31\x4f\xfb\xbc\x5d\x96\xfd\xf3\x07\xd9\x9c\xf6\xe5\xa7\x07\xe9\xaa\x2d\xaf\x9e\x3f\x78\xd8\x3d\x78\xf1\x7a\x47\xc5\xd6\x55\x5d\x76\x3f\x3e\xcb\x5f\xa4\x8b\x9c\x72\x68\x1a\x6f\xd3\x79\x79\xc5\xdb\x90\xda\x4a\x09\xff\xeb\x25\x6f\xc1\xdb\x7e\xc5\x0d\x12\x2e\xd0\x47\x97\x32\x0d\xf8\x26\xe1\x05\x20\x1a\x91\x15\x73\xa3\x77\xe8\x10\x92\x5b\x5a\x80\x93\xdb\x8b\xbf\xbc\x3b\x48\xcf\x88\xe8\x2d\xdb\x12\xdf\xf4\x1f\x95\xf8\x3e\xa5\xd1\x5e\x56\xc7\x2f\x67\x09\x95\xb5\x09\x39\xce\xfb\x7c\xce\x7d\x77\xeb\xcf\x99\xb2\x3d\x5d\x1e\x36\x29\x93\x51\x90\xcc\xae\x8f\x96\x65\x6a\x8b\x53\x1d\x4a\x17\x5c\x1d\xef\x99\x38\x50\xba\x9b\xd9\x33\x99\x33\xaa\x2a\x7d\xfb\xfe\xfd\xe9\xf1\xcb\xb4\xac\x97\x34\x33\xe9\x4d\xd5\xaf\xd2\x5d\x7f\xf5\xdf\xb3\x65\x59\x97\x6d\xbe\xce\x16\x15\x4f\x4a\x4b\x28\x9b\xd2\x2c\xc9\x10\x67\x49\xd7\xad\x89\x76\x01\x0b\x2e\x2e\xde\xa5\x27\x8c\x09\xdb\xbc\x5f\xa1\x23\xfd\x2a\xe9\xfe\xbe\xe6\x89\x72\x0d\x5e\xae\xca\x14\xdb\x01\x40\xcd\xd5\x70\x5e\xd2\x42\xfb\x3a\x4b\x7f\x9c\xb7\x2f\x82\xfe\xe5\xf3\xae\x59\xef\x7a\x2d\x79\xb3\x2a\x6b\x2c\x14\xa1\x52\xdb\x13\x21\xb4\x63\x65\x96\x94\x6d\x9b\x11\x49\xee\x6f\x79\x79\xb4\x2f\xfb\x5a\x91\xca\x68\x97\xd4\x4d\x4f\xcb\x9f\xa2\x9c\x54\x51\xd5\xd7\xf9\xba\x2a\x68\x91\xfc\x44\xc6\x65\x91\x58\x34\xb4\xde\x5c\x9a\x30\xba\xb9\xc1\x14\xd1\xde\xa5\x13\x23\x7d\x30\x7b\x00\x12\xfe\xe0\xe9\x83\x59\x52\x37\x99\xd0\x17\x26\xf6\x45\xd5\xe5\x73\x22\xfc\x72\x10\xb5\x46\x47\xff\xca\x78\x27\x5d\x51\x88\x34\x82\xe0\x35\xe1\xc3\x0d\x67\x0a\x23\x65\x4e\x27\x00\xc8\x94\x12\xa8\x70\xec\x46\xcd\x1c\x5e\x08\x41\x73\x09\xa3\x31\x27\xb6\xd0\x86\x95\x87\xdb\xed\xba\x5a\x48\xd3\xaf\x25\xcf\x23\x28\x1f\xf5\x3a\x29\x21\x1c\x10\xcc\xf2\x02\x34\xa3\x5e\x33\xc1\x4b\xa3\x93\x03\xe5\x57\x25\xed\xb8\xd5\x6e\x29\xc7\xdd\xba\xd9\x15\xdf\x80\x10\xd9\xca\x79\x3a\x94\x9e\x37\xd4\x61\x60\x95\x03\xf0\x4d\x1c\x12\x41\x61\xee\xa2\x2d\x37\x4d\xcf\x13\xa7\xc5\x98\x82\xde\x54\x94\x49\x23\xed\xf2\x6b\x3a\x37\xfb\x46\xb6\x72\x41\x5b\x75\xc1\x15\x13\xe5\xdb\x11\x8b\x20\xdb\x89\xe8\x8f\x6c\x29\x4b\x8b\x71\x17\x50\x9b\x1d\xed\xc2\x15\x55\xc6\x13\xcf\x2c\x0e\x55\x39\xd5\x4f\x0c\x89\xea\x01\x75\xa0\x1d\xdf\xd0\x71\xcc\x0b\x7d\x8c\x0f\xfd\x1d\xd6\x4f\xbd\xca\xaf\xae\xa8\x57\x1d\xed\xa6\x37\xe9\x62\xdd\xd0\x56\xfc\x70\xfe\xae\xe3\x8d\xb6\xca\xb6\x4d\x0b\xd6\x86\xb2\xce\xeLine truncated
|
||||||
|
|
||||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||||
return bindataRead(
|
return bindataRead(
|
||||||
@@ -4337,7 +4337,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 49621, mode: os.FileMode(420), modTime: time.Unix(1456376256, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 50066, mode: os.FileMode(420), modTime: time.Unix(1456623732, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4357,7 +4357,7 @@ func confLocaleLocale_esEsIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_es-ES.ini", size: 53757, mode: os.FileMode(493), modTime: time.Unix(1456312006, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_es-ES.ini", size: 53757, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4377,7 +4377,7 @@ func confLocaleLocale_frFrIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_fr-FR.ini", size: 53362, mode: os.FileMode(493), modTime: time.Unix(1456312006, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_fr-FR.ini", size: 53362, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4397,7 +4397,7 @@ func confLocaleLocale_itItIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_it-IT.ini", size: 51116, mode: os.FileMode(493), modTime: time.Unix(1456312010, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_it-IT.ini", size: 51116, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4417,7 +4417,7 @@ func confLocaleLocale_jaJpIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_ja-JP.ini", size: 58623, mode: os.FileMode(493), modTime: time.Unix(1456312010, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_ja-JP.ini", size: 58623, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4437,7 +4437,7 @@ func confLocaleLocale_lvLvIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_lv-LV.ini", size: 53617, mode: os.FileMode(493), modTime: time.Unix(1456312012, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_lv-LV.ini", size: 53617, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4457,7 +4457,7 @@ func confLocaleLocale_nlNlIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_nl-NL.ini", size: 49979, mode: os.FileMode(493), modTime: time.Unix(1456312010, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_nl-NL.ini", size: 49979, mode: os.FileMode(493), modTime: time.Unix(1456623482, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4477,7 +4477,7 @@ func confLocaleLocale_plPlIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_pl-PL.ini", size: 51572, mode: os.FileMode(493), modTime: time.Unix(1456312010, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_pl-PL.ini", size: 51572, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4497,7 +4497,7 @@ func confLocaleLocale_ptBrIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_pt-BR.ini", size: 52056, mode: os.FileMode(493), modTime: time.Unix(1456312012, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_pt-BR.ini", size: 52056, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4517,7 +4517,7 @@ func confLocaleLocale_ruRuIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_ru-RU.ini", size: 76315, mode: os.FileMode(493), modTime: time.Unix(1456312012, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_ru-RU.ini", size: 76315, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4537,7 +4537,7 @@ func confLocaleLocale_zhCnIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_zh-CN.ini", size: 47281, mode: os.FileMode(493), modTime: time.Unix(1456312012, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_zh-CN.ini", size: 47281, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@@ -4557,7 +4557,7 @@ func confLocaleLocale_zhHkIni() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "conf/locale/locale_zh-HK.ini", size: 47291, mode: os.FileMode(493), modTime: time.Unix(1456312012, 0)}
|
info := bindataFileInfo{name: "conf/locale/locale_zh-HK.ini", size: 47291, mode: os.FileMode(493), modTime: time.Unix(1456616317, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ func RepoAssignment(args ...bool) macaron.Handler {
|
|||||||
ctx.Data["IsRepositoryPusher"] = ctx.Repo.IsPusher()
|
ctx.Data["IsRepositoryPusher"] = ctx.Repo.IsPusher()
|
||||||
ctx.Data["CanPullRequest"] = ctx.Repo.IsAdmin() && repo.BaseRepo != nil && repo.BaseRepo.AllowsPulls()
|
ctx.Data["CanPullRequest"] = ctx.Repo.IsAdmin() && repo.BaseRepo != nil && repo.BaseRepo.AllowsPulls()
|
||||||
|
|
||||||
ctx.Data["DisableSSH"] = setting.DisableSSH
|
ctx.Data["DisableSSH"] = setting.SSH.Disabled
|
||||||
ctx.Data["CloneLink"] = repo.CloneLink()
|
ctx.Data["CloneLink"] = repo.CloneLink()
|
||||||
ctx.Data["WikiCloneLink"] = repo.WikiCloneLink()
|
ctx.Data["WikiCloneLink"] = repo.WikiCloneLink()
|
||||||
|
|
||||||
|
|||||||
+46
-59
@@ -27,11 +27,6 @@ import (
|
|||||||
"github.com/gogits/gogs/modules/user"
|
"github.com/gogits/gogs/modules/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
SSH_PUBLICKEY_CHECK_NATIVE = "native"
|
|
||||||
SSH_PUBLICKEY_CHECK_KEYGEN = "ssh-keygen"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Scheme string
|
type Scheme string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -66,15 +61,6 @@ var (
|
|||||||
Domain string
|
Domain string
|
||||||
HttpAddr, HttpPort string
|
HttpAddr, HttpPort string
|
||||||
LocalURL string
|
LocalURL string
|
||||||
DisableSSH bool
|
|
||||||
StartSSHServer bool
|
|
||||||
SSHDomain string
|
|
||||||
SSHPort int
|
|
||||||
SSHListenPort int
|
|
||||||
SSHRootPath string
|
|
||||||
SSHPublicKeyCheck string
|
|
||||||
SSHWorkPath string
|
|
||||||
SSHKeyGenPath string
|
|
||||||
OfflineMode bool
|
OfflineMode bool
|
||||||
DisableRouterLog bool
|
DisableRouterLog bool
|
||||||
CertFile, KeyFile string
|
CertFile, KeyFile string
|
||||||
@@ -82,6 +68,19 @@ var (
|
|||||||
EnableGzip bool
|
EnableGzip bool
|
||||||
LandingPageUrl LandingPage
|
LandingPageUrl LandingPage
|
||||||
|
|
||||||
|
SSH struct {
|
||||||
|
Disabled bool `ini:"DISABLE_SSH"`
|
||||||
|
StartBuiltinServer bool `ini:"START_SSH_SERVER"`
|
||||||
|
Domain string `ini:"SSH_DOMAIN"`
|
||||||
|
Port int `ini:"SSH_PORT"`
|
||||||
|
ListenPort int `ini:"SSH_LISTEN_PORT"`
|
||||||
|
RootPath string `ini:"SSH_ROOT_PATH"`
|
||||||
|
KeyTestPath string `ini:"SSH_KEY_TEST_PATH"`
|
||||||
|
KeygenPath string `ini:"SSH_KEYGEN_PATH"`
|
||||||
|
MinimumKeySizeCheck bool `ini:"-"`
|
||||||
|
MinimumKeySizes map[string]int `ini:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
// Security settings
|
// Security settings
|
||||||
InstallLock bool
|
InstallLock bool
|
||||||
SecretKey string
|
SecretKey string
|
||||||
@@ -327,40 +326,6 @@ func NewContext() {
|
|||||||
HttpAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0")
|
HttpAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0")
|
||||||
HttpPort = sec.Key("HTTP_PORT").MustString("3000")
|
HttpPort = sec.Key("HTTP_PORT").MustString("3000")
|
||||||
LocalURL = sec.Key("LOCAL_ROOT_URL").MustString("http://localhost:" + HttpPort + "/")
|
LocalURL = sec.Key("LOCAL_ROOT_URL").MustString("http://localhost:" + HttpPort + "/")
|
||||||
DisableSSH = sec.Key("DISABLE_SSH").MustBool()
|
|
||||||
if !DisableSSH {
|
|
||||||
StartSSHServer = sec.Key("START_SSH_SERVER").MustBool()
|
|
||||||
}
|
|
||||||
SSHDomain = sec.Key("SSH_DOMAIN").MustString(Domain)
|
|
||||||
SSHPort = sec.Key("SSH_PORT").MustInt(22)
|
|
||||||
SSHListenPort = sec.Key("SSH_LISTEN_PORT").MustInt(SSHPort)
|
|
||||||
SSHRootPath = sec.Key("SSH_ROOT_PATH").MustString(path.Join(homeDir, ".ssh"))
|
|
||||||
if err := os.MkdirAll(SSHRootPath, 0700); err != nil {
|
|
||||||
log.Fatal(4, "Fail to create '%s': %v", SSHRootPath, err)
|
|
||||||
}
|
|
||||||
checkDefault := SSH_PUBLICKEY_CHECK_KEYGEN
|
|
||||||
if StartSSHServer {
|
|
||||||
checkDefault = SSH_PUBLICKEY_CHECK_NATIVE
|
|
||||||
}
|
|
||||||
SSHPublicKeyCheck = sec.Key("SSH_PUBLICKEY_CHECK").MustString(checkDefault)
|
|
||||||
if SSHPublicKeyCheck != SSH_PUBLICKEY_CHECK_NATIVE &&
|
|
||||||
SSHPublicKeyCheck != SSH_PUBLICKEY_CHECK_KEYGEN {
|
|
||||||
log.Fatal(4, "SSH_PUBLICKEY_CHECK must be ssh-keygen or native")
|
|
||||||
}
|
|
||||||
SSHWorkPath = sec.Key("SSH_WORK_PATH").MustString(os.TempDir())
|
|
||||||
if !DisableSSH && (!StartSSHServer || SSHPublicKeyCheck == SSH_PUBLICKEY_CHECK_KEYGEN) {
|
|
||||||
if tmpDirStat, err := os.Stat(SSHWorkPath); err != nil || !tmpDirStat.IsDir() {
|
|
||||||
log.Fatal(4, "directory '%s' set in SSHWorkPath is not a directory: %s", SSHWorkPath, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SSHKeyGenPath = sec.Key("SSH_KEYGEN_PATH").MustString("")
|
|
||||||
if !DisableSSH && !StartSSHServer &&
|
|
||||||
SSHKeyGenPath == "" && SSHPublicKeyCheck == SSH_PUBLICKEY_CHECK_KEYGEN {
|
|
||||||
SSHKeyGenPath, err = exec.LookPath("ssh-keygen")
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(4, "could not find ssh-keygen, maybe set DISABLE_SSH to use the internal ssh server")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
|
OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
|
||||||
DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
|
DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
|
||||||
StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir)
|
StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir)
|
||||||
@@ -373,6 +338,39 @@ func NewContext() {
|
|||||||
LandingPageUrl = LANDING_PAGE_HOME
|
LandingPageUrl = LANDING_PAGE_HOME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SSH.RootPath = path.Join(homeDir, ".ssh")
|
||||||
|
SSH.KeyTestPath = os.TempDir()
|
||||||
|
if err = Cfg.Section("server").MapTo(&SSH); err != nil {
|
||||||
|
log.Fatal(4, "Fail to map SSH settings: %v", err)
|
||||||
|
}
|
||||||
|
// When disable SSH, start builtin server value is ignored.
|
||||||
|
if SSH.Disabled {
|
||||||
|
SSH.StartBuiltinServer = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if !SSH.Disabled && !SSH.StartBuiltinServer {
|
||||||
|
if err := os.MkdirAll(SSH.RootPath, 0700); err != nil {
|
||||||
|
log.Fatal(4, "Fail to create '%s': %v", SSH.RootPath, err)
|
||||||
|
} else if err = os.MkdirAll(SSH.KeyTestPath, 0644); err != nil {
|
||||||
|
log.Fatal(4, "Fail to create '%s': %v", SSH.KeyTestPath, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !filepath.IsAbs(SSH.KeygenPath) {
|
||||||
|
if _, err := exec.LookPath(SSH.KeygenPath); err != nil {
|
||||||
|
log.Fatal(4, "Fail to test '%s' command: %v (forgotten install?)", SSH.KeygenPath, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SSH.MinimumKeySizeCheck = sec.Key("MINIMUM_KEY_SIZE_CHECK").MustBool()
|
||||||
|
SSH.MinimumKeySizes = map[string]int{}
|
||||||
|
minimumKeySizes := Cfg.Section("ssh.minimum_key_sizes").Keys()
|
||||||
|
for _, key := range minimumKeySizes {
|
||||||
|
if key.MustInt() != -1 {
|
||||||
|
SSH.MinimumKeySizes[strings.ToLower(key.Name())] = key.MustInt()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sec = Cfg.Section("security")
|
sec = Cfg.Section("security")
|
||||||
InstallLock = sec.Key("INSTALL_LOCK").MustBool()
|
InstallLock = sec.Key("INSTALL_LOCK").MustBool()
|
||||||
SecretKey = sec.Key("SECRET_KEY").String()
|
SecretKey = sec.Key("SECRET_KEY").String()
|
||||||
@@ -492,8 +490,6 @@ var Service struct {
|
|||||||
EnableReverseProxyAuth bool
|
EnableReverseProxyAuth bool
|
||||||
EnableReverseProxyAutoRegister bool
|
EnableReverseProxyAutoRegister bool
|
||||||
EnableCaptcha bool
|
EnableCaptcha bool
|
||||||
EnableMinimumKeySizeCheck bool
|
|
||||||
MinimumKeySizes map[string]int
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func newService() {
|
func newService() {
|
||||||
@@ -506,15 +502,6 @@ func newService() {
|
|||||||
Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool()
|
Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool()
|
||||||
Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool()
|
Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool()
|
||||||
Service.EnableCaptcha = sec.Key("ENABLE_CAPTCHA").MustBool()
|
Service.EnableCaptcha = sec.Key("ENABLE_CAPTCHA").MustBool()
|
||||||
Service.EnableMinimumKeySizeCheck = sec.Key("ENABLE_MINIMUM_KEY_SIZE_CHECK").MustBool()
|
|
||||||
Service.MinimumKeySizes = map[string]int{}
|
|
||||||
|
|
||||||
minimumKeySizes := Cfg.Section("service.minimum_key_sizes").Keys()
|
|
||||||
for _, key := range minimumKeySizes {
|
|
||||||
if key.MustInt() != -1 {
|
|
||||||
Service.MinimumKeySizes[strings.ToLower(key.Name())] = key.MustInt()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var logLevels = map[string]string{
|
var logLevels = map[string]string{
|
||||||
|
|||||||
@@ -204,6 +204,8 @@ func Config(ctx *middleware.Context) {
|
|||||||
ctx.Data["ScriptType"] = setting.ScriptType
|
ctx.Data["ScriptType"] = setting.ScriptType
|
||||||
ctx.Data["ReverseProxyAuthUser"] = setting.ReverseProxyAuthUser
|
ctx.Data["ReverseProxyAuthUser"] = setting.ReverseProxyAuthUser
|
||||||
|
|
||||||
|
ctx.Data["SSH"] = setting.SSH
|
||||||
|
|
||||||
ctx.Data["Service"] = setting.Service
|
ctx.Data["Service"] = setting.Service
|
||||||
ctx.Data["DbCfg"] = models.DbCfg
|
ctx.Data["DbCfg"] = models.DbCfg
|
||||||
ctx.Data["Webhook"] = setting.Webhook
|
ctx.Data["Webhook"] = setting.Webhook
|
||||||
|
|||||||
+4
-4
@@ -88,9 +88,9 @@ func GlobalInit() {
|
|||||||
}
|
}
|
||||||
checkRunMode()
|
checkRunMode()
|
||||||
|
|
||||||
if setting.StartSSHServer {
|
if setting.SSH.StartBuiltinServer {
|
||||||
ssh.Listen(setting.SSHListenPort)
|
ssh.Listen(setting.SSH.ListenPort)
|
||||||
log.Info("SSH server started on :%v", setting.SSHListenPort)
|
log.Info("SSH server started on :%v", setting.SSH.ListenPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build Sanitizer
|
// Build Sanitizer
|
||||||
@@ -152,7 +152,7 @@ func Install(ctx *middleware.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
form.Domain = setting.Domain
|
form.Domain = setting.Domain
|
||||||
form.SSHPort = setting.SSHPort
|
form.SSHPort = setting.SSH.Port
|
||||||
form.HTTPPort = setting.HttpPort
|
form.HTTPPort = setting.HttpPort
|
||||||
form.AppUrl = setting.AppUrl
|
form.AppUrl = setting.AppUrl
|
||||||
form.LogRootPath = setting.LogRootPath
|
form.LogRootPath = setting.LogRootPath
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
0.8.46.0227
|
0.8.47.0227
|
||||||
@@ -22,12 +22,16 @@
|
|||||||
<dd><i class="fa fa{{if .OfflineMode}}-check{{end}}-square-o"></i></dd>
|
<dd><i class="fa fa{{if .OfflineMode}}-check{{end}}-square-o"></i></dd>
|
||||||
<dt>{{.i18n.Tr "admin.config.disable_router_log"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.disable_router_log"}}</dt>
|
||||||
<dd><i class="fa fa{{if .DisableRouterLog}}-check{{end}}-square-o"></i></dd>
|
<dd><i class="fa fa{{if .DisableRouterLog}}-check{{end}}-square-o"></i></dd>
|
||||||
|
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
|
||||||
<dt>{{.i18n.Tr "admin.config.run_user"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.run_user"}}</dt>
|
||||||
<dd>{{.RunUser}}</dd>
|
<dd>{{.RunUser}}</dd>
|
||||||
<dt>{{.i18n.Tr "admin.config.run_mode"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.run_mode"}}</dt>
|
||||||
<dd>{{.RunMode}}</dd>
|
<dd>{{.RunMode}}</dd>
|
||||||
|
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
|
||||||
<dt>{{.i18n.Tr "admin.config.repo_root_path"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.repo_root_path"}}</dt>
|
||||||
<dd>{{.RepoRootPath}}</dd>
|
<dd>{{.RepoRootPath}}</dd>
|
||||||
<dt>{{.i18n.Tr "admin.config.static_file_root_path"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.static_file_root_path"}}</dt>
|
||||||
@@ -41,6 +45,41 @@
|
|||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h4 class="ui top attached header">
|
||||||
|
{{.i18n.Tr "admin.config.ssh_config"}}
|
||||||
|
</h4>
|
||||||
|
<div class="ui attached table segment">
|
||||||
|
<dl class="dl-horizontal admin-dl-horizontal">
|
||||||
|
<dt>{{.i18n.Tr "admin.config.ssh_enabled"}}</dt>
|
||||||
|
<dd><i class="fa fa{{if not .SSH.Disabled}}-check{{end}}-square-o"></i></dd>
|
||||||
|
{{if not .SSH.Disabled}}
|
||||||
|
<dt>{{.i18n.Tr "admin.config.ssh_start_builtin_server"}}</dt>
|
||||||
|
<dd><i class="fa fa{{if .SSH.StartBuiltinServer}}-check{{end}}-square-o"></i></dd>
|
||||||
|
<dt>{{.i18n.Tr "admin.config.ssh_domain"}}</dt>
|
||||||
|
<dd>{{.SSH.Domain}}</dd>
|
||||||
|
<dt>{{.i18n.Tr "admin.config.ssh_port"}}</dt>
|
||||||
|
<dd>{{.SSH.Port}}</dd>
|
||||||
|
<dt>{{.i18n.Tr "admin.config.ssh_listen_port"}}</dt>
|
||||||
|
<dd>{{.SSH.ListenPort}}</dd>
|
||||||
|
|
||||||
|
{{if not .SSH.StartBuiltinServer}}
|
||||||
|
<dt>{{.i18n.Tr "admin.config.ssh_root_path"}}</dt>
|
||||||
|
<dd>{{.SSH.RootPath}}</dd>
|
||||||
|
<dt>{{.i18n.Tr "admin.config.ssh_key_test_path"}}</dt>
|
||||||
|
<dd>{{.SSH.KeyTestPath}}</dd>
|
||||||
|
<dt>{{.i18n.Tr "admin.config.ssh_keygen_path"}}</dt>
|
||||||
|
<dd>{{.SSH.KeygenPath}}</dd>
|
||||||
|
<dt>{{.i18n.Tr "admin.config.ssh_minimum_key_size_check"}}</dt>
|
||||||
|
<dd><i class="fa fa{{if .SSH.MinimumKeySizeCheck}}-check{{end}}-square-o"></i></dd>
|
||||||
|
{{if .SSH.MinimumKeySizeCheck}}
|
||||||
|
<dt>{{.i18n.Tr "admin.config.ssh_minimum_key_sizes"}}</dt>
|
||||||
|
<dd>{{.SSH.MinimumKeySizes}}</dd>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h4 class="ui top attached header">
|
<h4 class="ui top attached header">
|
||||||
{{.i18n.Tr "admin.config.db_config"}}
|
{{.i18n.Tr "admin.config.db_config"}}
|
||||||
</h4>
|
</h4>
|
||||||
@@ -109,7 +148,8 @@
|
|||||||
<dl class="dl-horizontal admin-dl-horizontal">
|
<dl class="dl-horizontal admin-dl-horizontal">
|
||||||
<dt>{{.i18n.Tr "admin.config.mailer_enabled"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.mailer_enabled"}}</dt>
|
||||||
<dd><i class="fa fa{{if .MailerEnabled}}-check{{end}}-square-o"></i></dd>
|
<dd><i class="fa fa{{if .MailerEnabled}}-check{{end}}-square-o"></i></dd>
|
||||||
{{if .MailerEnabled}}<dt>{{.i18n.Tr "admin.config.mailer_name"}}</dt>
|
{{if .MailerEnabled}}
|
||||||
|
<dt>{{.i18n.Tr "admin.config.mailer_name"}}</dt>
|
||||||
<dd>{{.Mailer.Name}}</dd>
|
<dd>{{.Mailer.Name}}</dd>
|
||||||
<dt>{{.i18n.Tr "admin.config.mailer_disable_helo"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.mailer_disable_helo"}}</dt>
|
||||||
<dd><i class="fa fa{{if .Mailer.DisableHelo}}-check{{end}}-square-o"></i></dd>
|
<dd><i class="fa fa{{if .Mailer.DisableHelo}}-check{{end}}-square-o"></i></dd>
|
||||||
|
|||||||
Reference in new issue
Block a user