Skip to content

Commit ac51caa

Browse files
lunnytboerger
authored andcommitted
add default values for SSH settings (#500)
1 parent 799d0c2 commit ac51caa

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

modules/setting/setting.go

+31-25
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var (
7979
LandingPageURL LandingPage
8080
UnixSocketPermission uint32
8181

82-
SSH struct {
82+
SSH = struct {
8383
Disabled bool `ini:"DISABLE_SSH"`
8484
StartBuiltinServer bool `ini:"START_SSH_SERVER"`
8585
Domain string `ini:"SSH_DOMAIN"`
@@ -91,6 +91,12 @@ var (
9191
KeygenPath string `ini:"SSH_KEYGEN_PATH"`
9292
MinimumKeySizeCheck bool `ini:"-"`
9393
MinimumKeySizes map[string]int `ini:"-"`
94+
}{
95+
Disabled: false,
96+
StartBuiltinServer: false,
97+
Domain: "localhost",
98+
Port: 22,
99+
KeygenPath: "ssh-keygen",
94100
}
95101

96102
LFS struct {
@@ -948,25 +954,25 @@ func newSessionService() {
948954

949955
// Mailer represents mail service.
950956
type Mailer struct {
951-
// Mailer
957+
// Mailer
952958
QueueLength int
953959
Name string
954960
From string
955961
FromEmail string
956962
EnableHTMLAlternative bool
957963

958964
// SMTP sender
959-
Host string
960-
User, Passwd string
961-
DisableHelo bool
962-
HeloHostname string
963-
SkipVerify bool
964-
UseCertificate bool
965-
CertFile, KeyFile string
965+
Host string
966+
User, Passwd string
967+
DisableHelo bool
968+
HeloHostname string
969+
SkipVerify bool
970+
UseCertificate bool
971+
CertFile, KeyFile string
966972

967973
// Sendmail sender
968-
UseSendmail bool
969-
SendmailPath string
974+
UseSendmail bool
975+
SendmailPath string
970976
}
971977

972978
var (
@@ -982,22 +988,22 @@ func newMailService() {
982988
}
983989

984990
MailService = &Mailer{
985-
QueueLength: sec.Key("SEND_BUFFER_LEN").MustInt(100),
986-
Name: sec.Key("NAME").MustString(AppName),
991+
QueueLength: sec.Key("SEND_BUFFER_LEN").MustInt(100),
992+
Name: sec.Key("NAME").MustString(AppName),
987993
EnableHTMLAlternative: sec.Key("ENABLE_HTML_ALTERNATIVE").MustBool(),
988994

989-
Host: sec.Key("HOST").String(),
990-
User: sec.Key("USER").String(),
991-
Passwd: sec.Key("PASSWD").String(),
992-
DisableHelo: sec.Key("DISABLE_HELO").MustBool(),
993-
HeloHostname: sec.Key("HELO_HOSTNAME").String(),
994-
SkipVerify: sec.Key("SKIP_VERIFY").MustBool(),
995-
UseCertificate: sec.Key("USE_CERTIFICATE").MustBool(),
996-
CertFile: sec.Key("CERT_FILE").String(),
997-
KeyFile: sec.Key("KEY_FILE").String(),
998-
999-
UseSendmail: sec.Key("USE_SENDMAIL").MustBool(),
1000-
SendmailPath: sec.Key("SENDMAIL_PATH").MustString("sendmail"),
995+
Host: sec.Key("HOST").String(),
996+
User: sec.Key("USER").String(),
997+
Passwd: sec.Key("PASSWD").String(),
998+
DisableHelo: sec.Key("DISABLE_HELO").MustBool(),
999+
HeloHostname: sec.Key("HELO_HOSTNAME").String(),
1000+
SkipVerify: sec.Key("SKIP_VERIFY").MustBool(),
1001+
UseCertificate: sec.Key("USE_CERTIFICATE").MustBool(),
1002+
CertFile: sec.Key("CERT_FILE").String(),
1003+
KeyFile: sec.Key("KEY_FILE").String(),
1004+
1005+
UseSendmail: sec.Key("USE_SENDMAIL").MustBool(),
1006+
SendmailPath: sec.Key("SENDMAIL_PATH").MustString("sendmail"),
10011007
}
10021008
MailService.From = sec.Key("FROM").MustString(MailService.User)
10031009

0 commit comments

Comments
 (0)