1 #include "../include/optionssetup.h"
\r
2 #include "../include/db/sqlite3db.h"
\r
3 #include "../include/global.h"
\r
5 #include <Poco/Message.h>
\r
10 void SetupDefaultOptions()
\r
12 // OptionValue should always be inserted as a string, even if the option really isn't a string - just to keep the field data type consistent
\r
14 std::ostringstream tempstr; // must set tempstr to "" between db inserts
\r
15 SQLite3DB::DB *db=SQLite3DB::DB::Instance();
\r
16 SQLite3DB::Statement st=db->Prepare("INSERT INTO tblOption(Option,OptionValue) VALUES(?,?);");
\r
17 SQLite3DB::Statement upd=db->Prepare("UPDATE tblOption SET Section=?, SortOrder=?, ValidValues=?, OptionDescription=? WHERE Option=?;");
\r
22 tempstr << Poco::Message::PRIO_DEBUG;
\r
23 st.Bind(0,"LogLevel");
\r
24 st.Bind(1,tempstr.str());
\r
27 upd.Bind(0,"Program");
\r
28 upd.Bind(1,order++);
\r
29 upd.Bind(2,"1|1 - Fatal Errors|2|2 - Critical Errors|3|3 - Errors|4|4 - Warnings|5|5 - Notices|6|6 - Informational Messages|7|7 - Debug Messages|8|8 - Trace Messages");
\r
30 upd.Bind(3,"The maximum logging level that will be written to file. Higher levels will include all messages from the previous levels.");
\r
31 upd.Bind(4,"LogLevel");
\r
35 st.Bind(0,"VacuumOnStartup");
\r
39 upd.Bind(0,"Program");
\r
40 upd.Bind(1,order++);
\r
41 upd.Bind(2,"true|true|false|false");
\r
42 upd.Bind(3,"VACUUM the database every time FMS starts. This will defragment the free space in the database and create a smaller database file. Vacuuming the database can be CPU and disk intensive.");
\r
43 upd.Bind(4,"VacuumOnStartup");
\r
47 st.Bind(0,"MessageBase");
\r
51 upd.Bind(0,"Program");
\r
52 upd.Bind(1,order++);
\r
54 upd.Bind(3,"A unique string shared by all clients who want to communicate with each other. This should not be changed unless you want to create your own separate communications network.");
\r
55 upd.Bind(4,"MessageBase");
\r
59 st.Bind(0,"FMSVersionKey");
\r
60 st.Bind(1,"USK@0npnMrqZNKRCRoGojZV93UNHCMN-6UU3rRSAmP6jNLE,~BG-edFtdCC1cSH4O3BWdeIYa8Sw5DfyrSV-TKdO5ec,AQACAAE/fmsversion/");
\r
63 upd.Bind(0,"Program");
\r
64 upd.Bind(1,order++);
\r
66 upd.Bind(3,"The USK key which contains information about the latest version of FMS.");
\r
67 upd.Bind(4,"FMSVersionKey");
\r
71 st.Bind(0,"FMSVersionEdition");
\r
72 st.Bind(1,FMS_VERSION_EDITION);
\r
75 upd.Bind(0,"Program");
\r
76 upd.Bind(1,order++);
\r
78 upd.Bind(3,"The latest found edition of the FMS version USK.");
\r
79 upd.Bind(4,"FMSVersionEdition");
\r
84 st.Bind(0,"StartNNTP");
\r
88 upd.Bind(0,"NNTP Server");
\r
89 upd.Bind(1,order++);
\r
90 upd.Bind(2,"true|true|false|false");
\r
91 upd.Bind(3,"Start NNTP server.");
\r
92 upd.Bind(4,"StartNNTP");
\r
97 st.Bind(0,"NNTPListenPort");
\r
101 upd.Bind(0,"NNTP Server");
\r
102 upd.Bind(1,order++);
\r
104 upd.Bind(3,"The port that the NNTP service will listen for incoming connections.");
\r
105 upd.Bind(4,"NNTPListenPort");
\r
109 // NNTPBindAddresses
\r
110 st.Bind(0,"NNTPBindAddresses");
\r
111 st.Bind(1,"localhost,127.0.0.1");
\r
114 upd.Bind(0,"NNTP Server");
\r
115 upd.Bind(1,order++);
\r
117 upd.Bind(3,"A comma separated list of valid IPv4 or IPv6 addresses/hostnames that the NNTP service will try to bind to.");
\r
118 upd.Bind(4,"NNTPBindAddresses");
\r
122 st.Bind(0,"NNTPAllowPost");
\r
126 upd.Bind(0,"NNTP Server");
\r
127 upd.Bind(1,order++);
\r
128 upd.Bind(2,"true|true|false|false");
\r
129 upd.Bind(3,"Allow posting messages from NNTP. Setting to false will make the newsgroups read only.");
\r
130 upd.Bind(4,"NNTPAllowPost");
\r
134 st.Bind(0,"StartHTTP");
\r
138 upd.Bind(0,"HTTP Server");
\r
139 upd.Bind(1,order++);
\r
140 upd.Bind(2,"true|true|false|false");
\r
141 upd.Bind(3,"Start HTTP server. WARNING: If you turn this off, you won't be able to access the administration pages.");
\r
142 upd.Bind(4,"StartHTTP");
\r
146 st.Bind(0,"HTTPListenPort");
\r
150 upd.Bind(0,"HTTP Server");
\r
151 upd.Bind(1,order++);
\r
153 upd.Bind(3,"Port HTTP server will listen on.");
\r
154 upd.Bind(4,"HTTPListenPort");
\r
158 st.Bind(0,"HTTPAccessControl");
\r
159 st.Bind(1,"-0.0.0.0/0,+127.0.0.1");
\r
162 upd.Bind(0,"HTTP Server");
\r
163 upd.Bind(1,order++);
\r
165 upd.Bind(3,"Comma separated list of addresses and/or subnet masks that are allowed access to the administration pages. Default is localhost only. + allows a host, - denies a host.");
\r
166 upd.Bind(4,"HTTPAccessControl");
\r
170 // StartFreenetUpdater
\r
171 st.Bind(0,"StartFreenetUpdater");
\r
175 upd.Bind(0,"Freenet Connection");
\r
176 upd.Bind(1,order++);
\r
177 upd.Bind(2,"true|true|false|false");
\r
178 upd.Bind(3,"Set to true to start the Freenet Updater thread and connect to Freenet. Set to false to prevent communication with Freenet.");
\r
179 upd.Bind(4,"StartFreenetUpdater");
\r
184 st.Bind(0,"FCPHost");
\r
185 st.Bind(1,"127.0.0.1");
\r
188 upd.Bind(0,"Freenet Connection");
\r
189 upd.Bind(1,order++);
\r
191 upd.Bind(3,"Host name or address of Freenet node.");
\r
192 upd.Bind(4,"FCPHost");
\r
197 st.Bind(0,"FCPPort");
\r
201 upd.Bind(0,"Freenet Connection");
\r
202 upd.Bind(1,order++);
\r
204 upd.Bind(3,"The port that Freenet is listening for FCP connections on.");
\r
205 upd.Bind(4,"FCPPort");
\r
209 st.Bind(0,"FProxyPort");
\r
213 upd.Bind(0,"Freenet Connection");
\r
214 upd.Bind(1,order++);
\r
216 upd.Bind(3,"The port that Freenet is listening for http connections on.");
\r
217 upd.Bind(4,"FProxyPort");
\r
221 st.Bind(0,"MaxIdentityRequests");
\r
225 upd.Bind(0,"Requests");
\r
226 upd.Bind(1,order++);
\r
228 upd.Bind(3,"Maximum number of concurrent requests for new Identity xml files");
\r
229 upd.Bind(4,"MaxIdentityRequests");
\r
233 st.Bind(0,"MaxIdentityIntroductionRequests");
\r
237 upd.Bind(0,"Requests");
\r
238 upd.Bind(1,order++);
\r
240 upd.Bind(3,"Maximum number of concurrent identities requesting IdentityIntroduction xml files. Each identity may have multiple requests pending.");
\r
241 upd.Bind(4,"MaxIdentityIntroductionRequests");
\r
245 st.Bind(0,"MaxIntroductionPuzzleRequests");
\r
249 upd.Bind(0,"Requests");
\r
250 upd.Bind(1,order++);
\r
252 upd.Bind(3,"Maximum number of concurrent requests for new IntroductionPuzzle xml files");
\r
253 upd.Bind(4,"MaxIntroductionPuzzleRequests");
\r
257 st.Bind(0,"MaxTrustListRequests");
\r
261 upd.Bind(0,"Requests");
\r
262 upd.Bind(1,order++);
\r
264 upd.Bind(3,"Maximum number of concurrent requests for new Trust Lists");
\r
265 upd.Bind(4,"MaxTrustListRequests");
\r
269 st.Bind(0,"MaxMessageListRequests");
\r
273 upd.Bind(0,"Requests");
\r
274 upd.Bind(1,order++);
\r
276 upd.Bind(3,"Maximum number of concurrent requests for new Message Lists");
\r
277 upd.Bind(4,"MaxMessageListRequests");
\r
281 st.Bind(0,"MaxMessageRequests");
\r
285 upd.Bind(0,"Requests");
\r
286 upd.Bind(1,order++);
\r
288 upd.Bind(3,"Maximum number of concurrent requests for new Messages");
\r
289 upd.Bind(4,"MaxMessageRequests");
\r
293 st.Bind(0,"MaxBoardListRequests");
\r
297 upd.Bind(0,"Requests");
\r
298 upd.Bind(1,order++);
\r
300 upd.Bind(3,"The maximum number of concurrent requests for new Board Lists. Set to 0 to disable.");
\r
301 upd.Bind(4,"MaxBoardListRequests");
\r
305 st.Bind(0,"MinLocalMessageTrust");
\r
309 upd.Bind(0,"Trust");
\r
310 upd.Bind(1,order++);
\r
312 upd.Bind(3,"Specifies a local message trust level that a peer must have before its messages will be downloaded.");
\r
313 upd.Bind(4,"MinLocalMessageTrust");
\r
317 st.Bind(0,"MinPeerMessageTrust");
\r
321 upd.Bind(0,"Trust");
\r
322 upd.Bind(1,order++);
\r
324 upd.Bind(3,"Specifies a peer message trust level that a peer must have before its messages will be downloaded.");
\r
325 upd.Bind(4,"MinPeerMessageTrust");
\r
329 st.Bind(0,"MinLocalTrustListTrust");
\r
333 upd.Bind(0,"Trust");
\r
334 upd.Bind(1,order++);
\r
336 upd.Bind(3,"Specifies a local trust list trust level that a peer must have before its trust list will be included in the weighted average. Any peers below this number will be excluded from the results.");
\r
337 upd.Bind(4,"MinLocalTrustListTrust");
\r
341 st.Bind(0,"MinPeerTrustListTrust");
\r
345 upd.Bind(0,"Trust");
\r
346 upd.Bind(1,order++);
\r
348 upd.Bind(3,"Specifies a peer trust list trust level that a peer must have before its trust list will be included in the weighted average. Any peers below this number will be excluded from the results.");
\r
349 upd.Bind(4,"MinPeerTrustListTrust");
\r
353 st.Bind(0,"LocalTrustOverridesPeerTrust");
\r
354 st.Bind(1,"false");
\r
357 upd.Bind(0,"Trust");
\r
358 upd.Bind(1,order++);
\r
359 upd.Bind(2,"true|true|false|false");
\r
360 upd.Bind(3,"Set to true if you want your local trust levels to override the peer levels when determining which identities you will poll.");
\r
361 upd.Bind(4,"LocalTrustOverridesPeerTrust");
\r
365 st.Bind(0,"MessageDownloadMaxDaysBackward");
\r
369 upd.Bind(0,"Messages");
\r
370 upd.Bind(1,order++);
\r
372 upd.Bind(3,"The maximum number of days backward that messages will be downloaded from each identity");
\r
373 upd.Bind(4,"MessageDownloadMaxDaysBackward");
\r
377 st.Bind(0,"MessageListDaysBackward");
\r
381 upd.Bind(0,"Messages");
\r
382 upd.Bind(1,order++);
\r
384 upd.Bind(3,"The number of days backward that messages you have inserted will appear in your MessageLists");
\r
385 upd.Bind(4,"MessageListDaysBackward");
\r
389 st.Bind(0,"MaxPeerMessagesPerDay");
\r
393 upd.Bind(0,"Messages");
\r
394 upd.Bind(1,order++);
\r
396 upd.Bind(3,"The maximum number of messages you will download from each peer on a given day.");
\r
397 upd.Bind(4,"MaxPeerMessagesPerDay");
\r
401 st.Bind(0,"MaxBoardsPerMessage");
\r
405 upd.Bind(0,"Messages");
\r
406 upd.Bind(1,order++);
\r
408 upd.Bind(3,"The maximum number of boards a received message may be sent to. Boards over this limit will be ignored.");
\r
409 upd.Bind(4,"MaxBoardsPerMessage");
\r
413 st.Bind(0,"SaveMessagesFromNewBoards");
\r
417 upd.Bind(0,"Messages");
\r
418 upd.Bind(1,order++);
\r
419 upd.Bind(2,"true|true|false|false");
\r
420 upd.Bind(3,"Set to true to automatically save messages posted to new boards. Set to false to ignore messages to new boards.");
\r
421 upd.Bind(4,"SaveMessagesFromNewBoards");
\r
425 st.Bind(0,"ChangeMessageTrustOnReply");
\r
429 upd.Bind(0,"Messages");
\r
430 upd.Bind(1,order++);
\r
432 upd.Bind(3,"How much the local message trust level of an identity should change when you reply to one of their messages.");
\r
433 upd.Bind(4,"ChangeMessageTrustOnReply");
\r
437 st.Bind(0,"AddNewPostFromIdentities");
\r
438 st.Bind(1,"false");
\r
441 upd.Bind(0,"Messages");
\r
442 upd.Bind(1,order++);
\r
443 upd.Bind(2,"true|true|false|false");
\r
444 upd.Bind(3,"Set to true to automatically create new identities when you send a message using a new name. If you set this to false, posting messages will fail until you manually create the identity.");
\r
445 upd.Bind(4,"AddNewPostFromIdentities");
\r
449 st.Bind(0,"DeleteMessagesOlderThan");
\r
453 upd.Bind(0,"Messages");
\r
454 upd.Bind(1,order++);
\r
456 upd.Bind(3,"Automatically delete messages older than this many days.");
\r
457 upd.Bind(4,"DeleteMessagesOlderThan");
\r