aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2016-12-29 04:51:15 -0600
committerThomas Boerger <thomas@webhippie.de>2016-12-29 11:51:15 +0100
commitac51caa517579ca9b495bff031b2affe297ebd25 (patch)
tree5939f892d46b02f0f3b4597a56da4791f9ccc3af /modules/setting
parent799d0c2030123377cefb635025cf4ad0086ec14b (diff)
downloadgitea-ac51caa517579ca9b495bff031b2affe297ebd25.tar.gz
gitea-ac51caa517579ca9b495bff031b2affe297ebd25.zip
add default values for SSH settings (#500)
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/setting.go56
1 files changed, 31 insertions, 25 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index fa6d64e214..4acac07ef7 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -79,7 +79,7 @@ var (
LandingPageURL LandingPage
UnixSocketPermission uint32
- SSH struct {
+ SSH = struct {
Disabled bool `ini:"DISABLE_SSH"`
StartBuiltinServer bool `ini:"START_SSH_SERVER"`
Domain string `ini:"SSH_DOMAIN"`
@@ -91,6 +91,12 @@ var (
KeygenPath string `ini:"SSH_KEYGEN_PATH"`
MinimumKeySizeCheck bool `ini:"-"`
MinimumKeySizes map[string]int `ini:"-"`
+ }{
+ Disabled: false,
+ StartBuiltinServer: false,
+ Domain: "localhost",
+ Port: 22,
+ KeygenPath: "ssh-keygen",
}
LFS struct {
@@ -948,7 +954,7 @@ func newSessionService() {
// Mailer represents mail service.
type Mailer struct {
- // Mailer
+ // Mailer
QueueLength int
Name string
From string
@@ -956,17 +962,17 @@ type Mailer struct {
EnableHTMLAlternative bool
// SMTP sender
- Host string
- User, Passwd string
- DisableHelo bool
- HeloHostname string
- SkipVerify bool
- UseCertificate bool
- CertFile, KeyFile string
+ Host string
+ User, Passwd string
+ DisableHelo bool
+ HeloHostname string
+ SkipVerify bool
+ UseCertificate bool
+ CertFile, KeyFile string
// Sendmail sender
- UseSendmail bool
- SendmailPath string
+ UseSendmail bool
+ SendmailPath string
}
var (
@@ -982,22 +988,22 @@ func newMailService() {
}
MailService = &Mailer{
- QueueLength: sec.Key("SEND_BUFFER_LEN").MustInt(100),
- Name: sec.Key("NAME").MustString(AppName),
+ QueueLength: sec.Key("SEND_BUFFER_LEN").MustInt(100),
+ Name: sec.Key("NAME").MustString(AppName),
EnableHTMLAlternative: sec.Key("ENABLE_HTML_ALTERNATIVE").MustBool(),
- Host: sec.Key("HOST").String(),
- User: sec.Key("USER").String(),
- Passwd: sec.Key("PASSWD").String(),
- DisableHelo: sec.Key("DISABLE_HELO").MustBool(),
- HeloHostname: sec.Key("HELO_HOSTNAME").String(),
- SkipVerify: sec.Key("SKIP_VERIFY").MustBool(),
- UseCertificate: sec.Key("USE_CERTIFICATE").MustBool(),
- CertFile: sec.Key("CERT_FILE").String(),
- KeyFile: sec.Key("KEY_FILE").String(),
-
- UseSendmail: sec.Key("USE_SENDMAIL").MustBool(),
- SendmailPath: sec.Key("SENDMAIL_PATH").MustString("sendmail"),
+ Host: sec.Key("HOST").String(),
+ User: sec.Key("USER").String(),
+ Passwd: sec.Key("PASSWD").String(),
+ DisableHelo: sec.Key("DISABLE_HELO").MustBool(),
+ HeloHostname: sec.Key("HELO_HOSTNAME").String(),
+ SkipVerify: sec.Key("SKIP_VERIFY").MustBool(),
+ UseCertificate: sec.Key("USE_CERTIFICATE").MustBool(),
+ CertFile: sec.Key("CERT_FILE").String(),
+ KeyFile: sec.Key("KEY_FILE").String(),
+
+ UseSendmail: sec.Key("USE_SENDMAIL").MustBool(),
+ SendmailPath: sec.Key("SENDMAIL_PATH").MustString("sendmail"),
}
MailService.From = sec.Key("FROM").MustString(MailService.User)