1 #include "../include/optionssetup.h"
\r
2 #include "../include/db/sqlite3db.h"
\r
4 #include <Poco/Message.h>
\r
9 void SetupDefaultOptions()
\r
11 // 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
13 std::ostringstream tempstr; // must set tempstr to "" between db inserts
\r
14 SQLite3DB::DB *db=SQLite3DB::DB::Instance();
\r
15 SQLite3DB::Statement st=db->Prepare("INSERT INTO tblOption(Option,OptionValue) VALUES(?,?);");
\r
16 SQLite3DB::Statement upd=db->Prepare("UPDATE tblOption SET Section=?, SortOrder=?, ValidValues=?, OptionDescription=? WHERE Option=?;");
\r
21 tempstr << Poco::Message::PRIO_DEBUG;
\r
22 st.Bind(0,"LogLevel");
\r
23 st.Bind(1,tempstr.str());
\r
26 upd.Bind(0,"Program");
\r
27 upd.Bind(1,order++);
\r
28 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
29 upd.Bind(3,"The maximum logging level that will be written to file. Higher levels will include all messages from the previous levels.");
\r
30 upd.Bind(4,"LogLevel");
\r
34 st.Bind(0,"VacuumOnStartup");
\r
38 upd.Bind(0,"Program");
\r
39 upd.Bind(1,order++);
\r
40 upd.Bind(2,"true|true|false|false");
\r
41 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
42 upd.Bind(4,"VacuumOnStartup");
\r
46 st.Bind(0,"MessageBase");
\r
50 upd.Bind(0,"Program");
\r
51 upd.Bind(1,order++);
\r
53 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
54 upd.Bind(4,"MessageBase");
\r
59 st.Bind(0,"StartNNTP");
\r
63 upd.Bind(0,"NNTP Server");
\r
64 upd.Bind(1,order++);
\r
65 upd.Bind(2,"true|true|false|false");
\r
66 upd.Bind(3,"Start NNTP server.");
\r
67 upd.Bind(4,"StartNNTP");
\r
72 st.Bind(0,"NNTPListenPort");
\r
76 upd.Bind(0,"NNTP Server");
\r
77 upd.Bind(1,order++);
\r
79 upd.Bind(3,"The port that the NNTP service will listen for incoming connections.");
\r
80 upd.Bind(4,"NNTPListenPort");
\r
84 // NNTPBindAddresses
\r
85 st.Bind(0,"NNTPBindAddresses");
\r
86 st.Bind(1,"localhost");
\r
89 upd.Bind(0,"NNTP Server");
\r
90 upd.Bind(1,order++);
\r
92 upd.Bind(3,"A comma separated list of valid IPv4 or IPv6 addresses/hostnames that the NNTP service will try to bind to.");
\r
93 upd.Bind(4,"NNTPBindAddresses");
\r
97 st.Bind(0,"NNTPAllowPost");
\r
101 upd.Bind(0,"NNTP Server");
\r
102 upd.Bind(1,order++);
\r
103 upd.Bind(2,"true|true|false|false");
\r
104 upd.Bind(3,"Allow posting messages from NNTP. Setting to false will make the newsgroups read only.");
\r
105 upd.Bind(4,"NNTPAllowPost");
\r
109 st.Bind(0,"StartHTTP");
\r
113 upd.Bind(0,"HTTP Server");
\r
114 upd.Bind(1,order++);
\r
115 upd.Bind(2,"true|true|false|false");
\r
116 upd.Bind(3,"Start HTTP server. WARNING: If you turn this off, you won't be able to access the administration pages.");
\r
117 upd.Bind(4,"StartHTTP");
\r
121 st.Bind(0,"HTTPListenPort");
\r
125 upd.Bind(0,"HTTP Server");
\r
126 upd.Bind(1,order++);
\r
128 upd.Bind(3,"Port HTTP server will listen on.");
\r
129 upd.Bind(4,"HTTPListenPort");
\r
133 st.Bind(0,"HTTPAccessControl");
\r
134 st.Bind(1,"-0.0.0.0/0,+127.0.0.1");
\r
137 upd.Bind(0,"HTTP Server");
\r
138 upd.Bind(1,order++);
\r
140 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
141 upd.Bind(4,"HTTPAccessControl");
\r
145 // StartFreenetUpdater
\r
146 st.Bind(0,"StartFreenetUpdater");
\r
150 upd.Bind(0,"Freenet Connection");
\r
151 upd.Bind(1,order++);
\r
152 upd.Bind(2,"true|true|false|false");
\r
153 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
154 upd.Bind(4,"StartFreenetUpdater");
\r
159 st.Bind(0,"FCPHost");
\r
160 st.Bind(1,"127.0.0.1");
\r
163 upd.Bind(0,"Freenet Connection");
\r
164 upd.Bind(1,order++);
\r
166 upd.Bind(3,"Host name or address of Freenet node.");
\r
167 upd.Bind(4,"FCPHost");
\r
172 st.Bind(0,"FCPPort");
\r
176 upd.Bind(0,"Freenet Connection");
\r
177 upd.Bind(1,order++);
\r
179 upd.Bind(3,"The port that Freenet is listening for FCP connections on.");
\r
180 upd.Bind(4,"FCPPort");
\r
184 st.Bind(0,"FProxyPort");
\r
188 upd.Bind(0,"Freenet Connection");
\r
189 upd.Bind(1,order++);
\r
191 upd.Bind(3,"The port that Freenet is listening for http connections on.");
\r
192 upd.Bind(4,"FProxyPort");
\r
196 st.Bind(0,"MaxIdentityRequests");
\r
200 upd.Bind(0,"Requests");
\r
201 upd.Bind(1,order++);
\r
203 upd.Bind(3,"Maximum number of concurrent requests for new Identity xml files");
\r
204 upd.Bind(4,"MaxIdentityRequests");
\r
208 st.Bind(0,"MaxIdentityIntroductionRequests");
\r
212 upd.Bind(0,"Requests");
\r
213 upd.Bind(1,order++);
\r
215 upd.Bind(3,"Maximum number of concurrent identities requesting IdentityIntroduction xml files. Each identity may have multiple requests pending.");
\r
216 upd.Bind(4,"MaxIdentityIntroductionRequests");
\r
220 st.Bind(0,"MaxIntroductionPuzzleRequests");
\r
224 upd.Bind(0,"Requests");
\r
225 upd.Bind(1,order++);
\r
227 upd.Bind(3,"Maximum number of concurrent requests for new IntroductionPuzzle xml files");
\r
228 upd.Bind(4,"MaxIntroductionPuzzleRequests");
\r
232 st.Bind(0,"MaxTrustListRequests");
\r
236 upd.Bind(0,"Requests");
\r
237 upd.Bind(1,order++);
\r
239 upd.Bind(3,"Maximum number of concurrent requests for new Trust Lists");
\r
240 upd.Bind(4,"MaxTrustListRequests");
\r
244 st.Bind(0,"MaxMessageListRequests");
\r
248 upd.Bind(0,"Requests");
\r
249 upd.Bind(1,order++);
\r
251 upd.Bind(3,"Maximum number of concurrent requests for new Message Lists");
\r
252 upd.Bind(4,"MaxMessageListRequests");
\r
256 st.Bind(0,"MaxMessageRequests");
\r
260 upd.Bind(0,"Requests");
\r
261 upd.Bind(1,order++);
\r
263 upd.Bind(3,"Maximum number of concurrent requests for new Messages");
\r
264 upd.Bind(4,"MaxMessageRequests");
\r
268 st.Bind(0,"MaxBoardListRequests");
\r
272 upd.Bind(0,"Requests");
\r
273 upd.Bind(1,order++);
\r
275 upd.Bind(3,"The maximum number of concurrent requests for new Board Lists. Set to 0 to disable.");
\r
276 upd.Bind(4,"MaxBoardListRequests");
\r
280 st.Bind(0,"MinLocalMessageTrust");
\r
284 upd.Bind(0,"Trust");
\r
285 upd.Bind(1,order++);
\r
287 upd.Bind(3,"Specifies a local message trust level that a peer must have before its messages will be downloaded.");
\r
288 upd.Bind(4,"MinLocalMessageTrust");
\r
292 st.Bind(0,"MinPeerMessageTrust");
\r
296 upd.Bind(0,"Trust");
\r
297 upd.Bind(1,order++);
\r
299 upd.Bind(3,"Specifies a peer message trust level that a peer must have before its messages will be downloaded.");
\r
300 upd.Bind(4,"MinPeerMessageTrust");
\r
304 st.Bind(0,"MinLocalTrustListTrust");
\r
308 upd.Bind(0,"Trust");
\r
309 upd.Bind(1,order++);
\r
311 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
312 upd.Bind(4,"MinLocalTrustListTrust");
\r
316 st.Bind(0,"MinPeerTrustListTrust");
\r
320 upd.Bind(0,"Trust");
\r
321 upd.Bind(1,order++);
\r
323 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
324 upd.Bind(4,"MinPeerTrustListTrust");
\r
328 st.Bind(0,"LocalTrustOverridesPeerTrust");
\r
329 st.Bind(1,"false");
\r
332 upd.Bind(0,"Trust");
\r
333 upd.Bind(1,order++);
\r
334 upd.Bind(2,"true|true|false|false");
\r
335 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
336 upd.Bind(4,"LocalTrustOverridesPeerTrust");
\r
340 st.Bind(0,"MessageDownloadMaxDaysBackward");
\r
344 upd.Bind(0,"Messages");
\r
345 upd.Bind(1,order++);
\r
347 upd.Bind(3,"The maximum number of days backward that messages will be downloaded from each identity");
\r
348 upd.Bind(4,"MessageDownloadMaxDaysBackward");
\r
352 st.Bind(0,"MessageListDaysBackward");
\r
356 upd.Bind(0,"Messages");
\r
357 upd.Bind(1,order++);
\r
359 upd.Bind(3,"The number of days backward that messages you have inserted will appear in your MessageLists");
\r
360 upd.Bind(4,"MessageListDaysBackward");
\r
364 st.Bind(0,"MaxPeerMessagesPerDay");
\r
368 upd.Bind(0,"Messages");
\r
369 upd.Bind(1,order++);
\r
371 upd.Bind(3,"The maximum number of messages you will download from each peer on a given day.");
\r
372 upd.Bind(4,"MaxPeerMessagesPerDay");
\r
376 st.Bind(0,"MaxBoardsPerMessage");
\r
380 upd.Bind(0,"Messages");
\r
381 upd.Bind(1,order++);
\r
383 upd.Bind(3,"The maximum number of boards a received message may be sent to. Boards over this limit will be ignored.");
\r
384 upd.Bind(4,"MaxBoardsPerMessage");
\r
388 st.Bind(0,"SaveMessagesFromNewBoards");
\r
392 upd.Bind(0,"Messages");
\r
393 upd.Bind(1,order++);
\r
394 upd.Bind(2,"true|true|false|false");
\r
395 upd.Bind(3,"Set to true to automatically save messages posted to new boards. Set to false to ignore messages to new boards.");
\r
396 upd.Bind(4,"SaveMessagesFromNewBoards");
\r
400 st.Bind(0,"ChangeMessageTrustOnReply");
\r
404 upd.Bind(0,"Messages");
\r
405 upd.Bind(1,order++);
\r
407 upd.Bind(3,"How much the local message trust level of an identity should change when you reply to one of their messages.");
\r
408 upd.Bind(4,"ChangeMessageTrustOnReply");
\r
412 st.Bind(0,"AddNewPostFromIdentities");
\r
413 st.Bind(1,"false");
\r
416 upd.Bind(0,"Messages");
\r
417 upd.Bind(1,order++);
\r
418 upd.Bind(2,"true|true|false|false");
\r
419 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
420 upd.Bind(4,"AddNewPostFromIdentities");
\r
424 st.Bind(0,"DeleteMessagesOlderThan");
\r
428 upd.Bind(0,"Messages");
\r
429 upd.Bind(1,order++);
\r
431 upd.Bind(3,"Automatically delete messages older than this many days.");
\r
432 upd.Bind(4,"DeleteMessagesOlderThan");
\r