Author: toad
Date: 2008-09-03 14:32:46 +0000 (Wed, 03 Sep 2008)
New Revision: 22366
Modified:
trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
trunk/freenet/src/freenet/node/SecurityLevels.java
Log:
Add the other two questions. Not wired up to change the actual config yet.
None of these changes any actual node behaviour yet.
Modified: trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConfigToadlet.java 2008-09-03
14:08:59 UTC (rev 22365)
+++ trunk/freenet/src/freenet/clients/http/ConfigToadlet.java 2008-09-03
14:32:46 UTC (rev 22366)
@@ -21,7 +21,9 @@
import freenet.node.Node;
import freenet.node.NodeClientCore;
import freenet.node.SecurityLevels;
+import freenet.node.SecurityLevels.FRIENDS_THREAT_LEVEL;
import freenet.node.SecurityLevels.NETWORK_THREAT_LEVEL;
+import freenet.node.SecurityLevels.PHYSICAL_THREAT_LEVEL;
import freenet.node.useralerts.AbstractUserAlert;
import freenet.node.useralerts.UserAlert;
import freenet.support.HTMLNode;
@@ -418,6 +420,51 @@
input.addChild("#", ": ");
L10n.addL10nSubstitution(input,
"SecurityLevels.networkThreatLevel.desc."+level, new String[] { "bold", "/bold"
}, new String[] { "<b>", "</b>" });
}
+
+ // Friends security level
+ formNode.addChild("div", "class", "configprefix",
l10nSec("friendsThreatLevelShort"));
+ ul = formNode.addChild("ul", "class", "config");
+ seclevelGroup = ul.addChild("li");
+ seclevelGroup.addChild("#", l10nSec("friendsThreatLevel"));
+
+ FRIENDS_THREAT_LEVEL friendsLevel =
node.securityLevels.getFriendsThreatLevel();
+
+ controlName = "security-levels.friendsThreatLevel";
+ for(FRIENDS_THREAT_LEVEL level : FRIENDS_THREAT_LEVEL.values())
{
+ HTMLNode input;
+ if(level == friendsLevel) {
+ input =
seclevelGroup.addChild("p").addChild("input", new String[] { "type", "checked",
"name", "value" }, new String[] { "radio", "on", controlName, level.name() });
+ } else {
+ input =
seclevelGroup.addChild("p").addChild("input", new String[] { "type", "name",
"value" }, new String[] { "radio", controlName, level.name() });
+ }
+ input.addChild("b",
l10nSec("friendsThreatLevel.name."+level));
+ input.addChild("#", ": ");
+ L10n.addL10nSubstitution(input,
"SecurityLevels.friendsThreatLevel.desc."+level, new String[] { "bold", "/bold"
}, new String[] { "<b>", "</b>" });
+ }
+
+ // Physical security level
+ formNode.addChild("div", "class", "configprefix",
l10nSec("physicalThreatLevelShort"));
+ ul = formNode.addChild("ul", "class", "config");
+ seclevelGroup = ul.addChild("li");
+ seclevelGroup.addChild("#", l10nSec("physicalThreatLevel"));
+
+ PHYSICAL_THREAT_LEVEL physicalLevel =
node.securityLevels.getPhysicalThreatLevel();
+
+ controlName = "security-levels.physicalThreatLevel";
+ for(PHYSICAL_THREAT_LEVEL level :
PHYSICAL_THREAT_LEVEL.values()) {
+ HTMLNode input;
+ if(level == physicalLevel) {
+ input =
seclevelGroup.addChild("p").addChild("input", new String[] { "type", "checked",
"name", "value" }, new String[] { "radio", "on", controlName, level.name() });
+ } else {
+ input =
seclevelGroup.addChild("p").addChild("input", new String[] { "type", "name",
"value" }, new String[] { "radio", controlName, level.name() });
+ }
+ input.addChild("b",
l10nSec("physicalThreatLevel.name."+level));
+ input.addChild("#", ": ");
+ L10n.addL10nSubstitution(input,
"SecurityLevels.physicalThreatLevel.desc."+level, new String[] { "bold",
"/bold" }, new String[] { "<b>", "</b>" });
+ }
+
+
+
// FIXME implement the rest, it should be very similar to the
above.
formNode.addChild("input", new String[] { "type", "name",
"value" }, new String[] { "hidden", "seclevels", "on" });
Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2008-09-03
14:08:59 UTC (rev 22365)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2008-09-03
14:32:46 UTC (rev 22366)
@@ -1062,6 +1062,20 @@
SecurityLevels.networkThreatLevelConfirmTitle=WARNING: Setting network
security level to ${mode}
SecurityLevels.maximumNetworkThreatLevelWarning=${bold}WARNING:${/bold} You
are about to set the maximum network security level! This will
${bold}significantly${/bold} slow down Freenet for you! Please do not do this
unless you really need the security!
SecurityLevels.maximumNetworkThreatLevelCheckbox=Yes I really want to enable
maximum security, I understand that Freenet is still experimental and it may
still be possible to trace me, and that this setting may dramatically reduce
Freenet's performance!
+SecurityLevels.friendsThreatLevelShort=Protection if your friends attack your
anonymity
+SecurityLevels.friendsThreatLevel=How concerned are you about those you add as
friends attempting to monitor your activities, either deliberately or as a
result of their computers being compromised? (This is a default level and for
most purposes can be overriden on a per-friend basis.) If you set the network
security level to HIGH above, then the friends security level determines
performance, along with the number of friends added.
+SecurityLevels.friendsThreatLevel.name.HIGH=HIGH
+SecurityLevels.friendsThreatLevel.name.NORMAL=NORMAL
+SecurityLevels.friendsThreatLevel.name.LOW=LOW
+SecurityLevels.friendsThreatLevel.desc.HIGH=I would like Freenet to take extra
precautions to avoid attacks from friends. Freenet will not share any
additional information with friends and so will be somewhat slower than in
NORMAL mode.
+SecurityLevels.friendsThreatLevel.desc.NORMAL=I am not overly concerned about
attacks from friends, but I would like Freenet to take reasonable precautions
at some performance cost. Freenet will share a limited amount of information
with friends.
+SecurityLevels.friendsThreatLevel.desc.LOW=I am not concerned about attacks
from friends. I trust my friends and their computer security abilities.
Freenet will trust friends fully, for maximum performance.
+SecurityLevels.physicalThreatLevelShort=Protection if your computer is seized
or stolen
+SecurityLevels.physicalThreatLevel=How concerned are you about your computer
being physically seized and examined?
+SecurityLevels.physicalThreatLevel.name.NORMAL=NORMAL
+SecurityLevels.physicalThreatLevel.name.LOW=LOW
+SecurityLevels.physicalThreatLevel.desc.NORMAL=I am concerned. Freenet will
encrypt temporary files etc, at a small performance cost, but you should take
additional precautions such as disabling your browser cache when browsing
freesites.
+SecurityLevels.physicalThreatLevel.desc.LOW=I am not concerned. Freenet will
avoid disk encryption and leave traces of what you have visited on your hard
disk, improving performance.
ShortOption.parseError=Cannot parse value as a string array: ${error}
ShortOption.parseError=The value specified can't be parsed as a 16-bit integer
: ${val}
SimpleToadletServer.advancedMode=Enable Advanced Mode?
Modified: trunk/freenet/src/freenet/node/SecurityLevels.java
===================================================================
--- trunk/freenet/src/freenet/node/SecurityLevels.java 2008-09-03 14:08:59 UTC
(rev 22365)
+++ trunk/freenet/src/freenet/node/SecurityLevels.java 2008-09-03 14:32:46 UTC
(rev 22366)
@@ -215,7 +215,15 @@
public NETWORK_THREAT_LEVEL getNetworkThreatLevel() {
return networkThreatLevel;
}
+
+ public FRIENDS_THREAT_LEVEL getFriendsThreatLevel() {
+ return friendsThreatLevel;
+ }
+ public PHYSICAL_THREAT_LEVEL getPhysicalThreatLevel() {
+ return physicalThreatLevel;
+ }
+
public static NETWORK_THREAT_LEVEL parseNetworkThreatLevel(String arg) {
try {
return NETWORK_THREAT_LEVEL.valueOf(arg);
@@ -298,5 +306,5 @@
public static String localisedName(NETWORK_THREAT_LEVEL newThreatLevel)
{
return
L10n.getString("SecurityLevels.networkThreatLevel.name."+newThreatLevel.name());
}
-
+
}