remove old/obsolete clear text "adminAccount" credential entry from init

and setConfig (.,empty) from servlets/code
pull/93/head
reger 8 years ago
parent 811cf637f8
commit bad8f87998

@ -385,13 +385,12 @@ serverClient=*
#use User_p.html to create some Users. #use User_p.html to create some Users.
use_proxyAccounts=true use_proxyAccounts=true
# adminAccount: a user:password - pair for administration of # adminAccountBase64MD5: a encoded user:password - pair for administration of
# settings through the web interface # settings through the web interface
# should be set to a secret. By default it is without a password # should be set to a secret. By default it is without a password
# but you are encouraged to set it to another value on the page # but you are encouraged to set it to another value on the page
# http://localhost:8090/ConfigAccounts_p.html # http://localhost:8090/ConfigAccounts_p.html
#adminAccount=admin:mysecretpassword #adminAccountBase64=MD5:{admin:realm:mysecretpassword}
adminAccount=
adminAccountBase64MD5= adminAccountBase64MD5=
adminAccountUserName=admin adminAccountUserName=admin

@ -71,7 +71,6 @@ public class ConfigAccounts_p {
// check passed. set account: // check passed. set account:
// old: // env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, Digest.encodeMD5Hex(Base64Order.standardCoder.encodeString(user + ":" + pw1))); // old: // env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, Digest.encodeMD5Hex(Base64Order.standardCoder.encodeString(user + ":" + pw1)));
env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "MD5:"+Digest.encodeMD5Hex(user + ":" + sb.getConfig(SwitchboardConstants.ADMIN_REALM,"YaCy")+":"+ pw1)); env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "MD5:"+Digest.encodeMD5Hex(user + ":" + sb.getConfig(SwitchboardConstants.ADMIN_REALM,"YaCy")+":"+ pw1));
env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT, "");
env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME,user); env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME,user);
// make sure server accepts new credentials // make sure server accepts new credentials
Jetty9HttpServerImpl jhttpserver = (Jetty9HttpServerImpl)sb.getHttpServer(); Jetty9HttpServerImpl jhttpserver = (Jetty9HttpServerImpl)sb.getHttpServer();
@ -97,7 +96,6 @@ public class ConfigAccounts_p {
if (env.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "").isEmpty()) { if (env.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "").isEmpty()) {
// make a 'random' password // make a 'random' password
env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "0000" + sb.genRandomPassword()); env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "0000" + sb.genRandomPassword());
env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT, "");
} }
} else { } else {
sb.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_FOR_LOCALHOST, false); sb.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_FOR_LOCALHOST, false);

@ -87,7 +87,6 @@ public class SettingsAck_p {
} }
// check passed. set account: // check passed. set account:
env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "MD5:"+Digest.encodeMD5Hex(user + ":" + sb.getConfig(SwitchboardConstants.ADMIN_REALM,"YaCy") + ":" + pw1)); env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "MD5:"+Digest.encodeMD5Hex(user + ":" + sb.getConfig(SwitchboardConstants.ADMIN_REALM,"YaCy") + ":" + pw1));
env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT, "");
env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME, user); env.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME, user);
prop.put("info", "5");//admin account changed prop.put("info", "5");//admin account changed
prop.putHTML("info_user", user); prop.putHTML("info_user", user);

@ -241,7 +241,6 @@ public class migration {
String acc; String acc;
if ((acc = sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT, "")).length() > 0) { if ((acc = sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT, "")).length() > 0) {
sb.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, Digest.encodeMD5Hex(Base64Order.standardCoder.encodeString(acc))); sb.setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, Digest.encodeMD5Hex(Base64Order.standardCoder.encodeString(acc)));
sb.setConfig(SwitchboardConstants.ADMIN_ACCOUNT, "");
} }
// fix unsafe old passwords // fix unsafe old passwords

@ -2313,7 +2313,6 @@ public final class Switchboard extends serverSwitch {
&& getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "").isEmpty() ) { && getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "").isEmpty() ) {
// make a 'random' password, this will keep the ability to log in from localhost without password // make a 'random' password, this will keep the ability to log in from localhost without password
setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "0000" + this.genRandomPassword()); setConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "0000" + this.genRandomPassword());
setConfig(SwitchboardConstants.ADMIN_ACCOUNT, "");
} }
// stop greedylearning if limit is reached // stop greedylearning if limit is reached

Loading…
Cancel
Save