Author: nextgens
Date: 2007-04-14 22:15:51 +0000 (Sat, 14 Apr 2007)
New Revision: 12732
Modified:
trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
trunk/freenet/src/freenet/clients/http/BookmarkManager.java
trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
trunk/freenet/src/freenet/l10n/L10n.java
trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
trunk/freenet/src/freenet/node/LoggingConfigHandler.java
trunk/freenet/src/freenet/node/Node.java
trunk/freenet/src/freenet/node/NodeClientCore.java
trunk/freenet/src/freenet/node/NodeIPDetector.java
trunk/freenet/src/freenet/node/NodeStats.java
trunk/freenet/src/freenet/node/TestnetHandler.java
trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
trunk/freenet/src/freenet/node/fcp/FCPServer.java
trunk/freenet/src/freenet/node/updater/NodeUpdaterManager.java
trunk/freenet/src/freenet/oldplugins/plugin/PluginManager.java
trunk/freenet/src/freenet/pluginmanager/PluginManager.java
Log:
Add more L10n hooks, hopefully without breaking anything.
I need help from a CSS expert.
Modified: trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
2007-04-14 22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
2007-04-14 22:15:51 UTC (rev 12732)
@@ -152,9 +152,8 @@
this.name = name;
sc.register(name+"_priority_policy", PRIORITY_HARD,
name.hashCode(), true, false,
- "Priority policy of the "+name+"scheduler",
- "Set the priority policy scheme used by the
scheduler. Could be one of ["+
- PRIORITY_HARD+", "+PRIORITY_SOFT+ ']',
+ "RequestStarterGroup.scheduler",
+ "RequestStarterGroup.schedulerLong",
new PrioritySchedulerCallback(this));
this.choosenPriorityScheduler =
sc.getString(name+"_priority_policy");
logMINOR = Logger.shouldLog(Logger.MINOR, this);
Modified: trunk/freenet/src/freenet/clients/http/BookmarkManager.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/BookmarkManager.java 2007-04-14
22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/clients/http/BookmarkManager.java 2007-04-14
22:15:51 UTC (rev 12732)
@@ -78,7 +78,7 @@
this.bookmarks = new Vector();
this.node = n;
this.uskcb = new USKUpdatedCallback();
- sc.register("bookmarks", n.isTestnetEnabled() ?
DEFAULT_TESTNET_BOOKMARKS : DEFAULT_DARKNET_BOOKMARKS, 0, true, false, "List of
bookmarks", "A list of bookmarked freesites", makeCB());
+ sc.register("bookmarks", n.isTestnetEnabled() ?
DEFAULT_TESTNET_BOOKMARKS : DEFAULT_DARKNET_BOOKMARKS, 0, true, false,
"BookmarkManager.list", "BookmarkManager.listLong", makeCB());
String[] initialbookmarks = sc.getStringArr("bookmarks");
for (int i = 0; i < initialbookmarks.length; i++) {
Modified: trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConfigToadlet.java 2007-04-14
22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/clients/http/ConfigToadlet.java 2007-04-14
22:15:51 UTC (rev 12732)
@@ -11,6 +11,7 @@
import freenet.config.Config;
import freenet.config.Option;
import freenet.config.SubConfig;
+import freenet.l10n.L10n;
import freenet.node.Node;
import freenet.node.NodeClientCore;
import freenet.support.HTMLNode;
@@ -147,7 +148,7 @@
HTMLNode configItemNode =
configGroupUlNode.addChild("li");
configItemNode.addChild("span", new
String[]{ "class", "title", "style" },
new String[]{
"configshortdesc", "The default for that configuration option is : '" +
- o[j].getDefault() +
'\'', "cursor: help;" }, o[j].getShortDesc());
+ o[j].getDefault() +
'\'', "cursor: help;" }).addChild(L10n.getHTMLNode(o[j].getShortDesc()));
HTMLNode configItemValueNode =
configItemNode.addChild("span", "class", "config");
if(o[j].getValueString() == null){
Logger.error(this,
sc[i].getPrefix() + configName + "has returned null from config!);");
@@ -165,7 +166,8 @@
}else{
configItemValueNode.addChild("input", new String[] { "type", "class", "alt",
"name", "value" }, new String[] { "text", "config", o[j].getShortDesc(),
sc[i].getPrefix() + '.' + configName, o[j].getValueString() });
}
- configItemNode.addChild("span",
"class", "configlongdesc", o[j].getLongDesc());
+
+ configItemNode.addChild("span",
"class", "configlongdesc").addChild(L10n.getHTMLNode(o[j].getLongDesc()));
}
}
Modified: trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
2007-04-14 22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
2007-04-14 22:15:51 UTC (rev 12732)
@@ -194,7 +194,7 @@
this.core = core;
int configItemOrder = 0;
- fproxyConfig.register("enabled", true, configItemOrder++, true,
true, "Enable FProxy?", "Whether to enable FProxy and related HTTP services",
+ fproxyConfig.register("enabled", true, configItemOrder++, true,
true, "SimpleToadletServer.enabled", "SimpleToadletServer.enabledLong",
new FProxyEnabledCallback());
boolean enabled = fproxyConfig.getBoolean("enabled");
@@ -240,17 +240,17 @@
}
}
- fproxyConfig.register("port", DEFAULT_FPROXY_PORT,
configItemOrder++, true, true, "FProxy port number", "FProxy port number",
+ fproxyConfig.register("port", DEFAULT_FPROXY_PORT,
configItemOrder++, true, true, "SimpleToadletServer.port",
"SimpleToadletServer.portLong",
new FProxyPortCallback());
- fproxyConfig.register("bindTo", "127.0.0.1", configItemOrder++,
true, true, "IP address to bind to", "IP address to bind to",
+ fproxyConfig.register("bindTo", "127.0.0.1", configItemOrder++,
true, true, "SimpleToadletServer.bindTo", "SimpleToadletServer.bindToLong",
new FProxyBindtoCallback());
- fproxyConfig.register("css", "clean", configItemOrder++, false,
false, "CSS Name", "Name of the CSS FProxy should use "+themes.toString(),
+ fproxyConfig.register("css", "clean", configItemOrder++, false,
false, "SimpleToadletServer.cssName", "SimpleToadletServer.cssNameLong",
new FProxyCSSNameCallback());
- fproxyConfig.register("advancedModeEnabled", false,
configItemOrder++, false, false, "Enable Advanced Mode?", "Whether to show or
not informations meant for advanced users/devs. This setting should be turned
to false in most cases.",
+ fproxyConfig.register("advancedModeEnabled", false,
configItemOrder++, false, false, "SimpleToadletServer.advancedMode",
"SimpleToadletServer.advancedModeLong",
new FProxyAdvancedModeEnabledCallback(this));
- fproxyConfig.register("javascriptEnabled", false,
configItemOrder++, false, false, "Enable FProxy use of Javascript?", "Whether
or not FProxy should use Javascript \"helpers\". This setting should be turned
to false in most cases. Note that freesites may not use javascript even if this
is enabled.",
+ fproxyConfig.register("javascriptEnabled", false,
configItemOrder++, false, false, "SimpleToadletServer.enableJS",
"SimpleToadletServer.enableJSLong",
new FProxyJavascriptEnabledCallback(this));
- fproxyConfig.register("showPanicButton", false,
configItemOrder++, true, true, "Show the panic button?", "Whether to show or
not the panic button on the /queue/ page.",
+ fproxyConfig.register("showPanicButton", false,
configItemOrder++, true, true, "SimpleToadletServer.panicButton",
"SimpleToadletServer.panicButtonLong",
new BooleanCallback(){
public boolean get(){
return
SimpleToadletServer.isPanicButtonToBeShown;
@@ -261,13 +261,10 @@
else
SimpleToadletServer.isPanicButtonToBeShown = value;
}
});
- fproxyConfig.register("allowedHosts",
"127.0.0.1,0:0:0:0:0:0:0:1", configItemOrder++, true, true, "Allowed hosts",
- "Hostnames or IP addresses that are allowed to
connect to FProxy. " +
- "May be a comma-separated list of single IPs
and CIDR masked IPs like 192.168.0.0/24. ",
+ fproxyConfig.register("allowedHosts",
"127.0.0.1,0:0:0:0:0:0:0:1", configItemOrder++, true, true,
"SimpleToadletServer.allowedHosts", "SimpleToadletServer.allowedHostsLong",
new FProxyAllowedHostsCallback());
- fproxyConfig.register("allowedHostsFullAccess",
"127.0.0.1,0:0:0:0:0:0:0:1", configItemOrder++, true, true, "Hosts having a
full access to Fproxy (read warning)",
- "Hosts granted full access (i.e. change config
settings, restart, access hard disk, etc) to the node" +
- "WARNING: Be very careful who you give full
fproxy access to!",
+ fproxyConfig.register("allowedHostsFullAccess",
"127.0.0.1,0:0:0:0:0:0:0:1", configItemOrder++, true, true,
"SimpleToadletServer.allowedFullAccess",
+ "SimpleToadletServer.allowedFullAccessLong",
new StringCallback() {
public String get() {
Modified: trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
2007-04-14 22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
2007-04-14 22:15:51 UTC (rev 12732)
@@ -24,8 +24,7 @@
super(client);
this.node = node;
tslconfig = new SubConfig("toadletsymlinker", node.config);
- tslconfig.register("symlinks", null, 9, true, false, "Symlinks
in ToadletServer",
- "A list of \"alias#target\"'s that forms a
bunch of symlinks",
+ tslconfig.register("symlinks", null, 9, true, false,
"SymlinkerToadlet.symlinks", "SymlinkerToadlet.symlinksLong",
new StringArrCallback() {
public String[] get() {
return getConfigLoadString();
Modified: trunk/freenet/src/freenet/l10n/L10n.java
===================================================================
--- trunk/freenet/src/freenet/l10n/L10n.java 2007-04-14 22:15:43 UTC (rev
12731)
+++ trunk/freenet/src/freenet/l10n/L10n.java 2007-04-14 22:15:51 UTC (rev
12732)
@@ -64,6 +64,15 @@
}
/**
+ * Set the default language used by the framework. (called from the
TranslationHelper plugin)
+ *
+ * @param a property file
+ */
+ public static void setLanguage(Properties customLanguage) {
+ currentProperties = customLanguage;
+ }
+
+ /**
* The real meat
*
* Same thing as getString(key, false);
@@ -97,8 +106,11 @@
String value = getString(key, true);
if(value != null)
return new HTMLNode("#", value);
- else
- return new HTMLNode("#",
getDefaultString(value)).addChild("span", "id", "translate_it").addChild("a",
"href", "/?translate=" + key).addChild("small", " (translate it in your native
language!)");
+ HTMLNode translationField = new HTMLNode("span", "class",
"translate_it") ;
+ translationField.addChild("#", getDefaultString(key));
+ translationField.addChild("a", "href", "/?translate=" +
key).addChild("small", " (translate it in your native language!)");
+
+ return translationField;
}
public static String getDefaultString(String key) {
Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2007-04-14
22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2007-04-14
22:15:51 UTC (rev 12732)
@@ -101,4 +101,144 @@
FcpServer.assumeDownloadDDAIsAllowed=Assume that download DDA is allowed ?
FcpServer.assumeDownloadDDAIsAllowedLong=Assume that download DDA is allowed ?
if false, you have to issue a TestDDARequest before making any DDA access.
FcpServer.assumeUploadDDAIsAllowed=Assume that upload DDA is allowed ?
-FcpServer.assumeUploadDDAIsAllowedLong=Assume that upload DDA is allowed ? if
false, you have to issue a TestDDARequest before making any DDA access.
\ No newline at end of file
+FcpServer.assumeUploadDDAIsAllowedLong=Assume that upload DDA is allowed ? if
false, you have to issue a TestDDARequest before making any DDA access.
+TestnetHandler.enable=Enable testnet mode? (DANGEROUS)
+TestnetHandler.enableLong=Whether to enable testnet mode (DANGEROUS!). Testnet
mode eliminates your anonymity in exchange for greatly assisting the developers
in debugging the node.
+TestnetHandler.port=Testnet port
+TestnetHandler.portLong=Testnet port number (-1 = listenPort+1000)
+TextModeClientInterfaceServer.enabled=Enable TMCI
+TextModeClientInterfaceServer.enabledLong=Whether to enable the TMCI
+TextModeClientInterfaceServer.bindTo=IP address to bind to
+TextModeClientInterfaceServer.bindToLong=IP address to bind to
+TextModeClientInterfaceServer.allowedHosts=Allowed hosts
+TextModeClientInterfaceServer.allowedHostsLong=Hostnames or IP addresses that
are allowed to connect to the TMCI. May be a comma-separated list of hostnames,
single IPs and even CIDR masked IPs like 192.168.0.0/24
+TextModeClientInterfaceServer.telnetPortNumber=Telnet port
+TextModeClientInterfaceServer.telnetPortNumberLong=Telnet port number
+TextModeClientInterfaceServer.enableInputOutput=Enable on stdout/stdin?
+TextModeClientInterfaceServer.enableInputOutputLong=Enable text mode client
interface on standard input/output? (.enabled refers to providing a
telnet-style server, this runs it over a socket)
+Node.disablePHTLS=Disable probabilistic HTL
+Node.disablePHTLSLong=Disable probabilistic HTL (don't touch this unless you
know what you are doing)
+Node.maxHTL=Maximum HTL
+Node.maxHTLLong=Maximum HTL (FOR DEVELOPER USE ONLY!)
+Node.bindTo=IP address to bind to
+Node.bindToLong=IP address to bind to
+Node.port=FNP port number (UDP)
+Node.portLong=UDP port for node-to-node communications (Freenet Node Protocol)
+Node.dropPacketEvery=Testing packet drop frequency
+Node.dropPacketEveryLong=Frequency of dropping packets. Testing option used by
devs to simulate packet loss. 0 means never artificially drop a packet. Don't
touch this!
+Node.outBWLimit=Output bandwidth limit (bytes per second)
+Node.outBWLimitLong=Hard output bandwidth limit (bytes/sec); the node should
almost never exceed this
+Node.inBWLimit=Input bandwidth limit (bytes per second)
+Node.inBWLimitLong=Input bandwidth limit (bytes/sec); the node will try not to
exceed this; -1 = 4x set outputBandwidthLimit
+Node.swapRInterval=Swap request send interval (ms)
+Node.swapRIntervalLong=Interval between swap attempting to send swap requests
in milliseconds. Leave this alone!
+Node.nodeDir=Node directory
+Node.nodeDirLong=Name of directory to put node-related files e.g. peers list in
+Node.extraPeerDir=Extra peer data directory
+Node.extraPeerDirLong=Name of directory to put extra peer data in
+Node.nodeName=Nickname for this Freenet node
+Node.nodeNameLong=Node nickname. This will be visible to your friends only.
+Node.forceBigShrink=Do large store shrinks immediately
+Node.forceBigShrinkLong=Whether to do large store shrinks (over 10%)
immediately (rather than waiting for the next node restart). Online shrinks do
not preserve the most recently used data, so this is not recommended; use it
only if you must have an immediate result.
+Node.storeSize=Store size in bytes
+Node.storeSizeLong=Store size in bytes
+Node.storeDirectory=Store directory
+Node.storeDirectoryLong=Name of directory to put store files in
+Node.databaseMemory=Datastore maximum memory usage
+Node.databaseMemoryLong=Maximum memory usage of the database backing the
datastore indexes. 0 means no limit (limited to ~ 30% of maximum memory)
+Node.disableHangCheckers=Disable all hang checkers
+Node.disableHangCheckersLong=Disable all hang checkers/watchdog functions. Set
this if you are profiling Fred.
+Node.l10nLanguage=The language the node will use to display messages
+Node.l10nLanguageLong=This setting will change the language used to display
messages. Choose from [en|fr|pl]. Keep in mind that some strings won't be
translated until next node startup though.
+NodeUpdateManager.enabled=Check for, and download new versions
+NodeUpdateManager.enabledLong=Should your node automatically check for new
versions of Freenet. If yes, new versions will be automatically detected and
downloaded, but not necessarily installed. This setting resets itself always
back to false unless the node runs within the wrapper.
+NodeUpdateManager.installNewVersions=Automatically install new versions
+NodeUpdateManager.installNewVersionsLong=Should your node automatically update
to the newest version of Freenet, without asking?
+NodeUpdateManager.updateURI=Where should the node look for updates?
+NodeUpdateManager.updateURILong=Where should the node look for updates?
+NodeUpdateManager.revocationURI=Where should the node look for the revocation
key ?
+NodeUpdateManager.revocationURILong=URI for the revocation key. If this is
found the node will display its contents and disable the auto-updater.
+NodeUpdateManager.extURI=Where should the node look for updates to
freenet-ext.jar?
+NodeUpdateManager.extURILong=Where should the node look for updates to
freenet-ext.jar?
+PluginManager.loadedPlugins=Plugins to load on start up
+PluginManager.loadedPluginsLong=A list of plugins that are started when the
node starts
+PluginManager.loadedOnStartup=Plugins to load on startup
+PluginManager.loadedOnStartupLong=Classpath, name and location for plugins to
load when node starts up
+RequestStarterGroup.scheduler=Priority policy of the scheduler
+RequestStarterGroup.schedulerLong=Set the priority policy scheme used by the
scheduler. Could be one of [SOFT|HARD]
+SimpleToadletServer.enabled=Enable FProxy?
+SimpleToadletServer.enabledLong=Whether to enable FProxy and related HTTP
services
+SimpleToadletServer.bindTo=IP address to bind to
+SimpleToadletServer.bindToLong=IP address to bind to
+SimpleToadletServer.port=FProxy port number
+SimpleToadletServer.portLong=FProxy port number
+SimpleToadletServer.cssName=CSS Name
+SimpleToadletServer.cssNameLong=Name of the CSS FProxy should use
+SimpleToadletServer.advancedMode=Enable Advanced Mode?
+SimpleToadletServer.advancedModeLong=Whether to show or not informations meant
for advanced users/devs. This setting should be turned to false in most cases.
+SimpleToadletServer.enableJS=Enable FProxy use of Javascript?
+SimpleToadletServer.enableJSLong=Whether or not FProxy should use Javascript
\"helpers\". This setting should be turned to false in most cases. Note that
freesites may not use javascript even if this is enabled.
+SimpleToadletServer.panicButton=Show the panic button?
+SimpleToadletServer.panicButtonLong=Whether to show or not the panic button on
the /queue/ page.
+SimpleToadletServer.allowedHosts=Hostnames or IP addresses that are allowed to
connect to FProxy.
+SimpleToadletServer.allowedHostsLong=May be a comma-separated list of single
IPs and CIDR masked IPs like 192.168.0.0/24.
+SimpleToadletServer.allowedFullAccess=Hosts having a full access to Fproxy
(read warning)
+SimpleToadletServer.allowedFullAccessLong=Hosts granted full access (i.e.
change config settings, restart, access hard disk, etc) to the node. WARNING:
Be very careful who you give full fproxy access to!
+LogConfigHandler.enabled=Enable logging?
+LogConfigHandler.enabledLong=Set to false to completely disable logging
+LogConfigHandler.dirName=Logging directory
+LogConfigHandler.dirNameLong=Directory into which to put log files
+LogConfigHandler.maxZippedLogsSize=Maximum disk space used by old logs
+LogConfigHandler.maxZippedLogsSizeLong=Maximum disk space used by old logs
+LogConfigHandler.minLoggingPriority=Minimum priority to log messages at
+LogConfigHandler.minLoggingPriorityLong=Minimum priority at which messages are
logged. options are debug, minor, normal, error, in order of diminishing
verbosity
+LogConfigHandler.detaildPriorityThreshold=Detailed priority thresholds
+LogConfigHandler.detaildPriorityThresholdLong=LogConfigHandler.detaildPriorityThresholdLongLogConfigHandler.detaildPriorityThresholdLongDetailed
priority thresholds, example freenet:normal,freenet.node:minor
+LogConfigHandler.rotationInterval=Log rotation interval
+LogConfigHandler.rotationIntervalLong=Log rotation interval - period after
which logs are rotated. We keep the last two log files (current and prev), plus
lots of compressed logfiles up to maxZippedLogsSize
+LogConfigHandler.maxCachedBytes=Max cached log bytes in RAM
+LogConfigHandler.maxCachedBytesLong=Maximum number of bytes of logging cached
in RAM
+LogConfigHandler.maxCachedLines=Max cached log lines in RAM
+LogConfigHandler.maxCachedLinesLong=Maximum number of lines of logging cached
in RAM
+SymlinkerToadlet.symlinks=Symlinks in ToadletServer
+SymlinkerToadlet.symlinksLong=A list of \"alias#target\"'s that forms a bunch
of symlinks
+BookmarkManager.list=List of bookmarks
+BookmarkManager.listLong=A list of bookmarked freesites
+NodeIPDectector.ipOverride=IP address override
+NodeIPDectector.ipOverrideLong=IP address override (not usually needed) - set
this if you have a static IP address or a domain name (e.g. dyndns), and you
are behind a firewall.
+NodeIPDectector.tempAddressHint=Temporary IP address hint
+NodeIPDectector.tempAddressHintLong=Temporary hint to what our IP might be;
deleted after use
+NodeIPDectector.inclLocalAddress=Include local addresses in noderef
+NodeIPDectector.inclLocalAddressLong=Whether to include local addresses (LAN
and localhost) in node references. This will not be useful unless the both
sides set allowLocalAddresses=true for the respective references (use the
Darknet page in advanced mode to set this flag).
+NodeClientCore.allowInsecureCHK=Allow insecure CHKs?
+NodeClientCore.allowInsecureCHKLong=Before 1010, all CHKs were insecure (only
half encrypted). Allow old CHKs?
+NodeClientCore.allowInsecureSSK=Allow insecure SSKs?
+NodeClientCore.allowInsecureSSKLong=Before 1010, all SSKs were insecure (only
half encrypted). Allow old SSKs?
+NodeClientCore.lazyResume=Complete loading of persistent requests after
startup? (Uses more memory)
+NodeClientCore.lazyResumeLong=The node can load persistent queued requests
during startup, or it can read the data into memory and then complete the
request resuming process after the node has started up. Shorter start-up times,
but uses more memory.
+NodeClientCore.ignoreTooManyPathComponents=Ignore too many path components
+NodeClientCore.ignoreTooManyPathComponentsLong=If true, the node won't
generate TOO_MANY_PATH_COMPONENTS errors when a URI is fed to it which has
extra, meaningless subdirs (/blah/blah) on the end beyond what is needed to
fetch the key (for example, old CHKs will often have filenames stuck on the end
which weren't part of the original insert; this is obsolete because we can now
include the filename, and it is confusing to be able to add arbitrary strings
to a URI, and it makes them hard to compare). Only enable this option if you
need it for compatibility with older apps; it will be removed soon.
+NodeClientCore.fileForClientStats=File to store client statistics in
+NodeClientCore.fileForClientStatsLong=File to store client throttling
statistics in (used to decide how often to send requests)
+NodeClientCore.tempDir=Temp files directory
+NodeClientCore.tempDirLong=Name of directory to put temporary files in
+NodeClientCore.persistentTempDir=Persistent temp files directory
+NodeClientCore.persistentTempDirLong=Name of directory to put persistent temp
files in
+NodeClientCore.downloadDir=Default download directory
+NodeClientCore.downloadDirLong=The directory to save downloaded files into by
default
+NodeClientCore.downloadAllowedDirs=Directories downloading is allowed to
+NodeClientCore.downloadAllowedDirsLong=Semicolon separated list of directories
to which downloads are allowed. \"downloads\" means downloadsDir, empty means
no downloads to disk allowed, \"all\" means downloads allowed from anywhere.
WARNING! If this is set to "all" any user can download any file to anywhere on
your computer!
+NodeClientCore.uploadAllowedDirs=Directories uploading is allowed from
+NodeClientCore.uploadAllowedDirsLong=Semicolon separated list of directories
from which uploads are allowed. Empty means no uploads from disk allowed, "all"
means uploads allowed from anywhere (including system files etc!). WARNING! If
this is set to \"all\" any file on your computer can be uploaded by any user.
+NodeStat.threadLimit=Thread limit
+NodeStat.threadLimitLong=The node will try to limit its thread usage to the
specified value, refusing new requests
+NodeStat.aggressiveGC=AggressiveGC modificator
+NodeStat.aggressiveGCLong=Enables the user to tweak the time in between GC and
forced finalization. SHOULD NOT BE CHANGED unless you know what you're doing!
-1 means : disable forced call to System.gc() and System.runFinalization()
+NodeStat.memCheck=Enable the Memory check
+NodeStat.memCheckLong=Enable the memory check (writes a message in logfile,
mandatory for aggressiveGCModificator to have any effect!)
+NodeStat.freeHeapBytesThreshold=Free heap bytes threshold
+NodeStat.freeHeapBytesThresholdLong=The node will try to keep it's free heap
bytes above the threshold by refusing new requests
+NodeStat.freeHeapPercentThreshold=Free heap precent threshold
+NodeStat.freeHeapPercentThresholdLong=The node will try to keep it's free heap
precentage (of max heap bytes allowed) above the threshold by refusing new
requests
+NodeStat.statsPersister=File to store node statistics in
+NodeStat.statsPersisterLong=File to store node statistics in (not client
statistics, and these are used to decide whether to accept requests so please
don't delete)
Modified: trunk/freenet/src/freenet/node/LoggingConfigHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/LoggingConfigHandler.java 2007-04-14
22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/node/LoggingConfigHandler.java 2007-04-14
22:15:51 UTC (rev 12732)
@@ -34,7 +34,7 @@
public LoggingConfigHandler(SubConfig loggingConfig) throws
InvalidConfigValueException {
this.config = loggingConfig;
- loggingConfig.register("enabled", true, 1, true, false, "Enable
logging?", "Set to false to completely disable logging",
+ loggingConfig.register("enabled", true, 1, true, false,
"LogConfigHandler.enabled", "LogConfigHandler.enabledLong",
new BooleanCallback() {
public boolean get() {
return fileLoggerHook != null;
@@ -50,7 +50,7 @@
boolean loggingEnabled = loggingConfig.getBoolean("enabled");
- loggingConfig.register("dirname", "logs", 2, true, false, "Logging
directory", "Directory into which to put log files",
+ loggingConfig.register("dirname", "logs", 2, true, false,
"LogConfigHandler.dirName", "LogConfigHandler.dirNameLong",
new StringCallback() {
public String get() {
@@ -80,7 +80,7 @@
// max space used by zipped logs
- config.register("maxZippedLogsSize", "128M", 3, true, true, "Maximum
disk space used by old logs", "Maximum disk space used by old logs",
+ config.register("maxZippedLogsSize", "128M", 3, true, true,
"LogConfigHandler.maxZippedLogsSize", "LogConfigHandler.maxZippedLogsSizeLong",
new LongCallback() {
public long get() {
return maxZippedLogsSize;
@@ -101,7 +101,7 @@
// priority
// Node must override this to minor on testnet.
- config.register("priority", "normal", 4, false, false, "Minimum
priority to log messages at", "Minimum priority at which messages are logged.
options are debug, minor, normal, error, in order of diminishing verbosity",
+ config.register("priority", "normal", 4, false, false,
"LogConfigHandler.minLoggingPriority",
"LogConfigHandler.minLoggingPriorityLong",
new StringCallback() {
public String get() {
LoggerHookChain chain =
Logger.getChain();
@@ -119,7 +119,7 @@
// detailed priority
- config.register("priorityDetail", "", 5, true, false, "Detailed
priority thresholds", "Detailed priority thresholds, example
freenet:normal,freenet.node:minor",
+ config.register("priorityDetail", "", 5, true, false,
"LogConfigHandler.detaildPriorityThreshold",
"LogConfigHandler.detaildPriorityThresholdLong",
new StringCallback() {
public String get() {
@@ -141,7 +141,7 @@
// interval
- config.register("interval", "1HOUR", 5, true, false, "Log rotation
interval", "Log rotation interval - period after which logs are rotated. We
keep the last two log files (current and prev), plus lots of compressed
logfiles up to maxZippedLogsSize",
+ config.register("interval", "1HOUR", 5, true, false,
"LogConfigHandler.rotationInterval", "LogConfigHandler.rotationIntervalLong",
new StringCallback() {
public String get() {
return logRotateInterval;
@@ -163,7 +163,7 @@
logRotateInterval = config.getString("interval");
// max cached bytes in RAM
- config.register("maxCachedBytes", "10M", 6, true, false, "Max cached
log bytes in RAM", "Maximum number of bytes of logging cached in RAM",
+ config.register("maxCachedBytes", "10M", 6, true, false,
"LogConfigHandler.maxCachedBytes", "LogConfigHandler.maxCachedBytesLong",
new LongCallback() {
public long get() {
return maxCachedLogBytes;
@@ -180,7 +180,7 @@
maxCachedLogBytes = config.getLong("maxCachedBytes");
// max cached lines in RAM
- config.register("maxCachedLines", "100k", 7, true, false, "Max cached
log lines in RAM", "Maximum number of lines of logging cached in RAM",
+ config.register("maxCachedLines", "100k", 7, true, false,
"LogConfigHandler.maxCachedLines", "LogConfigHandler.maxCachedLinesLong",
new IntCallback() {
public int get() {
return maxCachedLogLines;
Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java 2007-04-14 22:15:43 UTC (rev
12731)
+++ trunk/freenet/src/freenet/node/Node.java 2007-04-14 22:15:51 UTC (rev
12732)
@@ -104,7 +104,6 @@
import freenet.support.Logger;
import freenet.support.ShortBuffer;
import freenet.support.SimpleFieldSet;
-import freenet.support.StringArray;
import freenet.support.api.BooleanCallback;
import freenet.support.api.IntCallback;
import freenet.support.api.LongCallback;
@@ -718,7 +717,7 @@
// Setup node-specific configuration
SubConfig nodeConfig = new SubConfig("node", config);
- nodeConfig.register("disableProbabilisticHTLs", false,
sortOrder++, true, false, "Disable probabilistic HTL", "Disable probabilistic
HTL (don't touch this unless you know what you are doing)",
+ nodeConfig.register("disableProbabilisticHTLs", false,
sortOrder++, true, false, "Node.disablePHTLS", "Node.disablePHTLSLong",
new BooleanCallback() {
public boolean get() {
@@ -733,8 +732,7 @@
disableProbabilisticHTLs =
nodeConfig.getBoolean("disableProbabilisticHTLs");
- nodeConfig.register("maxHTL", DEFAULT_MAX_HTL, sortOrder++,
true, false, "Maximum HTL", "Maximum HTL (FOR DEVELOPER USE ONLY!)",
- new ShortCallback() {
+ nodeConfig.register("maxHTL", DEFAULT_MAX_HTL, sortOrder++,
true, false, "Node.maxHTL", "Node.maxHTLLong", new ShortCallback() {
public short get() {
return maxHTL;
@@ -758,15 +756,13 @@
// Determine where to bind to
- nodeConfig.register("bindTo", "0.0.0.0", sortOrder++, true,
true, "IP address to bind to", "IP address to bind to",
- new NodeBindtoCallback(this));
+ nodeConfig.register("bindTo", "0.0.0.0", sortOrder++, true,
true, "Node.bindTo", "Node.bindToLong", new NodeBindtoCallback(this));
this.bindto = nodeConfig.getString("bindTo");
// Determine the port number
- nodeConfig.register("listenPort", -1 /* means random */,
sortOrder++, true, true, "FNP port number (UDP)", "UDP port for node-to-node
communications (Freenet Node Protocol)",
- new IntCallback() {
+ nodeConfig.register("listenPort", -1 /* means random */,
sortOrder++, true, true, "Node.port", "Node.portLong", new IntCallback() {
public int get() {
return portNumber;
}
@@ -823,7 +819,7 @@
System.out.println("FNP port created on "+bindto+ ':' +port);
portNumber = port;
- nodeConfig.register("testingDropPacketsEvery", 0, sortOrder++,
true, false, "Testing packet drop frequency", "Frequency of dropping packets.
Testing option used by devs to simulate packet loss. 0 means never artificially
drop a packet. Don't touch this!",
+ nodeConfig.register("testingDropPacketsEvery", 0, sortOrder++,
true, false, "Node.dropPacketEvery", "Node.dropPacketEveryLong",
new IntCallback() {
public int get() {
@@ -843,9 +839,7 @@
// Bandwidth limit
- nodeConfig.register("outputBandwidthLimit", "15K", sortOrder++,
false, true,
- "Output bandwidth limit (bytes per second)",
"Hard output bandwidth limit (bytes/sec); the node should almost never exceed
this",
- new IntCallback() {
+ nodeConfig.register("outputBandwidthLimit", "15K", sortOrder++,
false, true, "Node.outBWLimit", "Node.outBWLimitLong", new IntCallback() {
public int get() {
//return
BlockTransmitter.getHardBandwidthLimit();
return outputBandwidthLimit;
@@ -866,9 +860,7 @@
outputBandwidthLimit = obwLimit;
outputThrottle = new DoubleTokenBucket(obwLimit/2,
(1000L*1000L*1000L) / obwLimit, obwLimit, (obwLimit * 2) / 5);
- nodeConfig.register("inputBandwidthLimit", "-1", sortOrder++,
false, true,
- "Input bandwidth limit (bytes per second)",
"Input bandwidth limit (bytes/sec); the node will try not to exceed this; -1 =
4x set outputBandwidthLimit",
- new IntCallback() {
+ nodeConfig.register("inputBandwidthLimit", "-1", sortOrder++,
false, true, "Node.inBWLimit", "Node.inBWLimitLong", new IntCallback() {
public int get() {
if(inputLimitDefault) return -1;
return inputBandwidthLimit;
@@ -900,7 +892,7 @@
// SwapRequestInterval
nodeConfig.register("swapRequestSendInterval",
DEFAULT_SWAP_INTERVAL, sortOrder++, true, false,
- "Swap request send interval (ms)", "Interval
between swap attempting to send swap requests in milliseconds. Leave this
alone!",
+ "Node.swapRInterval", "Node.swapRIntervalLong",
new IntCallback() {
public int get() {
return
swapInterval.fixedInterval;
@@ -953,7 +945,7 @@
// Directory for node-related files other than store
- nodeConfig.register("nodeDir", ".", sortOrder++, true, false,
"Node directory", "Name of directory to put node-related files e.g. peers list
in",
+ nodeConfig.register("nodeDir", ".", sortOrder++, true, false,
"Node.nodeDir", "Node.nodeDirLong",
new StringCallback() {
public String get() {
return nodeDir.getPath();
@@ -999,7 +991,7 @@
usm.setLowLevelFilter(packetMangler = new
FNPPacketMangler(this));
// Extra Peer Data Directory
- nodeConfig.register("extraPeerDataDir", new File(nodeDir,
"extra-peer-data-"+portNumber).toString(), sortOrder++, true, false, "Extra
peer data directory", "Name of directory to put extra peer data in",
+ nodeConfig.register("extraPeerDataDir", new File(nodeDir,
"extra-peer-data-"+portNumber).toString(), sortOrder++, true, false,
"Node.extraPeerDir", "Node.extraPeerDirLong",
new StringCallback() {
public String get() {
return
extraPeerDataDir.getPath();
@@ -1017,13 +1009,13 @@
}
// Name
- nodeConfig.register("name", myName, sortOrder++, false, true,
"Nickname for this Freenet node", "Node nickname. This will be visible to your
friend peers (but will not be visible to opennet peers). E.g. Fred Blogg's.",
+ nodeConfig.register("name", myName, sortOrder++, false, true,
"Node.nodeName", "Node.nodeNameLong",
new NodeNameCallback(this));
myName = nodeConfig.getString("name");
// Datastore
- nodeConfig.register("storeForceBigShrinks", false, sortOrder++,
true, false, "Do large store shrinks immediately", "Whether to do large store
shrinks (over 10%) immediately (rather than waiting for the next node restart).
Online shrinks do not preserve the most recently used data, so this is not
recommended; use it only if you must have an immediate result.",
+ nodeConfig.register("storeForceBigShrinks", false, sortOrder++,
true, false, "Node.forceBigShrink", "Node.forceBigShrinkLong",
new BooleanCallback() {
public boolean get() {
@@ -1040,7 +1032,7 @@
});
- nodeConfig.register("storeSize", "1G", sortOrder++, false,
true, "Store size in bytes", "Store size in bytes",
+ nodeConfig.register("storeSize", "1G", sortOrder++, false,
true, "Node.storeSize", "Node.storeSizeLong",
new LongCallback() {
public long get() {
@@ -1087,7 +1079,7 @@
maxTotalKeys = maxTotalDatastoreSize / sizePerKey;
- nodeConfig.register("storeDir", ".", sortOrder++, true, false,
"Store directory", "Name of directory to put store files in",
+ nodeConfig.register("storeDir", ".", sortOrder++, true, false,
"Node.storeDirectory", "Node.storeDirectoryLong",
new StringCallback() {
public String get() {
return storeDir.getPath();
@@ -1184,7 +1176,7 @@
}
});
- nodeConfig.register("databaseMaxMemory", "20M", sortOrder++,
true, false, "Datastore maximum memory usage", "Maximum memory usage of the
database backing the datastore indexes. 0 means no limit (limited to ~ 30% of
maximum memory)",
+ nodeConfig.register("databaseMaxMemory", "20M", sortOrder++,
true, false, "Node.databaseMemory", "Node.databaseMemoryLong",
new LongCallback() {
public long get() {
@@ -1295,7 +1287,7 @@
clientCore = new NodeClientCore(this, config, nodeConfig,
nodeDir, portNumber, sortOrder, oldThrottleFS == null ? null :
oldThrottleFS.subset("RequestStarters"));
- nodeConfig.register("disableHangCheckers", false, sortOrder++,
true, false, "Disable all hang checkers", "Disable all hang checkers/watchdog
functions. Set this if you are profiling Fred.", new BooleanCallback() {
+ nodeConfig.register("disableHangCheckers", false, sortOrder++,
true, false, "Node.disableHangCheckers", "Node.disableHangCheckersLong", new
BooleanCallback() {
public boolean get() {
return disableHangCheckers;
@@ -1311,10 +1303,8 @@
// l10n stuffs
nodeConfig.register("l10n", "en", sortOrder++, false, true,
- "The language the node will use to display
messages",
- "This setting will change the language used to
display messages. " +
- "Choose from " +
StringArray.toString(L10n.availableLanguages) + ". " +
- "Keep in mind that some strings won't be
translated until next node startup though.",
+ "Node.l10nLanguage",
+ "Node.l10nLanguageLong",
new StringCallback(){
public String get() {
Modified: trunk/freenet/src/freenet/node/NodeClientCore.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeClientCore.java 2007-04-14 22:15:43 UTC
(rev 12731)
+++ trunk/freenet/src/freenet/node/NodeClientCore.java 2007-04-14 22:15:51 UTC
(rev 12732)
@@ -124,7 +124,7 @@
logMINOR = Logger.shouldLog(Logger.MINOR, this);
persister = new ConfigurablePersister(this, nodeConfig,
"clientThrottleFile", "client-throttle.dat", sortOrder++, true, false,
- "File to store client statistics in", "File to
store client throttling statistics in (used to decide how often to send
requests)", node.ps);
+ "NodeClientCore.fileForClientStats",
"NodeClientCore.fileForClientStatsLong", node.ps);
SimpleFieldSet throttleFS = persister.read();
@@ -138,7 +138,7 @@
// Temp files
- nodeConfig.register("tempDir", new File(nodeDir,
"temp-"+portNumber).toString(), sortOrder++, true, false, "Temp files
directory", "Name of directory to put temporary files in",
+ nodeConfig.register("tempDir", new File(nodeDir,
"temp-"+portNumber).toString(), sortOrder++, true, false,
"NodeClientCore.tempDir", "NodeClientCore.tempDirLong",
new StringCallback() {
public String get() {
return tempDir.getPath();
@@ -164,7 +164,7 @@
}
// Persistent temp files
- nodeConfig.register("persistentTempDir", new File(nodeDir,
"persistent-temp-"+portNumber).toString(), sortOrder++, true, false,
"Persistent temp files directory", "Name of directory to put persistent temp
files in",
+ nodeConfig.register("persistentTempDir", new File(nodeDir,
"persistent-temp-"+portNumber).toString(), sortOrder++, true, false,
"NodeClientCore.persistentTempDir", "NodeClientCore.persistentTempDirLong",
new StringCallback() {
public String get() {
return
persistentTempBucketFactory.getDir().toString();
@@ -188,7 +188,7 @@
// Downloads directory
- nodeConfig.register("downloadsDir", "downloads", sortOrder++,
true, true, "Default download directory", "The directory to save downloaded
files into by default", new StringCallback() {
+ nodeConfig.register("downloadsDir", "downloads", sortOrder++,
true, true, "NodeClientCore.downloadDir", "NodeClientCore.downloadDirLong", new
StringCallback() {
public String get() {
return downloadDir.getPath();
@@ -214,9 +214,8 @@
// Downloads allowed, uploads allowed
- nodeConfig.register("downloadAllowedDirs", new String[]
{"all"}, sortOrder++, true, true, "Directories downloading is allowed to",
- "Semicolon separated list of directories to
which downloads are allowed. \"downloads\" means downloadsDir, empty means no
downloads to disk allowed, \"all\" means downloads allowed from anywhere. "+
- "WARNING! If this is set to \"all\" any user
can download any file to anywhere on your computer!",
+ nodeConfig.register("downloadAllowedDirs", new String[]
{"all"}, sortOrder++, true, true, "NodeClientCore.downloadAllowedDirs",
+ "NodeClientCore.downloadAllowedDirsLong",
new StringArrCallback() {
public String[] get() {
@@ -240,9 +239,8 @@
nodeConfig.fixOldDefault("downloadAllowedDirs",
"downloads");
setDownloadAllowedDirs(nodeConfig.getStringArr("downloadAllowedDirs"));
- nodeConfig.register("uploadAllowedDirs", new String[] {"all"},
sortOrder++, true, true, "Directories uploading is allowed from",
- "Semicolon separated list of directories from
which uploads are allowed. Empty means no uploads from disk allowed, \"all\"
means uploads allowed from anywhere (including system files etc!)."+
- "WARNING! If this is set to \"all\" any file on
your computer can be uploaded by any user.",
+ nodeConfig.register("uploadAllowedDirs", new String[] {"all"},
sortOrder++, true, true, "NodeClientCore.uploadAllowedDirs",
+ "NodeClientCore.uploadAllowedDirsLong",
new StringArrCallback() {
public String[] get() {
@@ -274,8 +272,8 @@
// FIXME remove this code, the new behaviour should be handled
by all clients
- nodeConfig.register("ignoreTooManyPathComponents", false,
sortOrder++, true, false, "Ignore too many path components",
- "If true, the node won't generate
TOO_MANY_PATH_COMPONENTS errors when a URI is fed to it which has extra,
meaningless subdirs (/blah/blah) on the end beyond what is needed to fetch the
key (for example, old CHKs will often have filenames stuck on the end which
weren't part of the original insert; this is obsolete because we can now
include the filename, and it is confusing to be able to add arbitrary strings
to a URI, and it makes them hard to compare). Only enable this option if you
need it for compatibility with older apps; it will be removed soon.", new
BooleanCallback() {
+ nodeConfig.register("ignoreTooManyPathComponents", false,
sortOrder++, true, false, "NodeClientCore.ignoreTooManyPathComponents",
+
"NodeClientCore.ignoreTooManyPathComponentsLong", new BooleanCallback() {
public boolean get() {
return
ignoreTooManyPathComponents;
@@ -291,9 +289,8 @@
ignoreTooManyPathComponents =
nodeConfig.getBoolean("ignoreTooManyPathComponents");
- nodeConfig.register("lazyResume", false, sortOrder++, true,
false, "Complete loading of persistent requests after startup? (Uses more
memory)",
- "The node can load persistent queued requests
during startup, or it can read the data into memory and then complete the
request resuming process after the node has started up. "+
- "Shorter start-up times, but uses more
memory.", new BooleanCallback() {
+ nodeConfig.register("lazyResume", false, sortOrder++, true,
false, "NodeClientCore.lazyResume",
+ "NodeClientCore.lazyResumeLong", new
BooleanCallback() {
public boolean get() {
return lazyResume;
@@ -313,7 +310,7 @@
// REDFLAG normally we wouldn't use static variables to carry
important non-final data, but in this
// case it's temporary code which will be removed before 0.7.0.
- nodeConfig.register("allowInsecureCHKs", true, sortOrder++,
true, false, "Allow insecure CHKs?", "Before 1010, all CHKs were insecure (only
half encrypted). Allow old CHKs?",
+ nodeConfig.register("allowInsecureCHKs", true, sortOrder++,
true, false, "NodeClientCore.allowInsecureCHK",
"NodeClientCore.allowInsecureCHKLong",
new BooleanCallback() {
public boolean get() {
@@ -328,7 +325,7 @@
Key.ALLOW_INSECURE_CLIENT_CHKS =
nodeConfig.getBoolean("allowInsecureCHKs");
- nodeConfig.register("allowInsecureSSKs", true, sortOrder++,
true, false, "Allow insecure SSKs?", "Before 1010, all SSKs were insecure (only
half encrypted). Allow old SSKs?",
+ nodeConfig.register("allowInsecureSSKs", true, sortOrder++,
true, false, "NodeClientCore.allowInsecureSSK",
"NodeClientCore.allowInsecureSSKLong",
new BooleanCallback() {
public boolean get() {
Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeIPDetector.java 2007-04-14 22:15:43 UTC
(rev 12731)
+++ trunk/freenet/src/freenet/node/NodeIPDetector.java 2007-04-14 22:15:51 UTC
(rev 12732)
@@ -297,8 +297,8 @@
public int registerConfigs(SubConfig nodeConfig, int sortOrder) {
// IP address override
- nodeConfig.register("ipAddressOverride", "", sortOrder++,
false, false, "IP address override",
- "IP address override (not usually needed) - set
this if you have a static IP address or a domain name (e.g. dyndns), and you
are behind a firewall",
+ nodeConfig.register("ipAddressOverride", "", sortOrder++,
false, false, "NodeIPDectector.ipOverride",
+ "NodeIPDectector.ipOverrideLong",
new StringCallback() {
public String get() {
@@ -344,7 +344,7 @@
// Temporary IP address hint
- nodeConfig.register("tempIPAddressHint", "", sortOrder++,
false, false, "Temporary IP address hint", "Temporary hint to what our IP might
be; deleted after use", new StringCallback() {
+ nodeConfig.register("tempIPAddressHint", "", sortOrder++,
false, false, "NodeIPDectector.tempAddressHint",
"NodeIPDectector.tempAddressHintLong", new StringCallback() {
public String get() {
return "";
@@ -379,7 +379,7 @@
// Include local IPs in noderef file
- nodeConfig.register("includeLocalAddressesInNoderefs", false,
sortOrder++, true, false, "Include local addresses in noderef", "Whether to
include local addresses (LAN and localhost) in node references. This will not
be useful unless the both sides set allowLocalAddresses=true for the respective
references (use the Darknet page in advanced mode to set this flag).", new
BooleanCallback() {
+ nodeConfig.register("includeLocalAddressesInNoderefs", false,
sortOrder++, true, false, "NodeIPDectector.inclLocalAddress",
"NodeIPDectector.inclLocalAddressLong", new BooleanCallback() {
public boolean get() {
return includeLocalAddressesInNoderefs;
Modified: trunk/freenet/src/freenet/node/NodeStats.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeStats.java 2007-04-14 22:15:43 UTC
(rev 12731)
+++ trunk/freenet/src/freenet/node/NodeStats.java 2007-04-14 22:15:51 UTC
(rev 12732)
@@ -182,7 +182,7 @@
last_output_stat = 0;
last_io_stat_time = 3;
- statsConfig.register("threadLimit", 500, sortOrder++, true,
true, "Thread limit", "The node will try to limit its thread usage to the
specified value, refusing new requests",
+ statsConfig.register("threadLimit", 500, sortOrder++, true,
true, "NodeStat.threadLimit", "NodeStat.threadLimitLong",
new IntCallback() {
public int get() {
return threadLimit;
@@ -197,7 +197,7 @@
threadLimit = statsConfig.getInt("threadLimit");
// Yes it could be in seconds insteed of multiples of 0.12, but
we don't want people to play with it :)
- statsConfig.register("aggressiveGC", aggressiveGCModificator,
sortOrder++, true, false, "AggressiveGC modificator", "Enables the user to
tweak the time in between GC and forced finalization. SHOULD NOT BE CHANGED
unless you know what you're doing! -1 means : disable forced call to
System.gc() and System.runFinalization()",
+ statsConfig.register("aggressiveGC", aggressiveGCModificator,
sortOrder++, true, false, "NodeStat.aggressiveGC", "NodeStat.aggressiveGCLong",
new IntCallback() {
public int get() {
return aggressiveGCModificator;
@@ -211,7 +211,7 @@
aggressiveGCModificator = statsConfig.getInt("aggressiveGC");
myMemoryChecker = new MemoryChecker(node.ps,
aggressiveGCModificator);
- statsConfig.register("memoryChecker", true, sortOrder++, true,
false, "Enable the Memory check", "Enable the memory check (writes a message in
logfile, mandatory for aggressiveGCModificator to have any effect!)",
+ statsConfig.register("memoryChecker", true, sortOrder++, true,
false, "NodeStat.memCheck", "NodeStat.memCheckLong",
new BooleanCallback(){
public boolean get() {
return
myMemoryChecker.isRunning();
@@ -229,7 +229,7 @@
if(statsConfig.getBoolean("memoryChecker"))
myMemoryChecker.start();
- statsConfig.register("freeHeapBytesThreshold", "5M",
sortOrder++, true, true, "Free heap bytes threshold", "The node will try to
keep it's free heap bytes above the threshold by refusing new requests",
+ statsConfig.register("freeHeapBytesThreshold", "5M",
sortOrder++, true, true, "NodeStat.freeHeapBytesThreshold",
"NodeStat.freeHeapBytesThresholdLong",
new LongCallback() {
public long get() {
return freeHeapBytesThreshold;
@@ -243,7 +243,7 @@
});
freeHeapBytesThreshold =
statsConfig.getLong("freeHeapBytesThreshold");
- statsConfig.register("freeHeapPercentThreshold", "5",
sortOrder++, true, true, "Free heap precent threshold", "The node will try to
keep it's free heap precentage (of max heap bytes allowed) above the threshold
by refusing new requests",
+ statsConfig.register("freeHeapPercentThreshold", "5",
sortOrder++, true, true, "NodeStat.freeHeapPercentThreshold",
"NodeStat.freeHeapPercentThresholdLong",
new IntCallback() {
public int get() {
return freeHeapPercentThreshold;
@@ -260,7 +260,7 @@
freeHeapPercentThreshold =
statsConfig.getInt("freeHeapPercentThreshold");
persister = new ConfigurablePersister(this, statsConfig,
"nodeThrottleFile", "node-throttle.dat", sortOrder++, true, false,
- "File to store node statistics in", "File to
store node statistics in (not client statistics, and these are used to decide
whether to accept requests so please don't delete)", node.ps);
+ "NodeStat.statsPersister",
"NodeStat.statsPersisterLong", node.ps);
SimpleFieldSet throttleFS = persister.read();
Modified: trunk/freenet/src/freenet/node/TestnetHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/TestnetHandler.java 2007-04-14 22:15:43 UTC
(rev 12731)
+++ trunk/freenet/src/freenet/node/TestnetHandler.java 2007-04-14 22:15:51 UTC
(rev 12732)
@@ -248,17 +248,14 @@
public static TestnetHandler maybeCreate(Node node, Config config)
throws NodeInitException {
SubConfig testnetConfig = new SubConfig("node.testnet", config);
- testnetConfig.register("enabled", false, 1, true /*Switch it to false
if we want large-scale testing */, true,
- "Enable testnet mode? (DANGEROUS)",
- "Whether to enable testnet mode (DANGEROUS!). Testnet
mode eliminates your anonymity in exchange for greatly assisting the developers
in debugging the node.",
- new TestnetEnabledCallback(node));
+ testnetConfig.register("enabled", false, 1, true /*Switch it to false
if we want large-scale testing */, true, "TestnetHandler.enable",
"TestnetHandler.enableLong", new TestnetEnabledCallback(node));
boolean enabled = testnetConfig.getBoolean("enabled");
if(enabled) {
// Get the testnet port
- testnetConfig.register("port", node.portNumber+1000, 2, true,
false, "Testnet port", "Testnet port number (-1 = listenPort+1000)",
+ testnetConfig.register("port", node.portNumber+1000, 2, true,
false, "TestnetHandler.port", "TestnetHandler.portLong",
new TestnetPortNumberCallback(node));
int port = testnetConfig.getInt("port");
Modified: trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
===================================================================
--- trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
2007-04-14 22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
2007-04-14 22:15:51 UTC (rev 12732)
@@ -61,16 +61,11 @@
NodeClientCore core = node.clientCore;
- TMCIConfig.register("enabled", true, 1, true, false, "Enable
TMCI", "Whether to enable the TMCI",
- new TMCIEnabledCallback(core));
- TMCIConfig.register("bindTo", "127.0.0.1", 2, true, false, "IP
address to bind to", "IP address to bind to",
- new TMCIBindtoCallback(core));
- TMCIConfig.register("allowedHosts",
"127.0.0.1,0:0:0:0:0:0:0:1", 2, true, false, "Allowed hosts", "Hostnames or IP
addresses that are allowed to connect to the TMCI. May be a comma-separated
list of hostnames, single IPs and even CIDR masked IPs like 192.168.0.0/24",
- new TMCIAllowedHostsCallback(core));
- TMCIConfig.register("port", 2323, 1, true, false, "Telnet
port", "Telnet port number",
- new TCMIPortNumberCallback(core));
- TMCIConfig.register("directEnabled", false, 1, true, false,
"Enable on stdout/stdin?", "Enable text mode client interface on standard
input/output? (.enabled refers to providing a telnet-style server, this runs it
over a socket)",
- new TMCIDirectEnabledCallback(core));
+ TMCIConfig.register("enabled", true, 1, true, false,
"TextModeClientInterfaceServer.enabled",
"TextModeClientInterfaceServer.enabledLong", new TMCIEnabledCallback(core));
+ TMCIConfig.register("bindTo", "127.0.0.1", 2, true, false,
"TextModeClientInterfaceServer.bindTo",
"TextModeClientInterfaceServer.bindToLong", new TMCIBindtoCallback(core));
+ TMCIConfig.register("allowedHosts",
"127.0.0.1,0:0:0:0:0:0:0:1", 2, true, false,
"TextModeClientInterfaceServer.allowedHosts",
"TextModeClientInterfaceServer.allowedHostsLong", new
TMCIAllowedHostsCallback(core));
+ TMCIConfig.register("port", 2323, 1, true, false,
"TextModeClientInterfaceServer.telnetPortNumber",
"TextModeClientInterfaceServer.telnetPortNumberLong", new
TCMIPortNumberCallback(core));
+ TMCIConfig.register("directEnabled", false, 1, true, false,
"TextModeClientInterfaceServer.enableInputOutput",
"TextModeClientInterfaceServer.enableInputOutputLong", new
TMCIDirectEnabledCallback(core));
boolean TMCIEnabled = TMCIConfig.getBoolean("enabled");
int port = TMCIConfig.getInt("port");
Modified: trunk/freenet/src/freenet/node/fcp/FCPServer.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPServer.java 2007-04-14 22:15:43 UTC
(rev 12731)
+++ trunk/freenet/src/freenet/node/fcp/FCPServer.java 2007-04-14 22:15:51 UTC
(rev 12732)
@@ -34,7 +34,6 @@
import freenet.io.AllowedHosts;
import freenet.io.NetworkInterface;
import freenet.keys.FreenetURI;
-import freenet.l10n.L10n;
import freenet.node.Node;
import freenet.node.NodeClientCore;
import freenet.node.RequestStarter;
@@ -358,25 +357,25 @@
public static FCPServer maybeCreate(Node node, NodeClientCore core,
Config config) throws IOException, InvalidConfigValueException {
SubConfig fcpConfig = new SubConfig("fcp", config);
short sortOrder = 0;
- fcpConfig.register("enabled", true, sortOrder++, true, false,
L10n.getString("FcpServer.isEnabled"),
L10n.getString("FcpServer.isEnabledLong"), new FCPEnabledCallback(core));
- fcpConfig.register("port", FCPServer.DEFAULT_FCP_PORT /*
anagram of 1984, and 1000 up from old number */, 2, true, true,
L10n.getString("FcpServer.portNumber"),
L10n.getString("FcpServer.portNumberLong"), new FCPPortNumberCallback(core));
- fcpConfig.register("bindTo", "127.0.0.1", sortOrder++, false,
true, L10n.getString("FcpServer.bindTo"),
L10n.getString("FcpServer.bindToLong"), new FCPBindtoCallback(core));
- fcpConfig.register("allowedHosts", "127.0.0.1,0:0:0:0:0:0:0:1",
sortOrder++, false, true, L10n.getString("FcpServer.allowedHosts"),
L10n.getString("FcpServer.allowedHostsLong"), new
FCPAllowedHostsCallback(core));
- fcpConfig.register("allowedHostsFullAccess",
"127.0.0.1,0:0:0:0:0:0:0:1", sortOrder++, false, true,
L10n.getString("FcpServer.allowedHostsFullAccess"),
L10n.getString("FcpServer.allowedHostsFullAccessLong"), new
FCPAllowedHostsFullAccessCallback(core));
+ fcpConfig.register("enabled", true, sortOrder++, true, false,
"FcpServer.isEnabled", "FcpServer.isEnabledLong", new FCPEnabledCallback(core));
+ fcpConfig.register("port", FCPServer.DEFAULT_FCP_PORT /*
anagram of 1984, and 1000 up from old number */, 2, true, true,
"FcpServer.portNumber", "FcpServer.portNumberLong", new
FCPPortNumberCallback(core));
+ fcpConfig.register("bindTo", "127.0.0.1", sortOrder++, false,
true, "FcpServer.bindTo", "FcpServer.bindToLong", new FCPBindtoCallback(core));
+ fcpConfig.register("allowedHosts", "127.0.0.1,0:0:0:0:0:0:0:1",
sortOrder++, false, true, "FcpServer.allowedHosts",
"FcpServer.allowedHostsLong", new FCPAllowedHostsCallback(core));
+ fcpConfig.register("allowedHostsFullAccess",
"127.0.0.1,0:0:0:0:0:0:0:1", sortOrder++, false, true,
"FcpServer.allowedHostsFullAccess", "FcpServer.allowedHostsFullAccessLong", new
FCPAllowedHostsFullAccessCallback(core));
PersistentDownloadsEnabledCallback cb1;
PersistentDownloadsFileCallback cb2;
PersistentDownloadsIntervalCallback cb3;
- fcpConfig.register("persistentDownloadsEnabled", true,
sortOrder++, true, true, L10n.getString("FcpServer.enablePersistentDownload"),
L10n.getString("FcpServer.enablePersistentDownloadLong"), cb1 = new
PersistentDownloadsEnabledCallback());
- fcpConfig.register("persistentDownloadsFile", "downloads.dat",
sortOrder++, true, false, L10n.getString("FcpServer.filenameToStorePData"),
L10n.getString("FcpServer.filenameToStorePDataLong"), cb2 = new
PersistentDownloadsFileCallback());
- fcpConfig.register("persistentDownloadsInterval", (5*60*1000),
sortOrder++, true, false, L10n.getString("FcpServer.intervalBetweenWrites"),
L10n.getString("FcpServer.intervalBetweenWritesLong"), cb3 = new
PersistentDownloadsIntervalCallback());
+ fcpConfig.register("persistentDownloadsEnabled", true,
sortOrder++, true, true, "FcpServer.enablePersistentDownload",
"FcpServer.enablePersistentDownloadLong", cb1 = new
PersistentDownloadsEnabledCallback());
+ fcpConfig.register("persistentDownloadsFile", "downloads.dat",
sortOrder++, true, false, "FcpServer.filenameToStorePData",
"FcpServer.filenameToStorePDataLong", cb2 = new
PersistentDownloadsFileCallback());
+ fcpConfig.register("persistentDownloadsInterval", (5*60*1000),
sortOrder++, true, false, "FcpServer.intervalBetweenWrites",
"FcpServer.intervalBetweenWritesLong", cb3 = new
PersistentDownloadsIntervalCallback());
String persistentDownloadsDir =
fcpConfig.getString("persistentDownloadsFile");
boolean persistentDownloadsEnabled =
fcpConfig.getBoolean("persistentDownloadsEnabled");
long persistentDownloadsInterval =
fcpConfig.getLong("persistentDownloadsInterval");
AssumeDDADownloadIsAllowedCallback cb4;
AssumeDDAUploadIsAllowedCallback cb5;
- fcpConfig.register("assumeDownloadDDAIsAllowed", true,
sortOrder++, true, false,
L10n.getString("FcpServer.assumeDownloadDDAIsAllowed"),
L10n.getString("FcpServer.assumeDownloadDDAIsAllowedLong"), cb4 = new
AssumeDDADownloadIsAllowedCallback());
- fcpConfig.register("assumeUploadDDAIsAllowed", true,
sortOrder++, true, false, L10n.getString("FcpServer.assumeUploadDDAIsAllowed"),
L10n.getString("FcpServer.assumeUploadDDAIsAllowedLong"), cb5 = new
AssumeDDAUploadIsAllowedCallback());
+ fcpConfig.register("assumeDownloadDDAIsAllowed", true,
sortOrder++, true, false, "FcpServer.assumeDownloadDDAIsAllowed",
"FcpServer.assumeDownloadDDAIsAllowedLong", cb4 = new
AssumeDDADownloadIsAllowedCallback());
+ fcpConfig.register("assumeUploadDDAIsAllowed", true,
sortOrder++, true, false, "FcpServer.assumeUploadDDAIsAllowed",
"FcpServer.assumeUploadDDAIsAllowedLong", cb5 = new
AssumeDDAUploadIsAllowedCallback());
FCPServer fcp = new FCPServer(fcpConfig.getString("bindTo"),
fcpConfig.getString("allowedHosts"),
fcpConfig.getString("allowedHostsFullAccess"), fcpConfig.getInt("port"), node,
core, persistentDownloadsEnabled, persistentDownloadsDir,
persistentDownloadsInterval, fcpConfig.getBoolean("enabled"),
fcpConfig.getBoolean("assumeDownloadDDAIsAllowed"),
fcpConfig.getBoolean("assumeUploadDDAIsAllowed"));
core.setFCPServer(fcp);
Modified: trunk/freenet/src/freenet/node/updater/NodeUpdaterManager.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/NodeUpdaterManager.java
2007-04-14 22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/node/updater/NodeUpdaterManager.java
2007-04-14 22:15:51 UTC (rev 12732)
@@ -83,20 +83,20 @@
SubConfig updaterConfig = new SubConfig("node.updater", config);
- updaterConfig.register("enabled",
WrapperManager.isControlledByNativeWrapper(), 1, true, false, "Check for, and
download new versions",
- "Should your node automatically check for new versions
of Freenet. If yes, new versions will be automatically detected and downloaded,
but not necessarily installed. This setting resets itself always back to false
unless the node runs within the wrapper.",
+ updaterConfig.register("enabled",
WrapperManager.isControlledByNativeWrapper(), 1, true, false,
"NodeUpdateManager.enabled",
+ "NodeUpdateManager.enabledLong",
new UpdaterEnabledCallback());
wasEnabledOnStartup = updaterConfig.getBoolean("enabled");
// is the auto-update allowed ?
- updaterConfig.register("autoupdate", false, 2, false, true,
"Automatically install new versions", "Should your node automatically update to
the newest version of Freenet, without asking?",
+ updaterConfig.register("autoupdate", false, 2, false, true,
"NodeUpdateManager.installNewVersions",
"NodeUpdateManager.installNewVersionsLong",
new AutoUpdateAllowedCallback());
isAutoUpdateAllowed = updaterConfig.getBoolean("autoupdate");
updaterConfig.register("URI", UPDATE_URI, 3,
- true, false, "Where should the node look for updates?",
- "Where should the node look for updates?",
+ true, false, "NodeUpdateManager.updateURI",
+ "NodeUpdateManager.updateURILong",
new UpdateURICallback(false));
// FIXME remove when 101X is long gone
@@ -115,8 +115,8 @@
}
updaterConfig.register("revocationURI", REVOCATION_URI,4,
- true, false, "Where should the node look for the
revocation key ?",
- "URI for the revocation key. If this is found the node
will display its contents and disable the auto-updater.",
+ true, false, "NodeUpdateManager.revocationURI",
+ "NodeUpdateManager.revocationURILong",
new UpdateRevocationURICallback());
// FIXME remove
@@ -135,10 +135,7 @@
revocationURI = revocationURI.popMetaString();
}
- updaterConfig.register("extURI", EXT_URI, 5,
- true, false, "Where should the node look for updates to
freenet-ext.jar?",
- "Where should the node look for updates to
freenet-ext.jar?",
- new UpdateURICallback(true));
+ updaterConfig.register("extURI", EXT_URI, 5, true, false,
"NodeUpdateManager.extURI", "NodeUpdateManager.extURILong", new
UpdateURICallback(true));
// FIXME remove
updaterConfig.fixOldDefaultRegex("extURI", "USK at
SIDKS6l-eOU8IQqDo03d~3qqBd-69WG60aDgg4nWqss,CPFqYi95Is3GwzAdAKtAuFMCXDZFFWC3~uPoidCD67s,AQABAAE/ext/[0-9]++");
Modified: trunk/freenet/src/freenet/oldplugins/plugin/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/oldplugins/plugin/PluginManager.java
2007-04-14 22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/oldplugins/plugin/PluginManager.java
2007-04-14 22:15:51 UTC (rev 12732)
@@ -47,7 +47,7 @@
this.node = node;
config = new SubConfig("pluginmanager2", node.config);
- config.register("loadedPlugins", new String[0], 9, true, true,
"Plugins to load on start up", "A list of plugins that are started when the
node starts", new StringArrCallback() {
+ config.register("loadedPlugins", new String[0], 9, true, true,
"PluginManager.loadedPlugins", "PluginManager.loadedPluginsLong", new
StringArrCallback() {
/**
* Returns the current value of this option.
Modified: trunk/freenet/src/freenet/pluginmanager/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginManager.java 2007-04-14
22:15:43 UTC (rev 12731)
+++ trunk/freenet/src/freenet/pluginmanager/PluginManager.java 2007-04-14
22:15:51 UTC (rev 12732)
@@ -60,7 +60,7 @@
pmconfig = new SubConfig("pluginmanager", node.config);
// Start plugins in the config
- pmconfig.register("loadplugin", null, 9, true, false, "Plugins
to load on startup ", "Classpath, name and location for plugins to load when
node starts up",
+ pmconfig.register("loadplugin", null, 9, true, false,
"PluginManager.loadedOnStartup", "PluginManager.loadedOnStartupLong",
new StringArrCallback() {
public String[] get() {
return getConfigLoadString();