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(SQLite3DB::DB *db)
\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 db->Execute("BEGIN;");
\r
16 std::ostringstream tempstr; // must set tempstr to "" between db inserts
\r
17 SQLite3DB::Statement st=db->Prepare("INSERT INTO tblOption(Option,OptionValue) VALUES(?,?);");
\r
18 SQLite3DB::Statement upd=db->Prepare("UPDATE tblOption SET Section=?, SortOrder=?, ValidValues=?, OptionDescription=?, DisplayType=?, DisplayParam1=?, DisplayParam2=?, Mode=? WHERE Option=?;");
\r
23 tempstr << Poco::Message::PRIO_DEBUG;
\r
24 st.Bind(0,"LogLevel");
\r
25 st.Bind(1,tempstr.str());
\r
28 upd.Bind(0,"Program");
\r
29 upd.Bind(1,order++);
\r
30 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
31 upd.Bind(3,"The maximum logging level that will be written to file. Higher levels will include all messages from the previous levels.");
\r
32 upd.Bind(4,"select");
\r
35 upd.Bind(7,"simple");
\r
36 upd.Bind(8,"LogLevel");
\r
40 st.Bind(0,"VacuumOnStartup");
\r
44 upd.Bind(0,"Program");
\r
45 upd.Bind(1,order++);
\r
46 upd.Bind(2,"true|true|false|false");
\r
47 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
48 upd.Bind(4,"select");
\r
51 upd.Bind(7,"simple");
\r
52 upd.Bind(8,"VacuumOnStartup");
\r
56 st.Bind(0,"MessageBase");
\r
60 upd.Bind(0,"Program");
\r
61 upd.Bind(1,order++);
\r
63 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
64 upd.Bind(4,"textbox");
\r
67 upd.Bind(7,"advanced");
\r
68 upd.Bind(8,"MessageBase");
\r
72 st.Bind(0,"FMSVersionKey");
\r
73 st.Bind(1,"USK@0npnMrqZNKRCRoGojZV93UNHCMN-6UU3rRSAmP6jNLE,~BG-edFtdCC1cSH4O3BWdeIYa8Sw5DfyrSV-TKdO5ec,AQACAAE/fmsversion/");
\r
76 upd.Bind(0,"Program");
\r
77 upd.Bind(1,order++);
\r
79 upd.Bind(3,"The USK key which contains information about the latest version of FMS.");
\r
80 upd.Bind(4,"textbox");
\r
83 upd.Bind(7,"advanced");
\r
84 upd.Bind(8,"FMSVersionKey");
\r
88 st.Bind(0,"FMSVersionEdition");
\r
89 st.Bind(1,FMS_VERSION_EDITION);
\r
92 upd.Bind(0,"Program");
\r
93 upd.Bind(1,order++);
\r
95 upd.Bind(3,"The latest found edition of the FMS version USK.");
\r
96 upd.Bind(4,"textbox");
\r
99 upd.Bind(7,"advanced");
\r
100 upd.Bind(8,"FMSVersionEdition");
\r
105 st.Bind(0,"StartNNTP");
\r
109 upd.Bind(0,"NNTP Server");
\r
110 upd.Bind(1,order++);
\r
111 upd.Bind(2,"true|true|false|false");
\r
112 upd.Bind(3,"Start NNTP server.");
\r
113 upd.Bind(4,"select");
\r
116 upd.Bind(7,"simple");
\r
117 upd.Bind(8,"StartNNTP");
\r
122 st.Bind(0,"NNTPListenPort");
\r
126 upd.Bind(0,"NNTP Server");
\r
127 upd.Bind(1,order++);
\r
129 upd.Bind(3,"The port that the NNTP service will listen for incoming connections.");
\r
130 upd.Bind(4,"textbox");
\r
133 upd.Bind(7,"simple");
\r
134 upd.Bind(8,"NNTPListenPort");
\r
138 // NNTPBindAddresses
\r
139 st.Bind(0,"NNTPBindAddresses");
\r
140 st.Bind(1,"localhost,127.0.0.1");
\r
143 upd.Bind(0,"NNTP Server");
\r
144 upd.Bind(1,order++);
\r
146 upd.Bind(3,"A comma separated list of valid IPv4 or IPv6 addresses/hostnames that the NNTP service will try to bind to.");
\r
147 upd.Bind(4,"textbox");
\r
150 upd.Bind(7,"simple");
\r
151 upd.Bind(8,"NNTPBindAddresses");
\r
155 st.Bind(0,"NNTPAllowPost");
\r
159 upd.Bind(0,"NNTP Server");
\r
160 upd.Bind(1,order++);
\r
161 upd.Bind(2,"true|true|false|false");
\r
162 upd.Bind(3,"Allow posting messages from NNTP. Setting to false will make the newsgroups read only.");
\r
163 upd.Bind(4,"select");
\r
166 upd.Bind(7,"simple");
\r
167 upd.Bind(8,"NNTPAllowPost");
\r
171 st.Bind(0,"StartHTTP");
\r
175 upd.Bind(0,"HTTP Server");
\r
176 upd.Bind(1,order++);
\r
177 upd.Bind(2,"true|true|false|false");
\r
178 upd.Bind(3,"Start HTTP server. WARNING: If you turn this off, you won't be able to access the administration pages.");
\r
179 upd.Bind(4,"select");
\r
182 upd.Bind(7,"simple");
\r
183 upd.Bind(8,"StartHTTP");
\r
187 st.Bind(0,"HTTPListenPort");
\r
191 upd.Bind(0,"HTTP Server");
\r
192 upd.Bind(1,order++);
\r
194 upd.Bind(3,"Port HTTP server will listen on.");
\r
195 upd.Bind(4,"textbox");
\r
198 upd.Bind(7,"simple");
\r
199 upd.Bind(8,"HTTPListenPort");
\r
203 st.Bind(0,"HTTPAccessControl");
\r
204 st.Bind(1,"-0.0.0.0/0,+127.0.0.1");
\r
207 upd.Bind(0,"HTTP Server");
\r
208 upd.Bind(1,order++);
\r
210 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
211 upd.Bind(4,"textbox");
\r
214 upd.Bind(7,"simple");
\r
215 upd.Bind(8,"HTTPAccessControl");
\r
219 // StartFreenetUpdater
\r
220 st.Bind(0,"StartFreenetUpdater");
\r
224 upd.Bind(0,"Freenet Connection");
\r
225 upd.Bind(1,order++);
\r
226 upd.Bind(2,"true|true|false|false");
\r
227 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
228 upd.Bind(4,"select");
\r
231 upd.Bind(7,"simple");
\r
232 upd.Bind(8,"StartFreenetUpdater");
\r
237 st.Bind(0,"FCPHost");
\r
238 st.Bind(1,"127.0.0.1");
\r
241 upd.Bind(0,"Freenet Connection");
\r
242 upd.Bind(1,order++);
\r
244 upd.Bind(3,"Host name or address of Freenet node.");
\r
245 upd.Bind(4,"textbox");
\r
248 upd.Bind(7,"simple");
\r
249 upd.Bind(8,"FCPHost");
\r
254 st.Bind(0,"FCPPort");
\r
258 upd.Bind(0,"Freenet Connection");
\r
259 upd.Bind(1,order++);
\r
261 upd.Bind(3,"The port that Freenet is listening for FCP connections on.");
\r
262 upd.Bind(4,"textbox");
\r
265 upd.Bind(7,"simple");
\r
266 upd.Bind(8,"FCPPort");
\r
270 st.Bind(0,"FProxyPort");
\r
274 upd.Bind(0,"Freenet Connection");
\r
275 upd.Bind(1,order++);
\r
277 upd.Bind(3,"The port that Freenet is listening for http connections on.");
\r
278 upd.Bind(4,"textbox");
\r
281 upd.Bind(7,"simple");
\r
282 upd.Bind(8,"FProxyPort");
\r
286 st.Bind(0,"MaxIdentityRequests");
\r
290 upd.Bind(0,"Requests");
\r
291 upd.Bind(1,order++);
\r
293 upd.Bind(3,"Maximum number of concurrent requests for new Identity xml files");
\r
294 upd.Bind(4,"textbox");
\r
297 upd.Bind(7,"advanced");
\r
298 upd.Bind(8,"MaxIdentityRequests");
\r
302 st.Bind(0,"MaxIdentityIntroductionRequests");
\r
306 upd.Bind(0,"Requests");
\r
307 upd.Bind(1,order++);
\r
309 upd.Bind(3,"Maximum number of concurrent identities requesting IdentityIntroduction xml files. Each identity may have multiple requests pending.");
\r
310 upd.Bind(4,"textbox");
\r
313 upd.Bind(7,"advanced");
\r
314 upd.Bind(8,"MaxIdentityIntroductionRequests");
\r
318 st.Bind(0,"MaxIntroductionPuzzleRequests");
\r
322 upd.Bind(0,"Requests");
\r
323 upd.Bind(1,order++);
\r
325 upd.Bind(3,"Maximum number of concurrent requests for new IntroductionPuzzle xml files");
\r
326 upd.Bind(4,"textbox");
\r
329 upd.Bind(7,"advanced");
\r
330 upd.Bind(8,"MaxIntroductionPuzzleRequests");
\r
334 st.Bind(0,"MaxTrustListRequests");
\r
338 upd.Bind(0,"Requests");
\r
339 upd.Bind(1,order++);
\r
341 upd.Bind(3,"Maximum number of concurrent requests for new Trust Lists");
\r
342 upd.Bind(4,"textbox");
\r
345 upd.Bind(7,"advanced");
\r
346 upd.Bind(8,"MaxTrustListRequests");
\r
350 st.Bind(0,"MaxMessageListRequests");
\r
354 upd.Bind(0,"Requests");
\r
355 upd.Bind(1,order++);
\r
357 upd.Bind(3,"Maximum number of concurrent requests for new Message Lists");
\r
358 upd.Bind(4,"textbox");
\r
361 upd.Bind(7,"advanced");
\r
362 upd.Bind(8,"MaxMessageListRequests");
\r
366 st.Bind(0,"MaxMessageRequests");
\r
370 upd.Bind(0,"Requests");
\r
371 upd.Bind(1,order++);
\r
373 upd.Bind(3,"Maximum number of concurrent requests for new Messages");
\r
374 upd.Bind(4,"textbox");
\r
377 upd.Bind(7,"advanced");
\r
378 upd.Bind(8,"MaxMessageRequests");
\r
382 st.Bind(0,"MaxBoardListRequests");
\r
386 upd.Bind(0,"Requests");
\r
387 upd.Bind(1,order++);
\r
389 upd.Bind(3,"The maximum number of concurrent requests for new Board Lists. Set to 0 to disable.");
\r
390 upd.Bind(4,"textbox");
\r
393 upd.Bind(7,"advanced");
\r
394 upd.Bind(8,"MaxBoardListRequests");
\r
398 st.Bind(0,"MinLocalMessageTrust");
\r
402 upd.Bind(0,"Trust");
\r
403 upd.Bind(1,order++);
\r
405 upd.Bind(3,"Specifies a local message trust level that a peer must have before its messages will be downloaded.");
\r
406 upd.Bind(4,"textbox");
\r
409 upd.Bind(7,"simple");
\r
410 upd.Bind(8,"MinLocalMessageTrust");
\r
414 st.Bind(0,"MinPeerMessageTrust");
\r
418 upd.Bind(0,"Trust");
\r
419 upd.Bind(1,order++);
\r
421 upd.Bind(3,"Specifies a peer message trust level that a peer must have before its messages will be downloaded.");
\r
422 upd.Bind(4,"textbox");
\r
425 upd.Bind(7,"simple");
\r
426 upd.Bind(8,"MinPeerMessageTrust");
\r
430 st.Bind(0,"MinLocalTrustListTrust");
\r
434 upd.Bind(0,"Trust");
\r
435 upd.Bind(1,order++);
\r
437 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
438 upd.Bind(4,"textbox");
\r
441 upd.Bind(7,"simple");
\r
442 upd.Bind(8,"MinLocalTrustListTrust");
\r
446 st.Bind(0,"MinPeerTrustListTrust");
\r
450 upd.Bind(0,"Trust");
\r
451 upd.Bind(1,order++);
\r
453 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
454 upd.Bind(4,"textbox");
\r
457 upd.Bind(7,"simple");
\r
458 upd.Bind(8,"MinPeerTrustListTrust");
\r
462 st.Bind(0,"LocalTrustOverridesPeerTrust");
\r
463 st.Bind(1,"false");
\r
466 upd.Bind(0,"Trust");
\r
467 upd.Bind(1,order++);
\r
468 upd.Bind(2,"true|true|false|false");
\r
469 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
470 upd.Bind(4,"select");
\r
473 upd.Bind(7,"simple");
\r
474 upd.Bind(8,"LocalTrustOverridesPeerTrust");
\r
478 st.Bind(0,"MessageDownloadMaxDaysBackward");
\r
482 upd.Bind(0,"Messages");
\r
483 upd.Bind(1,order++);
\r
485 upd.Bind(3,"The maximum number of days backward that messages will be downloaded from each identity");
\r
486 upd.Bind(4,"textbox");
\r
489 upd.Bind(7,"simple");
\r
490 upd.Bind(8,"MessageDownloadMaxDaysBackward");
\r
494 st.Bind(0,"MessageListDaysBackward");
\r
498 upd.Bind(0,"Messages");
\r
499 upd.Bind(1,order++);
\r
501 upd.Bind(3,"The number of days backward that messages you have inserted will appear in your MessageLists");
\r
502 upd.Bind(4,"textbox");
\r
505 upd.Bind(7,"simple");
\r
506 upd.Bind(8,"MessageListDaysBackward");
\r
510 st.Bind(0,"MaxPeerMessagesPerDay");
\r
514 upd.Bind(0,"Messages");
\r
515 upd.Bind(1,order++);
\r
517 upd.Bind(3,"The maximum number of messages you will download from each peer on a given day.");
\r
518 upd.Bind(4,"textbox");
\r
521 upd.Bind(7,"simple");
\r
522 upd.Bind(8,"MaxPeerMessagesPerDay");
\r
526 st.Bind(0,"MaxBoardsPerMessage");
\r
530 upd.Bind(0,"Messages");
\r
531 upd.Bind(1,order++);
\r
533 upd.Bind(3,"The maximum number of boards a received message may be sent to. Boards over this limit will be ignored.");
\r
534 upd.Bind(4,"textbox");
\r
537 upd.Bind(7,"simple");
\r
538 upd.Bind(8,"MaxBoardsPerMessage");
\r
542 st.Bind(0,"SaveMessagesFromNewBoards");
\r
546 upd.Bind(0,"Messages");
\r
547 upd.Bind(1,order++);
\r
548 upd.Bind(2,"true|true|false|false");
\r
549 upd.Bind(3,"Set to true to automatically save messages posted to new boards. Set to false to ignore messages to new boards.");
\r
550 upd.Bind(4,"select");
\r
553 upd.Bind(7,"simple");
\r
554 upd.Bind(8,"SaveMessagesFromNewBoards");
\r
558 st.Bind(0,"ChangeMessageTrustOnReply");
\r
562 upd.Bind(0,"Messages");
\r
563 upd.Bind(1,order++);
\r
565 upd.Bind(3,"How much the local message trust level of an identity should change when you reply to one of their messages.");
\r
566 upd.Bind(4,"textbox");
\r
569 upd.Bind(7,"simple");
\r
570 upd.Bind(8,"ChangeMessageTrustOnReply");
\r
574 st.Bind(0,"AddNewPostFromIdentities");
\r
575 st.Bind(1,"false");
\r
578 upd.Bind(0,"Messages");
\r
579 upd.Bind(1,order++);
\r
580 upd.Bind(2,"true|true|false|false");
\r
581 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
582 upd.Bind(4,"select");
\r
585 upd.Bind(7,"simple");
\r
586 upd.Bind(8,"AddNewPostFromIdentities");
\r
590 st.Bind(0,"DeleteMessagesOlderThan");
\r
594 upd.Bind(0,"Messages");
\r
595 upd.Bind(1,order++);
\r
597 upd.Bind(3,"Automatically delete messages older than this many days.");
\r
598 upd.Bind(4,"textbox");
\r
601 upd.Bind(7,"simple");
\r
602 upd.Bind(8,"DeleteMessagesOlderThan");
\r
606 db->Execute("COMMIT;");
\r