PageRenderTime 68ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 2ms

/src/freenet/node/Node.java

https://github.com/freenet/legacy
Java | 5311 lines | 3982 code | 508 blank | 821 comment | 326 complexity | ef64a1efa861fd49520d8b84be251a55 MD5 | raw file
Possible License(s): GPL-2.0

Large files files are truncated, but you can click here to view the full file

  1. package freenet.node;
  2. import java.io.DataInputStream;
  3. import java.io.DataOutputStream;
  4. import java.io.File;
  5. import java.io.FileInputStream;
  6. import java.io.FileOutputStream;
  7. import java.io.IOException;
  8. import java.nio.channels.FileLock;
  9. import java.text.NumberFormat;
  10. import java.util.Enumeration;
  11. import freenet.Address;
  12. import freenet.Authentity;
  13. import freenet.Core;
  14. import freenet.CoreException;
  15. import freenet.DSAAuthentity;
  16. import freenet.DSAIdentity;
  17. import freenet.FieldSet;
  18. import freenet.Identity;
  19. import freenet.Key;
  20. import freenet.KeyException;
  21. import freenet.Message;
  22. import freenet.MessageSendCallback;
  23. import freenet.OpenConnectionManager;
  24. import freenet.Peer;
  25. import freenet.PeerPacketMessage;
  26. import freenet.Presentation;
  27. import freenet.PresentationHandler;
  28. import freenet.SendFailedException;
  29. import freenet.SessionHandler;
  30. import freenet.Ticker;
  31. import freenet.TrailerWriter;
  32. import freenet.TransportHandler;
  33. import freenet.Version;
  34. import freenet.client.BackgroundInserter;
  35. import freenet.client.ClientFactory;
  36. import freenet.client.FECTools;
  37. import freenet.client.InternalClient;
  38. import freenet.config.Config;
  39. import freenet.config.Params;
  40. import freenet.config.RandomPortOption;
  41. import freenet.diagnostics.Diagnostics;
  42. import freenet.fs.dir.Directory;
  43. import freenet.interfaces.NIOInterface;
  44. import freenet.node.ds.DataStore;
  45. import freenet.node.rt.ExtrapolatingTimeDecayingEventCounter;
  46. import freenet.node.rt.NGRouting;
  47. import freenet.node.rt.NGRoutingTable;
  48. import freenet.node.rt.NodeSortingRoutingTable;
  49. import freenet.node.rt.RTDiagSnapshot;
  50. import freenet.node.rt.RunningAverage;
  51. import freenet.node.rt.SimpleBinaryRunningAverage;
  52. import freenet.node.rt.SimpleIntervalledRunningAverage;
  53. import freenet.node.rt.SynchronizedRunningAverage;
  54. import freenet.node.rt.TimeDecayingRunningAverage;
  55. import freenet.session.LinkManager;
  56. import freenet.support.Bucket;
  57. import freenet.support.BucketFactory;
  58. import freenet.support.Checkpointed;
  59. import freenet.support.HexUtil;
  60. import freenet.support.IntervalledSum;
  61. import freenet.support.LimitCounter;
  62. import freenet.support.LoadSaveCheckpointed;
  63. import freenet.support.Logger;
  64. import freenet.support.io.Bandwidth;
  65. import freenet.support.io.ReadInputStream;
  66. import freenet.thread.ThreadFactory;
  67. import freenet.transport.tcpAddress;
  68. import freenet.transport.tcpConnection;
  69. import freenet.transport.tcpListener;
  70. /*
  71. * This code is part of the Java Adaptive Network Client by Ian Clarke. It is
  72. * distributed under the GNU Public Licence (GPL) version 2. See
  73. * http://www.gnu.org/ for further details of the GPL.
  74. */
  75. /**
  76. * This is a Wrapper object that contains the components of a Node in the
  77. * Adaptive Network. It uses a Network object to communicate with other Nodes
  78. * in the Network.
  79. *
  80. * @author <A HREF="mailto:I.Clarke@strs.co.uk">Ian Clarke</A>
  81. * @author <a href="mailto:blanu@uts.cc.utexas.edu">Brandon Wiley</a>
  82. */
  83. public class Node extends Core implements ConnectionThrottler{
  84. /**
  85. * @author root
  86. *
  87. * TODO To change the template for this generated type comment go to
  88. * Window - Preferences - Java - Code Generation - Code and Comments
  89. */
  90. private class RateLimitingWriterCheckpointed extends LoadSaveCheckpointed {
  91. public RateLimitingWriterCheckpointed(File routingDir) {
  92. super(routingDir, new String[] { "ratedata_a", "ratedata_b" });
  93. }
  94. protected int checkpointPeriod() {
  95. return 60000;
  96. }
  97. public void writeData(DataOutputStream dos) throws IOException {
  98. receivedRequestCounter.writeDataTo(dos);
  99. acceptedExternalRequestCounter.writeDataTo(dos);
  100. globalQuotaAverager.writeDataTo(dos);
  101. sentRequestCounter.writeDataTo(dos);
  102. }
  103. protected void fillInBlanks() {
  104. if(receivedRequestCounter == null)
  105. receivedRequestCounter = new ExtrapolatingTimeDecayingEventCounter(rateLimitingInterval, 1000);
  106. Core.logger.log(this, "receivedRequestCounter = "+receivedRequestCounter, Logger.DEBUG);
  107. if(acceptedExternalRequestCounter == null)
  108. acceptedExternalRequestCounter = new ExtrapolatingTimeDecayingEventCounter(rateLimitingInterval, 1000);
  109. Core.logger.log(this, "acceptedExternalRequestCounter = "+acceptedExternalRequestCounter, Logger.DEBUG);
  110. if(globalQuotaAverager == null)
  111. globalQuotaAverager = new TimeDecayingRunningAverage(1000, rateLimitingInterval, 0, Double.MAX_VALUE);
  112. Core.logger.log(this, "globalQuotaAverager = "+globalQuotaAverager, Logger.DEBUG);
  113. if(sentRequestCounter == null)
  114. sentRequestCounter = new ExtrapolatingTimeDecayingEventCounter(rateLimitingInterval/2, 1000);
  115. Core.logger.log(this, "sentRequestCounter = "+sentRequestCounter, Logger.DEBUG);
  116. }
  117. protected void readFrom(DataInputStream dis) throws IOException {
  118. receivedRequestCounter = new ExtrapolatingTimeDecayingEventCounter(1000, rateLimitingInterval, dis);
  119. Core.logger.log(this, "Read receivedRequestCounter: "+receivedRequestCounter, Logger.MINOR);
  120. acceptedExternalRequestCounter = new ExtrapolatingTimeDecayingEventCounter(1000, rateLimitingInterval, dis);
  121. Core.logger.log(this, "Read acceptedExternalRequestCounter: "+acceptedExternalRequestCounter, Logger.MINOR);
  122. globalQuotaAverager = new TimeDecayingRunningAverage(1000, rateLimitingInterval, 0, Double.MAX_VALUE, dis);
  123. Core.logger.log(this, "Read globalQuotaAverager: "+globalQuotaAverager, Logger.MINOR);
  124. sentRequestCounter = new ExtrapolatingTimeDecayingEventCounter(1000, rateLimitingInterval, dis);
  125. Core.logger.log(this, "Read sentRequestCounter: "+sentRequestCounter, Logger.MINOR);
  126. }
  127. protected void preload() {
  128. // All will be initted to null
  129. }
  130. public String getCheckpointName() {
  131. return "Rate limiting data save process";
  132. }
  133. }
  134. public static int maxConnDefault = 200;
  135. public static int maxFileDefault = 256;
  136. public static boolean isWin95;
  137. public static boolean isWin9X;
  138. public static boolean isWinCE;
  139. public static boolean isOSX;
  140. public static String sysName = System.getProperty("os.name");
  141. private static final NumberFormat nfp;
  142. private static final NumberFormat nf1;
  143. private static final NumberFormat nf03;
  144. private static final NumberFormat nf3;
  145. static float overloadHighDefault = 1.25f;
  146. private static final String ARG_BOOLEAN = "<true|false>";
  147. static {
  148. nfp = NumberFormat.getPercentInstance();
  149. nfp.setMinimumFractionDigits(0);
  150. nfp.setMaximumFractionDigits(1);
  151. nf1 = NumberFormat.getInstance();
  152. nf1.setMaximumFractionDigits(1);
  153. nf1.setMinimumFractionDigits(1);
  154. nf1.setGroupingUsed(false);
  155. nf03 = NumberFormat.getInstance();
  156. nf03.setMinimumFractionDigits(0);
  157. nf03.setMaximumFractionDigits(3);
  158. nf03.setGroupingUsed(false);
  159. nf3 = NumberFormat.getInstance();
  160. nf3.setMaximumFractionDigits(3);
  161. nf3.setMinimumFractionDigits(3);
  162. nf3.setGroupingUsed(false);
  163. // System.err.println("Node.java static initialization start.");
  164. Config config = getConfig();
  165. // internal defaults
  166. config.addOption("rtMaxRefs", 1, 50, 1300); // 50 refs/node
  167. // rtMaxNodes later down because of OS detection
  168. config.addOption("maxRoutingSteps", 1, 200, 1303); // to 10 refs
  169. config.addOption("messageStoreSize", 1, 10000, 1350);
  170. // 10000 live chains
  171. config.addOption("failureTableSize", 1, 20000, 1360);
  172. // 20000 failed keys - uses ~ 2.7MB
  173. config.addOption("failureTableItems", 1, 100000, 1361);
  174. config.addOption("failureTableTime", 1, 1800000l, 1362); // 30 min
  175. config.addOption("newNodePollInterval", 1, 30000, 1363); // 30 seconds
  176. // ARK stuff
  177. config.addOption("minCP", 1, 0.01F, 1370);
  178. config.addOption("failuresLookupARK", 1, 10, 1371);
  179. config.addOption("minARKDelay", 1, 900 * 1000, 1372);
  180. config.addOption("maxARKThreadsFraction", 1, 0.1F, 1373);
  181. // network defaults
  182. config.addOption("routeConnectTimeout", 1, 10000, 1400); // 10 sec
  183. config.addOption("maxHopsToLive", 1, 20, 1410);
  184. config.addOption("probIncHopsSinceReset", 1, 0.95F, 1411);
  185. config.addOption("cacheProbPerHop", 1, 0.8F, 1412);
  186. config.addOption("minStoreFullPCache", 1, 0.9F, 1413);
  187. config.addOption("minRTFullPRef", 1, 0.3F, 1414);
  188. config.addOption("minRTNodesPRef", 1, 0.8F, 1415);
  189. config.addOption("maxLog2DataSize", 1, 20, 1416);
  190. // network resource limiting options
  191. config.addOption("bandwidthLimit", 1, 0, 1200);
  192. config.addOption("inputBandwidthLimit", 1, 0, 1201); // disabled
  193. config.addOption("outputBandwidthLimit", 1, 12 * 1024, 1202);
  194. // 12kB/sec, so it doesn't ruin 128kbps uplink which is unfortunately
  195. // way too common
  196. config.addOption("averageBandwidthLimit", 1, 0, 1203); // disabled
  197. config.addOption("averageInputBandwidthLimit", 1, 0, 1204); // disabled
  198. config.addOption("averageOutputBandwidthLimit", 1, 0, 1205);
  199. // disabled
  200. sysName = sysName.toLowerCase();
  201. if (sysName.startsWith("windows")) {
  202. maxFileDefault = 1024;
  203. // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_crt__setmaxstdio.asp
  204. if (sysName.startsWith("windows ce"))
  205. isWinCE = true;
  206. else if (sysName.startsWith("windows 95")) {
  207. isWin95 = true;
  208. isWin9X = true;
  209. maxConnDefault = 20;
  210. } else if (
  211. sysName.startsWith("windows 98")
  212. || (sysName.startsWith("windows")
  213. && (sysName.indexOf("millennium") != -1))
  214. || (sysName.startsWith("windows me"))) {
  215. // Detected Windows 9X
  216. maxConnDefault = 60;
  217. isWin9X = true;
  218. } else {
  219. isWin9X = false;
  220. }
  221. }
  222. if (sysName.startsWith("mac os x")) {
  223. maxConnDefault = 128;
  224. maxFileDefault = 64;
  225. isOSX = true;
  226. } else
  227. isOSX = false;
  228. if (sysName.startsWith("netware")) {
  229. // supports unlimited FDs
  230. maxFileDefault = 0;
  231. }
  232. config.addOption("rtMaxNodes", 1, 100, 1301);
  233. config.addOption("doEstimatorSmoothing", 1, true, 1304);
  234. config.addOption("useFastEstimators", 1, true, 1305);
  235. config.addOption("maxNodeConnections", 1, maxConnDefault, 1224);
  236. config.addOption("maxOpenConnectionsNewbieFraction", 1, 0.2, 1225);
  237. config.addOption("maxNodeFilesOpen", 1, maxFileDefault, 1226);
  238. config.addOption("maxNegotiations", 1, 50, 1227);
  239. // I'm deprecating these in favor of
  240. config.addOption("maxConnectionsPerMinute", 1, 60, 1228);
  241. config.addOption("maxConnectionsMinute", 1, 60000, 1229);
  242. // these, and increasing the default quite a bit while at it.
  243. config.addOption("maxRequestsPerInterval", 1, -1, 1230);
  244. config.addOption("maxRequestsInterval", 1, 60000, 1231);
  245. // data store settings
  246. config.addOption("storeType", 1, "freenet", 999);
  247. // "freenet" or "native"
  248. config.addOption("nodeFile", 1, "", 1000); // node_<port>
  249. config.addOption("storeFile", 1, "", 1001); // store_<port>
  250. config.addOption("storeSize", 1, 256L*1024L*1024L, 1010, true);
  251. // 256MB is reasonable, strictish minimum would be 101MB ((1MB chunk +
  252. // header) * 100)
  253. config.addOption("storeBlockSize", 1, 4096, 1011);
  254. config.addOption("storeMaxTempFraction", 1, (1F / 3F), 1012);
  255. config.addOption("storeCipherName", 1, "Twofish", 1020);
  256. // Twofish cipher
  257. config.addOption("storeCipherWidth", 1, 128, 1021); // 128 bits
  258. config.addOption("routingDir", 1, "", 1022);
  259. config.addOption("useDSIndex", 1, true, 1023);
  260. // network settings
  261. config.addOption("ipAddress", 1, "", 100); // autodetected if not set
  262. config.addOption(new RandomPortOption("listenPort", 1, 101));
  263. // random choice
  264. config.addOption("clientPort", 1, 8481, 110);
  265. config.addOption("fcpHosts", 1, "", 112); // loopback only
  266. config.addOption("transient", 1, false, 300);
  267. config.setDeprecated("transient", true);
  268. config.addOption("seedFile", 1, "seednodes.ref", 320);
  269. config.addOption("routingTableImpl", 1, "ng", 330);
  270. // logging options
  271. config.addOption("logLevel", 1, "normal", 1250);
  272. config.addOption("logFile", 1, "freenet.log", 1251);
  273. config.addOption("logFormat", 1, "d (c, t, p): m", 1252);
  274. config.addOption("logDate", 1, "", 1253); // locale default
  275. config.addOption("logLevelDetail", 1, "", 1254);
  276. config.addOption("logMaxLinesCached", 1, 10000, 1255);
  277. config.addOption("logMaxBytesCached", 1, 10L*1024L*1024L, 1256);
  278. config.addOption("logRotate", 1, false, 1257);
  279. config.addOption("logRotateUseNativeGzip", 1, false, 1258);
  280. config.addOption("logRotateInterval", 1, "hour", 1259);
  281. config.addOption("logOverwrite", 1, true, 1260);
  282. // diagnostics options
  283. config.addOption("diagnosticsPath", 1, "stats", 501);
  284. // announcement options
  285. config.addOption("doAnnounce", 1, true, 310);
  286. config.addOption("announcementHTL", 1, 15, 1501);
  287. config.addOption("announcementAttempts", 1, 3, 1502);
  288. config.addOption("announcementPollInterval", 1, 900 * 1000, 1513);
  289. // Set to 0 - with bidi, new nodes should announce immediately
  290. config.addOption("announcementFirstDelay", 1, /*2 * 3600 * 1000*/0, 1514);
  291. config.addOption("announcementThreads", 1, 3, 1515);
  292. config.addOption("announcementUseRT", 1, true, 1516);
  293. config.addOption("initialRequests", 1, 10, 1520);
  294. config.addOption("initialRequestHTL", 1, 25, 1521);
  295. // Load balancing
  296. config.addOption("doLoadBalance", 1, true, 1550);
  297. // wierd stuff
  298. config.addOption("localIsOK", 1, false, 1551);
  299. config.addOption("dontLimitClients", 1, false, 1552);
  300. config.addOption("limitAll", 1, false, 1553);
  301. config.addOption("mainportURIOverride", 1, "", 1554);
  302. config.addOption("distributionURIOverride", 1, "", 1555);
  303. config.addOption("aggressiveGC", 1, 0, 1556);
  304. config.addOption("configUpdateInterval", 1, 5, 1557);
  305. config.addOption("seednodesUpdateInterval", 1, 5, 1558);
  306. config.addOption("defaultToSimpleUIMode", 1, true, 1559);
  307. config.addOption("defaultToOCMHTMLPeerHandlerMode", 1, false, 1560);
  308. config.addOption("ipDetectorInterval", 1, 10, 1561);
  309. // FCP admin options
  310. config.addOption("adminPassword", 1, String.class, 200);
  311. config.addOption("adminPeer", 1, String.class, 201);
  312. config.addOption("logOutputBytes", 1, true, 3540);
  313. config.addOption("logInputBytes", 1, true, 3541);
  314. // Logging, overload, triage
  315. config.addOption("logInboundContacts", 1, false, 3500);
  316. config.addOption("logOutboundContacts", 1, false, 3510);
  317. config.addOption("logInboundRequests", 1, false, 3520);
  318. config.addOption("logOutboundRequests", 1, false, 3530);
  319. config.addOption("logInboundInsertRequestDist", 1, false, 3541);
  320. config.addOption("logSuccessfulInsertRequestDist", 1, false, 3546);
  321. config.addOption("doRequestTriageByDelay", 1, true, 3250);
  322. config.addOption("doRequestTriageBySendTime", 1, true, 3251);
  323. config.addOption("overloadLow", 1, 1.0f, 3252);
  324. config.addOption("overloadHigh", 1, overloadHighDefault, 3253);
  325. config.addOption("threadConnectCutoff", 1, 1.5F, 3254);
  326. config.addOption("requestDelayCutoff", 1, 1000, 3255);
  327. config.addOption("successfulDelayCutoff", 1, 2000, 3256);
  328. config.addOption("requestSendTimeCutoff", 1, 500, 3257);
  329. config.addOption("successfulSendTimeCutoff", 1, 1000, 3258);
  330. config.addOption("doOutLimitCutoff", 1, false, 3259);
  331. config.addOption("outLimitCutoff", 1, 0.8F, 3260);
  332. config.addOption("doOutLimitConnectCutoff", 1, true, 3261);
  333. config.addOption("outLimitConnectCutoff", 1, 2.0F, 3262);
  334. config.addOption("lowLevelBWLimitFudgeFactor", 1, 3F / 4F, 3263);
  335. config.addOption("doReserveOutputBandwidthForSuccess", 1, false, 3264);
  336. // Give high-level a chance - if low level is too aggressive, high level
  337. // won't be effective
  338. config.addOption("lowLevelBWLimitMultiplier", 1, 1.4F, 3265);
  339. config.addOption("doLowLevelOutputLimiting", 1, true, 3266);
  340. config.addOption("doLowLevelInputLimiting", 1, true, 3267);
  341. // Commented out because of limited use and potential political
  342. // problems i.e. not cross platform
  343. config.addOption("doCPULoad",1,false,3264);
  344. config.addOption("sendingQueueLength", 1, 256, 3266);
  345. config.addOption("sendingQueueBytes", 1, 1492 * 8, 3267);
  346. config.addOption("requestIntervalDefault", 1, 1000, 3268);
  347. config.addOption("requestIntervalQRFactor", 1, 1.05, 3269);
  348. // WatchMe options.
  349. config.addOption("watchme", 1, false, 3541);
  350. config.addOption("watchmeRetries", 1, 3, 3542);
  351. // LoadStats options.
  352. config.addOption("defaultResetProbability", 1, 0.05, 3557);
  353. config.addOption("lsMaxTableSize", 1, 100, 3558);
  354. config.addOption("lsAcceptRatioSamples", 1, 500, 3559);
  355. config.addOption("lsHalfLifeHours", 1, 1.2, 3560);
  356. // Forward Error Correction (FEC) options
  357. config.addOption("FECTempDir", 1, "", 3600);
  358. config.addOption("FECInstanceCacheSize", 1, 1, 3610);
  359. config.addOption("FECMaxConcurrentCodecs", 1, 1, 3612);
  360. // Default FEC encoder and decoder implementations.
  361. config.addOption("FEC.Encoders.0.class", 1, "OnionFECEncoder", 3620);
  362. config.addOption("FEC.Decoders.0.class", 1, "OnionFECDecoder", 3630);
  363. // Default temp dir for FEC and fproxy if theirs aren't specified
  364. config.addOption("tempDir", 1, "", 3640);
  365. config.addOption("tempInStore", 1, false, 3641);
  366. config.addOption("publicNode", 1, false, 3650);
  367. // Allow HTTP inserts?
  368. config.addOption("httpInserts", 1, true, 3651);
  369. // Allow FCP inserts?
  370. config.addOption("fcpInserts", 1, true, 3652);
  371. // UI template set
  372. config.addOption("UITemplateSet", 1, "aqua", 3653);
  373. // Bundled client stuff
  374. config.addOption(
  375. "filterPassThroughMimeTypes",
  376. 1,
  377. "text/plain,image/jpeg,image/gif,image/png",
  378. 4000);
  379. // Mainport
  380. config.addOption(
  381. "mainport.class",
  382. 1,
  383. "freenet.interfaces.servlet.MultipleHttpServletContainer",
  384. 4100);
  385. config.addOption("mainport.port", 1, 8888, 4101);
  386. config.addOption("mainport.allowedHosts", 1, "127.0.0.0/8", 4102);
  387. config.addOption("mainport.bindAddress", 1, "", 4103);
  388. config.addOption("mainport.params.servlet.1.uri", 1, "/", 4110);
  389. config.addOption("mainport.params.servlet.1.method", 1, "GET", 4111);
  390. config.addOption(
  391. "mainport.params.servlet.1.class",
  392. 1,
  393. "freenet.client.http.FproxyServlet",
  394. 4112);
  395. config.addOption(
  396. "mainport.params.servlet.1.name",
  397. 1,
  398. "Freenet HTTP proxy (fproxy)",
  399. 4113);
  400. config.addOption(
  401. "mainport.params.servlet.1.params.requestHtl",
  402. 1,
  403. 15,
  404. 4114);
  405. config.addOption(
  406. "mainport.params.servlet.1.params.passThroughMimeTypes",
  407. 1,
  408. "",
  409. 4115);
  410. config.addOption(
  411. "mainport.params.servlet.1.params.filter",
  412. 1,
  413. true,
  414. 4116);
  415. config.addOption(
  416. "mainport.params.servlet.1.params.filterParanoidStringCheck",
  417. 1,
  418. false,
  419. 4117);
  420. config.addOption(
  421. "mainport.params.servlet.1.params.maxForceKeys",
  422. 1,
  423. 100,
  424. 4118);
  425. config.addOption(
  426. "mainport.params.servlet.1.params.doSendRobots",
  427. 1,
  428. true,
  429. 4119);
  430. config.addOption(
  431. "mainport.params.servlet.1.params.noCache",
  432. 1,
  433. false,
  434. 4119);
  435. config.addOption(
  436. "mainport.params.servlet.1.params.dontWarnOperaUsers",
  437. 1,
  438. false,
  439. 4119);
  440. config.addOption(
  441. "mainport.params.servlet.2.uri",
  442. 1,
  443. "/servlet/nodeinfo/",
  444. 4120);
  445. config.addOption("mainport.params.servlet.2.method", 1, "GET", 4121);
  446. config.addOption(
  447. "mainport.params.servlet.2.class",
  448. 1,
  449. "freenet.node.http.NodeInfoServlet",
  450. 4122);
  451. config.addOption(
  452. "mainport.params.servlet.2.name",
  453. 1,
  454. "Web Interface",
  455. 4123);
  456. // default bookmarks. Bookmarks start at 6000 so they come last in the config file
  457. config.addOption("mainport.params.servlet.2.bookmarks.count", 1, -1, 6000);
  458. config.addOption("mainport.params.servlet.2.bookmarks.0.key", 1, "SSK@qe3ZRJg1Nv1XErADrz7ZYjhDidUPAgM/nubile/11//", 6100);
  459. config.addOption("mainport.params.servlet.2.bookmarks.0.title", 1, "Nubile", 6101);
  460. config.addOption("mainport.params.servlet.2.bookmarks.0.activelinkFile", 1, "nubile.png", 6102);
  461. config.addOption("mainport.params.servlet.2.bookmarks.0.description", 1,
  462. "Freesite aimed at beginners. Learn basic methods of retrieving and inserting data from and into freenet. " +
  463. "Unfortunately some of the specifics are slightly outdated.", 6103);
  464. config.addOption("mainport.params.servlet.2.bookmarks.1.key", 1, "SSK@a7SLJXxcl2eT967cHE5~mzQaYTkPAgM/newtofn/7//", 6130);
  465. config.addOption("mainport.params.servlet.2.bookmarks.1.title", 1, "New to Freenet?", 6131);
  466. config.addOption("mainport.params.servlet.2.bookmarks.1.activelinkFile", 1, "newtofn.jpg", 6132);
  467. config.addOption("mainport.params.servlet.2.bookmarks.1.description", 1,
  468. "Another freesite aimed at beginners, with emphasis on Windows users connecting via modem.", 6133);
  469. config.addOption("mainport.params.servlet.2.bookmarks.2.key", 1, "SSK@y~-NCd~il6RMxOe9jjf~VR7mSYwPAgM,ds52dBUTmr8fSHePn1Sn4g/OneMore//", 6140);
  470. config.addOption("mainport.params.servlet.2.bookmarks.2.title", 1, "One More Time", 6141);
  471. config.addOption("mainport.params.servlet.2.bookmarks.2.activelinkFile", 1, "activelink.gif", 6142);
  472. config.addOption("mainport.params.servlet.2.bookmarks.2.description", 1,
  473. "A freesite indexing other freesites. The index is categorized, with one page per category.", 6143);
  474. config.addOption("mainport.params.servlet.2.bookmarks.3.key", 1, "SSK@pHWN3FglLQOoBleE3pQ3EX3PLFoPAgM,xgvJe~4roO7d3lT~4QPIzA/atwocentindex//", 6150);
  475. config.addOption("mainport.params.servlet.2.bookmarks.3.title", 1, "A Two Cent Index", 6151);
  476. config.addOption("mainport.params.servlet.2.bookmarks.3.activelinkFile", 1, "activelink.jpg", 6152);
  477. config.addOption("mainport.params.servlet.2.bookmarks.3.description", 1, "A freesite index with narrower inclusion criteria.", 6153);
  478. config.addOption("mainport.params.servlet.2.bookmarks.4.key", 1, "SSK@rgFrfo~dAesFgV5vylYVNvNGXO0PAgM,wo3T~oLnVbWq-vuD2Kr86Q/frost/19//", 6160);
  479. config.addOption("mainport.params.servlet.2.bookmarks.4.title", 1, "Frost", 6161);
  480. config.addOption("mainport.params.servlet.2.bookmarks.4.activelinkFile", 1, "activelink.png", 6162);
  481. config.addOption("mainport.params.servlet.2.bookmarks.4.description", 1, "Bulletin board and filesharing software.", 6163);
  482. config.addOption("mainport.params.servlet.2.bookmarks.5.key", 1, "SSK@TEx6TiaPeszpV4AFw3ToutDb49EPAgM/mytwocents/59//", 6200);
  483. config.addOption("mainport.params.servlet.2.bookmarks.5.title", 1, "My Two Cents Worth", 6201);
  484. config.addOption("mainport.params.servlet.2.bookmarks.5.activelinkFile", 1, "activelink.jpg", 6202);
  485. config.addOption("mainport.params.servlet.2.bookmarks.5.description", 1,
  486. "A flog (freenet blog) about \"my 2cents worth on just about any subject\", according to the author.", 6203);
  487. // end bookmarks
  488. config.addOption(
  489. "mainport.params.servlet.3.uri",
  490. 1,
  491. "/servlet/images/",
  492. 4130);
  493. config.addOption("mainport.params.servlet.3.method", 1, "GET", 4131);
  494. config.addOption(
  495. "mainport.params.servlet.3.class",
  496. 1,
  497. "freenet.client.http.ImageServlet",
  498. 4132);
  499. config.addOption(
  500. "mainport.params.servlet.3.name",
  501. 1,
  502. "Server Images",
  503. 4133);
  504. config.addOption(
  505. "mainport.params.servlet.4.uri",
  506. 1,
  507. "/servlet/Insert",
  508. 4140);
  509. config.addOption("mainport.params.servlet.4.method", 1, "BOTH", 4141);
  510. config.addOption(
  511. "mainport.params.servlet.4.class",
  512. 1,
  513. "freenet.client.http.InsertServlet",
  514. 4142);
  515. config.addOption(
  516. "mainport.params.servlet.4.name",
  517. 1,
  518. "Insert Proxy Status",
  519. 4143);
  520. config.addOption(
  521. "mainport.params.servlet.4.params.insertHtl",
  522. 1,
  523. 20,
  524. 4144);
  525. config.addOption(
  526. "mainport.params.servlet.4.params.sfInsertThreads",
  527. 1,
  528. 30,
  529. 4145);
  530. config.addOption(
  531. "mainport.params.servlet.4.params.sfInsertRetries",
  532. 1,
  533. 3,
  534. 4146);
  535. config.addOption(
  536. "mainport.params.servlet.4.params.sfRefreshIntervalSecs",
  537. 1,
  538. 15,
  539. 4147);
  540. config.addOption("mainport.params.servlet.6.uri", 1, "/", 4190);
  541. config.addOption("mainport.params.servlet.6.method", 1, "POST", 4191);
  542. config.addOption(
  543. "mainport.params.servlet.6.class",
  544. 1,
  545. "freenet.client.http.InsertServlet",
  546. 4192);
  547. config.addOption(
  548. "mainport.params.servlet.6.name",
  549. 1,
  550. "Insert Proxy",
  551. 4193);
  552. config.addOption(
  553. "mainport.params.servlet.6.params.insertHtl",
  554. 1,
  555. 20,
  556. 4194);
  557. config.addOption(
  558. "mainport.params.servlet.6.params.sfInsertThreads",
  559. 1,
  560. 20,
  561. 4195);
  562. config.addOption(
  563. "mainport.params.servlet.6.params.sfInsertRetries",
  564. 1,
  565. 3,
  566. 4196);
  567. config.addOption(
  568. "mainport.params.servlet.6.params.sfRefreshIntervalSecs",
  569. 1,
  570. 15,
  571. 4197);
  572. config.addOption(
  573. "mainport.params.servlet.5.uri",
  574. 1,
  575. "/servlet/nodestatus/",
  576. 4150);
  577. config.addOption("mainport.params.servlet.5.method", 1, "BOTH", 4151);
  578. config.addOption(
  579. "mainport.params.servlet.5.class",
  580. 1,
  581. "freenet.client.http.NodeStatusServlet",
  582. 4152);
  583. config.addOption(
  584. "mainport.params.servlet.5.name",
  585. 1,
  586. "Node Status",
  587. 4153);
  588. config.addOption(
  589. "mainport.params.servlet.7.uri",
  590. 1,
  591. "/servlet/SFRequest/",
  592. 4160);
  593. config.addOption("mainport.params.servlet.7.method", 1, "BOTH", 4161);
  594. config.addOption(
  595. "mainport.params.servlet.7.class",
  596. 1,
  597. "freenet.client.http.SplitFileRequestServlet",
  598. 4162);
  599. config.addOption(
  600. "mainport.params.servlet.7.name",
  601. 1,
  602. "SplitFile Download Servlet (alpha!)",
  603. 4163);
  604. config.addOption(
  605. "mainport.params.servlet.7.params.requestHtl",
  606. 1,
  607. 20,
  608. 4164);
  609. config.addOption(
  610. "mainport.params.servlet.7.params.sfBlockRequestHtl",
  611. 1,
  612. 0,
  613. 4165);
  614. config.addOption(
  615. "mainport.params.servlet.7.params.sfRequestRetries",
  616. 1,
  617. 4,
  618. 4166);
  619. // Safer to go straight from 0 to 20
  620. config.addOption(
  621. "mainport.params.servlet.7.params.sfRetryHtlIncrement",
  622. 1,
  623. 20,
  624. 4167);
  625. config.addOption(
  626. "mainport.params.servlet.7.params.sfRequestThreads",
  627. 1,
  628. 30,
  629. 4168);
  630. config.addOption(
  631. "mainport.params.servlet.7.params.sfDoParanoidChecks",
  632. 1,
  633. true,
  634. 4169);
  635. config.addOption(
  636. "mainport.params.servlet.7.params.sfRefreshIntervalSecs",
  637. 1,
  638. 15,
  639. 4170);
  640. config.addOption(
  641. "mainport.params.servlet.7.params.sfForceSave",
  642. 1,
  643. false,
  644. 4171);
  645. config.addOption(
  646. "mainport.params.servlet.7.params.sfSkipDS",
  647. 1,
  648. false,
  649. 4172);
  650. config.addOption(
  651. "mainport.params.servlet.7.params.sfUseUI",
  652. 1,
  653. true,
  654. 4173);
  655. config.addOption(
  656. "mainport.params.servlet.7.params.sfRunFilter",
  657. 1,
  658. true,
  659. 4174);
  660. config.addOption(
  661. "mainport.params.servlet.7.params.sfRandomSegs",
  662. 1,
  663. true,
  664. 4175);
  665. config.addOption(
  666. "mainport.params.servlet.7.params.sfFilterParanoidStringCheck",
  667. 1,
  668. false,
  669. 4176);
  670. config.addOption(
  671. "mainport.params.servlet.7.params.sfHealHtl",
  672. 1,
  673. 20,
  674. 4177);
  675. config.addOption(
  676. "mainport.params.servlet.7.params.sfHealPercentage",
  677. 1,
  678. 100,
  679. 4178);
  680. config.addOption(
  681. "mainport.params.servlet.7.params.sfForceSave",
  682. 1,
  683. true,
  684. 4179);
  685. config.addOption(
  686. "mainport.params.servlet.7.params.maxRetries",
  687. 1,
  688. 50,
  689. 4179);
  690. String downloadDir;
  691. try {
  692. downloadDir =
  693. System.getProperty("user.home")
  694. + File.separator
  695. + "freenet-downloads";
  696. } catch (Throwable e) {
  697. downloadDir = "";
  698. }
  699. config.addOption(
  700. "mainport.params.servlet.7.params.sfDefaultSaveDir",
  701. 1,
  702. downloadDir,
  703. 4180);
  704. config.addOption(
  705. "mainport.params.servlet.7.params.sfDefaultWriteToDisk",
  706. 1,
  707. downloadDir.length()!=0,
  708. 4181);
  709. config.addOption(
  710. "mainport.params.servlet.7.params.sfDisableWriteToDisk",
  711. 1,
  712. false,
  713. 4182);
  714. config.addOption(
  715. "mainport.params.servlet.8.uri",
  716. 1,
  717. "/servlet/stream/",
  718. 4190);
  719. config.addOption("mainport.params.servlet.8.method", 1, "GET", 4191);
  720. config.addOption(
  721. "mainport.params.servlet.8.class",
  722. 1,
  723. "freenet.client.http.StreamServlet",
  724. 4192);
  725. config.addOption(
  726. "mainport.params.servlet.8.name",
  727. 1,
  728. "Freenet Streaming Servlet",
  729. 4193);
  730. config.addOption(
  731. "mainport.params.servlet.9.uri",
  732. 1,
  733. "/servlet/streamInsert/",
  734. 5101);
  735. config.addOption("mainport.params.servlet.9.method", 1, "GET", 5102);
  736. config.addOption(
  737. "mainport.params.servlet.9.class",
  738. 1,
  739. "freenet.client.http.StreamInsertServlet",
  740. 5103);
  741. config.addOption(
  742. "mainport.params.servlet.9.name",
  743. 1,
  744. "Freenet Stream Insert Servlet",
  745. 5104);
  746. config.setExpert("mainport.params.servlet.8.uri", true);
  747. config.setExpert("mainport.params.servlet.8.method", true);
  748. config.setExpert("mainport.params.servlet.8.class", true);
  749. config.setExpert("mainport.params.servlet.8.name", true);
  750. config.setExpert("mainport.params.servlet.9.uri", true);
  751. config.setExpert("mainport.params.servlet.9.method", true);
  752. config.setExpert("mainport.params.servlet.9.class", true);
  753. config.setExpert("mainport.params.servlet.9.name", true);
  754. config.addOption(
  755. "mainport.params.defaultServlet.uri",
  756. 1,
  757. "/default",
  758. 4190);
  759. config.addOption(
  760. "mainport.params.defaultServlet.method",
  761. 1,
  762. "GET",
  763. 4191);
  764. config.addOption(
  765. "mainport.params.defaultServlet.class",
  766. 1,
  767. "freenet.client.http.RedirectServlet",
  768. 4192);
  769. config.addOption(
  770. "mainport.params.defaultServlet.name",
  771. 1,
  772. "Web Interface Redirect",
  773. 4193);
  774. config.addOption(
  775. "mainport.params.defaultServlet.params.targetURL",
  776. 1,
  777. "/servlet/nodeinfo/",
  778. 4194);
  779. // RouteConnectTimeout
  780. config.setExpert("routeConnectTimeout", true);
  781. config.argDesc("routeConnectTimeout", "<millis>");
  782. config.shortDesc(
  783. "routeConnectTimeout",
  784. "wait on new connection when routing.");
  785. config.longDesc(
  786. "routeConnectTimeout",
  787. "The time to wait for connections to be established and ",
  788. "authenticated before passing by a node while routing out.",
  789. "Connections that are by passed are still finished and cached ",
  790. "for the time set by <connectionTimeout> (in milliseconds).");
  791. // maxHopsToLive
  792. config.setExpert("maxHopsToLive", true);
  793. config.argDesc("maxHopsToLive", "<integer>");
  794. config.shortDesc("maxHopsToLive", "max HTL allowed on routed requests");
  795. config.longDesc(
  796. "maxHopsToLive",
  797. "When forwarding a request, the node will reduce the HTL to this value",
  798. "if it is found to be in excess.");
  799. // maxLog2DataSize
  800. config.setExpert("maxLog2DataSize", true);
  801. config.argDesc("maxLog2DataSize", "<integer>");
  802. config.shortDesc(
  803. "maxLog2DataSize",
  804. "maximum file data size (log to base 2)");
  805. config.longDesc(
  806. "maxLog2DataSize",
  807. "The logarithm to the base 2 of the maximum file data+metadata size ",
  808. "that the node will accept. 20 means 1 megabyte, which is reasonable.");
  809. // probIncHopsSinceReset
  810. config.setExpert("probIncHopsSinceReset", true);
  811. config.argDesc("probIncHopsSinceReset", "<number between 0 and 1>");
  812. config.shortDesc(
  813. "probIncHopsSinceReset",
  814. "Probability of incrementing hopsSinceReset when forwarding a request. Leave this alone.");
  815. // cacheProbPerHop
  816. config.setExpert("cacheProbPerHop", true);
  817. config.argDesc("cacheProbPerHop", "<number between 0 and 1>");
  818. config.longDesc(
  819. "cacheProbPerHop",
  820. "Number which is raised to the power of the number of hops since a datasource reset to determine the cache probability. Set lower for better routing, higher for more caching/redundancy. The default is equivalent to approximately 5 nodes caching a file in a request.");
  821. // minStoreFullPCache
  822. config.setExpert("minStoreFullPCache", true);
  823. config.argDesc("minStoreFullPCache", "<number between 0 and 1>");
  824. config.longDesc(
  825. "minStoreFullPCache",
  826. "Minimum proportion of the datastore that must be filled before probabilistic caching kicks in.");
  827. // minRTFullPRef
  828. config.setExpert("minRTFullPRef", true);
  829. config.argDesc("minRTFullPRef", "<number between 0 and 1>");
  830. config.longDesc(
  831. "minRTFullPRef",
  832. "Minimium proportion of the routing table (classic mode) that must be filled before probabilistic ",
  833. "referencing kicks in.");
  834. // minRTNodesPRef
  835. config.setExpert("minRTNodesPRef", true);
  836. config.argDesc("minRTNodesPRef", "<number between 0 and 1>");
  837. config.longDesc(
  838. "minRTNodesPRef",
  839. "Minimum proportion of the routing table nodes that must be filled and not backed off before ",
  840. "probabilistic referencing kicks in");
  841. // nodeFile
  842. config.setExpert("nodeFile", true);
  843. config.argDesc("nodeFile", "<file>");
  844. config.shortDesc("nodeFile", "location of node's key file");
  845. config.longDesc(
  846. "nodeFile",
  847. "The path to the file containing the node's private key, DSA group,",
  848. "cipher key, etc. Defaults to node in the current directory.");
  849. // storeFile
  850. config.setExpert("storeFile", true);
  851. config.argDesc("storeFile", "<file>[,..]");
  852. config.shortDesc(
  853. "storeFile",
  854. "location of data store directory - do not put anywhere with existing files");
  855. config.longDesc(
  856. "storeFile",
  857. "The path to the single directory containing the data "
  858. + "store. The total maximum size of the files in the "
  859. + "directory is given by <storeSize>. It will create new "
  860. + "files and directories in this dir, and DELETE OLD ONES. "
  861. + "Defaults to store in the current directory.");
  862. // storeSize
  863. config.argDesc(
  864. "storeSize",
  865. "<bytes - can use kKmMgGtTpPeE multipliers>");
  866. config.shortDesc("storeSize", "size of the data store file(s)");
  867. config.longDesc(
  868. "storeSize",
  869. "The byte size of the data store directory.",
  870. "The maximum sized file that will be cached is 1/100th of",
  871. "this value. We recommend the default 256MB, to cache the largest common",
  872. "file size on freenet, 1MB plus some headers, with plenty of elbowroom, but",
  873. "any size about 101MB should be adequate (a 1MB chunk is not exactly 1MB...).",
  874. "Note that if you increase settings such as maximumThreads, you may need to",
  875. "use a larger store.");
  876. // storeType
  877. config.setExpert("storeType", true);
  878. config.argDesc("storeType", "<string>");
  879. config.shortDesc(
  880. "storeType",
  881. "datastore implementation: \"native\" (new), \"monolithic\" (old, gets the DSB), \"freenet\" (autodetect, prefer native), or \"convert\" (convert old to new)");
  882. config.longDesc(
  883. "storeType",
  884. "Datastore implementation. Put \"native\" (without the quotes) if you want the new native filesystem datastore, which stores the files in a directory. Put \"convert\" to convert from an old monolithic store to a native store. Note that convert uses lots of disk space while doing the conversion (approximately twice the datastore size), and the resulting store may be (temporarily) slightly larger than the old one due to block size mismatch (this will be fixed as soon as the node tries to add a file to the store).");
  885. // storeBlockSize
  886. config.setExpert("storeBlockSize", true);
  887. config.argDesc("storeBlockSize", "<bytes>");
  888. config.shortDesc(
  889. "storeBlockSize",
  890. "Size of filesystem accounting blocks for storeType=native");
  891. config.longDesc(
  892. "storeBlockSize",
  893. "Size of blocks in the underlying filesystem for purposes of calculating space usage when storeType=native.");
  894. // storeMaxTempFraction
  895. config.setExpert("storeMaxTempFraction", true);
  896. config.argDesc("storeMaxTempFraction", "<number between 0 and 1>");
  897. config.shortDesc(
  898. "storeMaxTempFraction",
  899. "Maximum fraction of the datastore to use for temp files (assuming the temp dir is not overridden)");
  900. // storeCipherName
  901. config.setExpert("storeCipherName", true);
  902. config.argDesc("storeCipherName", "<string>");
  903. config.shortDesc(
  904. "storeCipherName",
  905. "name of symmetric cipher algorithm");
  906. config.longDesc("storeCipherName", "deprecated");
  907. // storeCipherWidth
  908. config.setExpert("storeCipherWidth", true);
  909. config.argDesc("storeCipherWidth", "<integer>");
  910. config.shortDesc("storeCipherWidth", "bit-width of cipher key");
  911. config.longDesc("storeCipherWidth", "deprecated");
  912. // routingDir
  913. config.setExpert("routingDir", true);
  914. config.argDesc("routingDir", "<directory>");
  915. config.shortDesc(
  916. "routingDir",
  917. "The directory in which to store the routing table files. Defaults to parent dir of storeDir");
  918. // useDSIndex
  919. config.setExpert("useDSIndex", true);
  920. config.argDesc("useDSIndex", "true|false");
  921. config.shortDesc("useDSIndex", "Use a datastore index file");
  922. config.longDesc(
  923. "useDSIndex",
  924. "Use a datastore index file. Shorter startup time, but we have to run checkpoints, which lock the datastore, causing a hiccup");
  925. // rtMaxRefs
  926. config.setExpert("rtMaxRefs", true);
  927. config.argDesc("rtMaxRefs", "<integer>");
  928. config.shortDesc("rtMaxRefs", "max no. of refs per node");
  929. config.longDesc(
  930. "rtMaxRefs",
  931. "The number of references allowed per node in the routing table.",
  932. "This should not be set too high.");
  933. // rtMaxNodes
  934. config.setExpert("rtMaxNodes", true);
  935. config.argDesc("rtMaxNodes", "<integer>");
  936. config.shortDesc("rtMaxNodes", "max no. unique nodes in routing table");
  937. config.longDesc(
  938. "rtMaxNodes",
  939. "The number of unique nodes that can be contained in the routing table. Note that the node will try to keep an idle connection open to each of these, so don't set it to more than half the value of maxNodeConnections. Too big or too small will result in inefficient or completely useless routing, or slow specialization; the default 50 is reasonable (if you see another default, it's because you have an OS with too few connections).");
  940. // doEstimatorSmoothing
  941. config.setExpert("doEstimatorSmoothing", true);
  942. config.argDesc("doEstimatorSmoothing", ARG_BOOLEAN);
  943. config.longDesc("doEstimatorSmoothing",
  944. "Whether to use adjacent buckets to estimate the value of a given bucket in a KeyspaceEstimator when it has no reports. "+
  945. "If you don't understand what I just said you should probably leave it alone!");
  946. // useFastEstimators
  947. config.setExpert("useFastEstimators", true);
  948. config.argDesc("useFastEstimators", ARG_BOOLEAN);
  949. config.longDesc("useFastEstimators",
  950. "Whether to use doubles (floating point, 53 bit mantissa, implemented in hardware on most systems) instead of BigIntegers (full 160 bits, slow) in NGRouting estimators.");
  951. // minCP
  952. config.setExpert("minCP", true);
  953. config.argDesc("minCP", "<number between 0 and 1>");
  954. config.shortDesc(
  955. "minCP",
  956. "Lower bound on Contact Probability of nodes in the Routing Table");
  957. // failuresLookupARK
  958. config.setExpert("failuresLookupARK", true);
  959. config.argDesc("failuresLookupARK", "<integer>");
  960. config.shortDesc(
  961. "failuresLookupARK",
  962. "Number of consecutive failures required to trigger an ARK lookup");
  963. // minARKDelay
  964. config.setExpert("minARKDelay", true);
  965. config.argDesc("minARKDelay", "<milliseconds>");
  966. config.shortDesc(
  967. "minARKDelay",
  968. "Minimum time that a node in the routing table must have been uncontactable for before we can trigger an ARK lookup");
  969. // maxARKThreadsFraction
  970. config.setExpert("maxARKThreadsFraction", true);
  971. config.argDesc("maxARKThreadsFraction", "<number between 0 and 1>");
  972. config.shortDesc(
  973. "maxARKThreadsFraction",
  974. "Maximum fraction of maximumThreads to use for ARK lookups");
  975. // maxRoutingSteps
  976. config.setExpert("maxRoutingSteps", true);
  977. config.argDesc("maxRoutingSteps", "<integer>");
  978. config.shortDesc(
  979. "maxRoutingSteps",
  980. "max no. node refs used per routing attempt.");
  981. config.longDesc(
  982. "maxRoutingSteps",
  983. "The maximum number or node refs that will be used to route a request before RNFing. ",
  984. "-1 means 1/10th the routing table size.");
  985. // messageStoreSize
  986. config.setExpert("messageStoreSize", true);
  987. config.argDesc("messageStoreSize", "<integer>");
  988. config.shortDesc(
  989. "messageStoreSize",
  990. "max no. of simultaneous requests.");
  991. config.longDesc(
  992. "messageStoreSize",
  993. "The number of outstanding message replies the node will",
  994. "wait for before it starts to abandon them.");
  995. // failureTableSize
  996. config.setExpert("failureTableSize", true);
  997. config.argDesc("failureTableSize", "<integer>");
  998. config.shortDesc("failureTableSize", "max. no. cached failed keys.");
  999. config.longDesc(
  1000. "failureTableSize",
  1001. "The number keys that failed to be retrieved the node should key track of.");
  1002. //failureTableItems
  1003. config.setExpert("failureTableItems", true);
  1004. // failureTableTime
  1005. config.setExpert("failureTableTime", true);
  1006. config.argDesc("failureTableTime", "<milliseconds>");
  1007. config.shortDesc("failureTableTime", "max. time to fail keys.");
  1008. config.longDesc(
  1009. "failureTableTime",
  1010. "The amount of time to keep keys cache keys that could not be found and",
  1011. "automatically fail requests for them.");
  1012. // newNodePollInterval
  1013. config.setExpert("newNodePollInterval", true);
  1014. config.argDesc("newNodePollInterval", "<milliseconds>");
  1015. config.shortDesc(
  1016. "newNodePollInterval",
  1017. "interval between polling new nodes");
  1018. config.longDesc(
  1019. "newNodePollInterval",
  1020. "The node will send a request for a random "
  1021. + "recently requested key to the node in the routing table with the fewest accesses, "
  1022. + "every N milliseconds. Please enter N.");
  1023. // bandwidthLimit
  1024. config.setExpert("bandwidthLimit", true); // because deprecated
  1025. config.argDesc("bandwidthLimit", "<bytes/sec>");
  1026. config.shortDesc("bandwidthLimit", "DEPRECATED");
  1027. config.setDeprecated("bandwidthLimit", true);
  1028. config.longDesc(
  1029. "bandwidthLimit",
  1030. "The maximum number of bytes per second to transmit, totaled between",
  1031. "incoming and outgoing connections. Ignored if either inputBandwidthLimit",
  1032. "or outputBandwidthLimit is nonzero. DEPRECATED - please set inputBandwidthLimit and outputBandwidthLimit directly. Difficult to implement for NIO and not widely used.");
  1033. // inputBandwidthLimit
  1034. config.argDesc("inputBandwidthLimit", "<bytes/sec>");
  1035. config.shortDesc("inputBandwidthLimit", "incoming bandwidth limit");
  1036. config.longDesc(
  1037. "inputBandwidthLimit",
  1038. "If nonzero, specifies an independent limit for incoming data only, in bytes",
  1039. "per second. A 512kbps broadband (DSL or cable) connection is 64kB/sec, but",
  1040. "you may want to use other things than Freenet on it. However, Freenet's",
  1041. "background usage should be close to the output limit most of the time. ",
  1042. "You may want to set this and then set doLowLevelInputLimiting=false, in ",
  1043. "order to have more accurate pending-transfers load. You SHOULD do this if ",
  1044. "your connection has more outbound than inbound bandwidth.");
  1045. // outputBandwidthLimit
  1046. config.argDesc("outputBandwidthLimit", "<bytes/sec>");
  1047. config.shortDesc(
  1048. "outputBandwidthLimit",
  1049. "if enabled, outgoing bandwidth limit");
  1050. config.longDesc(
  1051. "outputBandwidthLimit",
  1052. "If nonzero, specifies an independent limit for outgoing data only, in bytes",
  1053. "per second. Not entirely accurate. If you need exact limiting, do it at the",
  1054. "OS level. A typical broadband connection has either a 128kbps or a 256kbps",
  1055. "uplink, this equates to 16kB/sec and 32kB/sec respectively. You will need to",
  1056. "keep some bandwidth back for other apps and for downloads (yes, downloading",
  1057. "uses a small amount of upload bandwidth). We suggest therefore limits of",
  1058. "12000 for a 128kbps upload connection, or 24000 for a 256kbps upload",
  1059. "connection. Most broadband connections have far more download bandwidth than",
  1060. "upload bandwidth... just because you have 1Mbps download, does not mean you",
  1061. "have 1Mbps upload; if you do not know what your connection's upload speed is,",
  1062. "use one of the above options.");
  1063. // averageBandwidthLimit
  1064. config.setExpert("averageBandwidthLimit", true);
  1065. config.argDesc("averageBandwidthLimit", "<bytes/sec>");
  1066. config.setDeprecated("averageBandwidthLimit", true);
  1067. config.shortDesc("averageBandwidthLimit", "DEPRECATED");
  1068. config.longDesc(
  1069. "averageBandwidthLimit",
  1070. "The maximum number of bytes per second to transmit (averaged over a week),",
  1071. "totaled between incoming and outgoing connections. Error to define it if",
  1072. "any of (average)inputBandwidthLimit or (average)outputBandwidthLimit is",
  1073. "nonzero. DEPRECATED - please set inputBandwidthLimit and outputBandwidthLimit directly. Difficult to implement for NIO and not widely used.");
  1074. // averageInputBandwidthLimit
  1075. config.argDesc("averageInputBandwidthLimit", "<bytes/sec>");
  1076. config.shortDesc(
  1077. "averageInputBandwidthLimit",
  1078. "incoming bandwidth limit averaged over a week");
  1079. config.longDesc(
  1080. "averageInputBandwidthLimit",
  1081. "If nonzero, specifies an independent limit for incoming data only (averaged",
  1082. "over a week). (overrides averageBandwidthLimit if nonzero)");
  1083. // averageOutputBandwidthLimit
  1084. config.argDesc("averageOutputBandwidthLimit", "<bytes/sec>");
  1085. config.shortDesc(
  1086. "averageOutputBandwidthLimit",
  1087. "outgoing bandwidth limit averaged over a week");
  1088. config.longDesc(
  1089. "averageOutputBandwidthLimit",
  1090. "If nonzero, specifies an independent limit for outgoing data only (averaged",
  1091. "over a week). (overrides bandwidthLimit if nonzero)");
  1092. // maxConnectionsPerMinute
  1093. config.setExpert("maxConnectionsPerMinute", true);
  1094. config.argDesc("maxConnectionsPerMinute", "<int>");
  1095. config.shortDesc(
  1096. "maxConnectionsPerMinute",
  1097. "Max no. of connections in one minute.");
  1098. config.longDesc(
  1099. "maxConnectionsPerMinute",
  1100. "The maximum number of outgoing connections established in a one minute period. "
  1101. + "Deprecated and ignored.");
  1102. // maxConnectionsMinute
  1103. config.setExpert("maxConnectionsMinute", true);
  1104. config.argDesc("maxConnectionsMinute", "<milliseconds>");
  1105. config.shortDesc(
  1106. "maxConnectionsMinute",
  1107. "Length of a minute in milliseconds for purposes of maxConnectionsPerMinute");
  1108. config.longDesc(
  1109. "maxConnectionsMinute",
  1110. "The length of the period over which there must be at most maxConnectionsPerMinute connections. Deprecated"
  1111. + " and ignored.");
  1112. // maxRequestsPerInterval
  1113. config.setExpert("maxRequestsPerInterval", true);
  1114. config.argDesc("maxRequestsPerInterval", "<int>");
  1115. config.shortDesc(
  1116. "maxRequestsPerInterval",
  1117. "Max no. of outgoing requests per maxRequestsInterval.");
  1118. config.longDesc(
  1119. "maxRequestsPerInterval",
  1120. "The maximum number of outgoing requests per maxRequestsInterval. -1 = disable.");
  1121. // maxRequestsInterval
  1122. config.setExpert("maxRequestsInterval", true);
  1123. config.argDesc("maxRequestsInterval", "<milliseconds>");
  1124. config.shortDesc(
  1125. "maxRequestsInterval",
  1126. "Length of the period in milliseconds for purposes of maxRequestsPerInterval");
  1127. config.longDesc(
  1128. "maxRequestsInterval",
  1129. "The length of the period over which there must be at most maxRequestsPerInterval connections.");
  1130. // maxNodeConnections
  1131. config.setExpert("maxNodeConnections", true);
  1132. config.argDesc("maxNodeConnections", "<positive integer>");
  1133. config.shortDesc(
  1134. "maxNodeConnections",
  1135. "Max. no. of connections to other "
  1136. + "nodes. Deprecated unless maximumThreads=0.");
  1137. config.longDesc(
  1138. "maxNodeConnections",
  1139. "The maximum number of incoming and outgoing connections to "
  1140. + "allow at the same time. Forced to 0.4*maximumThreads unless"
  1141. + " maximumThreads = 0.");
  1142. // maxOpenConnectionsNewbieFraction
  1143. config.setExpert("maxOpenConnectionsNewbieFraction", true);
  1144. config.argDesc ("maxOpenConnectionsNewbieFraction", "<number between 0.0 and 1.0>");
  1145. config.shortDesc("maxOpenConnectionsNewbieFraction",
  1146. "Proportion of open connections limit that may be newbie nodes before we start "+
  1147. "rejecting new connections (unless there are free slots)");
  1148. // maxNodeFilesOpen
  1149. config.setExpert("maxNodeFilesOpen", true);
  1150. config.argDesc("maxNodeFilesOpen", "<positive integer>");
  1151. config.longDesc(
  1152. "maxNodeFilesOpen",
  1153. "Maximum number of file descriptors used by the node for files. Not including connections.");
  1154. // maxNegotiations
  1155. config.setExpert("maxNegotiations", true);
  1156. config.argDesc ("maxNegotiations", "<positive integer>");
  1157. config.shortDesc("maxNegotiations", "maximum number of simultaneous connection opens initiated by the node");
  1158. // ipAddress
  1159. config.setExpert("ipAddress", true);
  1160. config.argDesc("ipAddress", "xxx.xxx.xxx.xxx");
  1161. config.shortDesc(
  1162. "ipAddress",
  1163. "your IP as seen by the public internet (normally this is autoconfigured)");
  1164. config.longDesc(
  1165. "ipAddress",
  1166. "The IP address of this node as seen by the "
  1167. + "public Internet. You only need to override this "
  1168. + "if it cannot be autodetected, for example if you "
  1169. + "have a NAT (a.k.a. IP Masquerading) "
  1170. + "firewall/router, in which case you will need "
  1171. + "to set it to the IP address or DNS name of the "
  1172. + "internet-side interface of the router, which "
  1173. + "needs to be static (www.dyndns.org and similar "
  1174. + "services can help here if you have a dynamic IP).");
  1175. // listenPort
  1176. config.argDesc("listenPort", "<port no.>");
  1177. config.shortDesc("listenPort", "incoming FNP port");
  1178. config.longDesc(
  1179. "listenPort",
  1180. "The port to listen for incoming FNP (Freenet Node Protocol) connections on.");
  1181. // clientPort
  1182. config.setExpert("clientPort", true);
  1183. config.argDesc("clientPort", "<port no.>");
  1184. config.shortDesc("clientPort", "incoming FCP port");
  1185. config.longDesc(
  1186. "clientPort",
  1187. "The port to listen for local FCP (Freenet Client Protocol) connections on.");
  1188. // fcpHosts
  1189. config.setExpert("fcpHosts", true);
  1190. config.argDesc("fcpHosts", "<host list>");
  1191. config.shortDesc("fcpHosts", "hosts allowed to connect with FCP");
  1192. config.longDesc(
  1193. "fcpHosts",
  1194. "A comma-separated list of hosts that may connect to the FCP port",
  1195. "(clientPort). If left blank, only the localhost will be allowed."
  1196. + " If you set this, make sure localhost is included in the list or "
  1197. + " access won't be allowed from the local machine. ",
  1198. "May be given as IP addresses or host names.");
  1199. // logLevel
  1200. config.argDesc("logLevel", "<word>");
  1201. config.shortDesc("logLevel", "error, normal, minor, or debug");
  1202. config.longDesc(
  1203. "logLevel",
  1204. "The error reporting threshold, one of:",
  1205. " Error: Errors only",
  1206. " Normal: Report significant events, and errors",
  1207. " Minor: Report minor events, significant events, and errors",
  1208. " Debug: Report everything that can be reported");
  1209. // logLevelDetail
  1210. config.setExpert("logLevelDetail", true);
  1211. config.argDesc(
  1212. "logLevelDetail",
  1213. "<list of class name or package name = level e.g. freenet.node.rt:debug,freenet.support:minor>");
  1214. config.shortDesc(
  1215. "logLeveā€¦

Large files files are truncated, but you can click here to view the full file