|
@@ -1319,6 +1319,19 @@ func LoadConfig(filename string) (config *Config, err error) {
|
1319
|
1319
|
|
1320
|
1320
|
config.Accounts.defaultUserModes = ParseDefaultUserModes(config.Accounts.DefaultUserModes)
|
1321
|
1321
|
|
|
1322
|
+ if config.Server.Password != "" {
|
|
1323
|
+ config.Server.passwordBytes, err = decodeLegacyPasswordHash(config.Server.Password)
|
|
1324
|
+ if err != nil {
|
|
1325
|
+ return nil, err
|
|
1326
|
+ }
|
|
1327
|
+ if config.Accounts.LoginViaPassCommand && !config.Accounts.SkipServerPassword {
|
|
1328
|
+ return nil, errors.New("Using a server password and login-via-pass-command requires skip-server-password as well")
|
|
1329
|
+ }
|
|
1330
|
+ // #1634: accounts.registration.allow-before-connect is an auth bypass
|
|
1331
|
+ // for configurations that start from default and then enable server.password
|
|
1332
|
+ config.Accounts.Registration.AllowBeforeConnect = false
|
|
1333
|
+ }
|
|
1334
|
+
|
1322
|
1335
|
config.Accounts.RequireSasl.exemptedNets, err = utils.ParseNetList(config.Accounts.RequireSasl.Exempted)
|
1323
|
1336
|
if err != nil {
|
1324
|
1337
|
return nil, fmt.Errorf("Could not parse require-sasl exempted nets: %v", err.Error())
|
|
@@ -1409,16 +1422,6 @@ func LoadConfig(filename string) (config *Config, err error) {
|
1409
|
1422
|
// parse default channel modes
|
1410
|
1423
|
config.Channels.defaultModes = ParseDefaultChannelModes(config.Channels.DefaultModes)
|
1411
|
1424
|
|
1412
|
|
- if config.Server.Password != "" {
|
1413
|
|
- config.Server.passwordBytes, err = decodeLegacyPasswordHash(config.Server.Password)
|
1414
|
|
- if err != nil {
|
1415
|
|
- return nil, err
|
1416
|
|
- }
|
1417
|
|
- if config.Accounts.LoginViaPassCommand && !config.Accounts.SkipServerPassword {
|
1418
|
|
- return nil, errors.New("Using a server password and login-via-pass-command requires skip-server-password as well")
|
1419
|
|
- }
|
1420
|
|
- }
|
1421
|
|
-
|
1422
|
1425
|
if config.Accounts.Registration.BcryptCost == 0 {
|
1423
|
1426
|
config.Accounts.Registration.BcryptCost = passwd.DefaultCost
|
1424
|
1427
|
}
|