|
@@ -1299,6 +1299,19 @@ func LoadConfig(filename string) (config *Config, err error) {
|
1299
|
1299
|
|
1300
|
1300
|
config.Accounts.defaultUserModes = ParseDefaultUserModes(config.Accounts.DefaultUserModes)
|
1301
|
1301
|
|
|
1302
|
+ if config.Server.Password != "" {
|
|
1303
|
+ config.Server.passwordBytes, err = decodeLegacyPasswordHash(config.Server.Password)
|
|
1304
|
+ if err != nil {
|
|
1305
|
+ return nil, err
|
|
1306
|
+ }
|
|
1307
|
+ if config.Accounts.LoginViaPassCommand && !config.Accounts.SkipServerPassword {
|
|
1308
|
+ return nil, errors.New("Using a server password and login-via-pass-command requires skip-server-password as well")
|
|
1309
|
+ }
|
|
1310
|
+ // #1634: accounts.registration.allow-before-connect is an auth bypass
|
|
1311
|
+ // for configurations that start from default and then enable server.password
|
|
1312
|
+ config.Accounts.Registration.AllowBeforeConnect = false
|
|
1313
|
+ }
|
|
1314
|
+
|
1302
|
1315
|
config.Accounts.RequireSasl.exemptedNets, err = utils.ParseNetList(config.Accounts.RequireSasl.Exempted)
|
1303
|
1316
|
if err != nil {
|
1304
|
1317
|
return nil, fmt.Errorf("Could not parse require-sasl exempted nets: %v", err.Error())
|
|
@@ -1389,16 +1402,6 @@ func LoadConfig(filename string) (config *Config, err error) {
|
1389
|
1402
|
// parse default channel modes
|
1390
|
1403
|
config.Channels.defaultModes = ParseDefaultChannelModes(config.Channels.DefaultModes)
|
1391
|
1404
|
|
1392
|
|
- if config.Server.Password != "" {
|
1393
|
|
- config.Server.passwordBytes, err = decodeLegacyPasswordHash(config.Server.Password)
|
1394
|
|
- if err != nil {
|
1395
|
|
- return nil, err
|
1396
|
|
- }
|
1397
|
|
- if config.Accounts.LoginViaPassCommand && !config.Accounts.SkipServerPassword {
|
1398
|
|
- return nil, errors.New("Using a server password and login-via-pass-command requires skip-server-password as well")
|
1399
|
|
- }
|
1400
|
|
- }
|
1401
|
|
-
|
1402
|
1405
|
if config.Accounts.Registration.BcryptCost == 0 {
|
1403
|
1406
|
config.Accounts.Registration.BcryptCost = passwd.DefaultCost
|
1404
|
1407
|
}
|