/
General.pm
775 lines (619 loc) · 32.1 KB
/
General.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
# This code was forked from the LiveJournal project owned and operated
# by Live Journal, Inc. The code has been modified and expanded by
# Dreamwidth Studios, LLC. These files were originally licensed under
# the terms of the license supplied by Live Journal, Inc, which can
# currently be found at:
#
# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
#
# In accordance with the original license, this code and all its
# modifications are provided under the GNU General Public License.
# A copy of that license can be found in the LICENSE file included as
# part of this distribution.
#
# These are descriptions of various configuration options for the site.
# See also etc/config.pl.
#
package LJ::ConfCheck;
use strict;
use LJ::ConfCheck;
add_singletons(qw(
@USER_TABLES $PROTOCOL_VER $MAX_DVERSION
$CLEAR_CACHES $BIN $HTDOCS
$IMGPREFIX_BAK $IS_SSL
$STATPREFIX_BAK
%LIB_MOD_TIME %MEMCACHE_ARRAYFMT
@MEMCACHE_SERVERS %MEMCACHE_PREF_IP
%DEBUG %COMMON_CODE %CLUSTER_PAIR_ACTIVE
%MOGILEFS_PREF_IP
));
add_conf('$ADMIN_EMAIL',
required => 1,
des => "Email address of the installation's webmaster.",
type => "email",
);
add_conf('$BLOCKED_BOT_SUBJECT',
required => 0,
des => "Subject/title shown to people suspected to be bots.",
type => "text",
);
add_conf('$BLOCKED_BOT_URI',
required => 0,
des => "Path (e.g. /bots) at which a informational page about your acceptable bot policies are documented. This URI is excluded from anti-bot measures, so make sure it's as permissive as possible to allow humans in who may be lazy in their typing. For example, leave off the trailing slash (/bots instead of /bots/) if your URI is a directory.",
type => "uri",
);
add_conf('$BLOCKED_BOT_MESSAGE',
required => 0,
des => "Message shown to people suspected to be bots, informing them they've been banned, and where/what the rules are.",
type => "html",
);
add_conf('$BML_DENY_CONFIG',
required => 0,
des => "Comma-separated list of directories under htdocs which should be served without parsing their _config.bml files. For example, directories that might be under a lesser-trusted person's control.",
validate => qr/^\w+(\s*,\s*\w+)*$/,
);
add_conf('$BOGUS_EMAIL',
required => 1,
des => "Email address which comments and other notifications come from, but which cannot accept incoming email itself.",
type => "email",
);
add_conf('$COMMUNITY_EMAIL',
required => 0,
des => "Email address which comments and other notifications regarding communities come from. If unspecified, defaults to \$ADMIN_EMAIL .",
type => "email",
);
add_conf('$COMPRESS_TEXT',
required => 0,
type => "bool",
des => "If set, text is gzip-compressed when put in the database. When reading from the database, this configuration means nothing, as the code automatically determines to uncompress or not.",
);
add_conf('$COOKIE_DOMAIN',
required => 1,
des => "The 'domain' value set on cookies sent to users. By default, value is \".\$DOMAIN\". Note the leading period, which is a wildcard for everything at or under \$DOMAIN.",
);
add_conf('$DB_TIMEOUT',
required => 0,
type => "int",
des => "Integer number of seconds to wait for database handles before timing out. By default, zero, which means no timeout.",
);
add_conf('$DEFAULT_CLUSTER',
required => 0,
des => "Integer of a user cluster number or arrayref of cluster numbers, for where new users are assigned after account creation. In the case of an arrayref, you can weight one particular cluster over another by place it in the arrayref more often. For instance, [1, 2, 2, 2] would make users go onto cluster #2 75% of the time, and cluster #1 25% of the time.",
);
add_conf('$DEFAULT_EDITOR',
des => "Editor for new entries if the user hasn\'t overridden it. Should be \'rich\' or \'plain\'.",
);
add_conf('$DEFAULT_LANG',
required => 0,
des => "Default language (code) to show site in, for users that haven't set their langauge. Defaults to the first item in \@LANGS, which is usually \"en\", for English.",
);
add_conf('@LANGS',
des => "Array of language codes to make available for users to select between. Also, if they haven't selected a language, it's auto-detected from their browser.");
add_conf('@LANGS_IN_PROGRESS',
des => "Array of additional language codes to allow users to select, if they know about them. These ones are actively being translated, but aren't yet ready to be publicly available.");
add_conf('@CLUSTERS',
des => "Array of cluster numbers in operation.");
add_conf('$DEFAULT_STYLE',
required => 0,
des => "Hashref describing default S2 style. Keys are layer types, values being the S2 redist_uniqs.",
type => "hashref",
allowed_keys => qw(core layout theme i18n i81nc),
);
add_conf('$DISABLE_MASTER',
type => 'bool',
des => "If set to true, access to the 'master' DB role is prevented, by breaking the get_dbh function. Useful during master database migrations.",
);
add_conf('$DISABLE_MEDIA_UPLOADS',
type => 'bool',
des => "If set to true, all media uploads that would go to MogileFS are disabled.",
);
add_conf('$DISCONNECT_DBS',
type => 'bool',
des => "If set to true, all database connections (except those for logging) are disconnected at the end of each request. Recommended for high-performance sites with lots of database clusters. See also: \$DISCONNECT_DB_LOG",
);
add_conf('$DISCONNECT_MEMCACHE',
type => 'bool',
des => "If set to true, memcached connections are disconnected at the end of each request. Not recommended if your memcached instances are Linux 2.6.",
);
add_conf('$DOMAIN',
required => 1,
des => "The base domain name for your installation. This value is used to auto-set a bunch of other configuration values.",
type => 'hostname,'
);
add_conf('$DOMAIN_WEB',
required => 0,
des => "The preferred domain name for your installation's web root. For instance, if your \$DOMAIN is 'foo.com', your \$DOMAIN_WEB might be 'www.foo.com', so any user who goes to foo.com will be redirected to www.foo.com.",
type => 'hostname,'
);
add_conf('$EMAIL_POST_DOMAIN',
type => 'hostname',
des => "Domain name for incoming emails. For instance, user 'bob' might post by sending email to 'bob\@post.service.com', where 'post.service.com' is the value of \$EMAIL_POST_DOMAIN",
);
add_conf('$EXAMPLE_USER_ACCOUNT',
required => 0,
type => "string",
des => "The username of the example user account, for use in Support and documentation. Must be an actual account on the site.",
);
add_conf('$HOME',
type => 'directory',
no_trailing_slash => 1,
des => "The root of your LJ installation. This directory should contain, for example, 'htdocs' and 'cgi-bin', etc.",
);
add_conf('$IMGPREFIX',
type => 'url',
no_trailing_slash => 1,
des => "Prefix on (static) image URLs. By default, it's '\$SITEROOT/img', but your load balancing may dictate another hostname or port for efficiency. See also: \$IMGPREFIX",
);
add_conf('$JSPREFIX',
type => 'url',
no_trailing_slash => 1,
des => "Prefix on (static) javascript URLs. By default, it's '\$SITEROOT/js', but your load balancing may dictate another hostname or port for efficiency. See also: \$IMGPREFIX",
);
add_conf('$PALIMGROOT',
type => 'url',
no_trailing_slash => 1,
des => "Prefix on GIF/PNGs with dynamically generated palettes. By default, it's '\$SITEROOT/palimg\', and there's little reason to change it. Somewhat related: note that Perlbal has a plugin to handle these before it gets to mod_perl, if you'd like to relieve some load on your backend mod_perls. But you don't necessarily need this option for using Perlbal to do it. Depends on your config.",
);
add_conf('$MAILLOCK',
type => ["hostname", "none", "ddlockd"],
des => "Locking method that mailgated.pl should use when processing incoming emails from the Maildir. You can safely use 'none' if you have a single host processing mail, otherwise 'ddlockd' or 'hostname' is recommended, though 'hostname' means mail that arrived on a host that then crashes won't be processed until it comes back up. ddlockd is recommended, if you're using multiple mailgated processes.",
);
add_conf('$MAX_ATOM_UPLOAD',
type => 'int',
des => "Max number of bytes that users are allowed to upload via Atom. Note that this upload path isn't ideal, so the entire upload must fit in memory. Default is 25MB until path is optimized.",
);
add_conf('$MAX_FOAF_FRIENDS',
type => 'int',
des => "The maximum number of friends that users' FOAF files will show. Defaults to 1000. If they have more than the configured amount, some friends will be omitted.",
);
add_conf('$MAX_FRIENDOF_LOAD',
type => 'int',
des => "The maximum number of friend-ofs ('fans'/'followers') to load for a given user. Defaults to 5000. Beyond that, a user is just too popular and saying 5,000 is usually sufficient because people aren't actually reading the list.",
);
add_conf('$MAX_WT_EDGES_LOAD',
type => 'int',
des => "The maximum number of users to load for watch/trust edges when we can afford to be sloppy about the results returned. It is possible to override this limit to get the full list, but most of the time, you won't need to. Defaults to 50,000.",
);
add_conf('$MAX_SCROLLBACK_LASTN',
type => 'int',
des => "The recent items (lastn view)'s max scrollback depth. That is, how far you can skip back with the ?skip= URL argument. Defaults to 100. After that, the 'previous' links go to day views, which are stable URLs. ?skip= URLs aren't stable, and there are inefficiencies making this value too large, so you're advised to not go too far above the default of 100.",
);
add_conf('$MAX_SCROLLBACK_FRIENDS',
type => 'int',
des => "The friends page' max scrollback depth. That is, how far you can skip back with the ?skip= URL argument. Defaults to 1000.",
);
add_conf('$MAX_REPL_LAG',
type => 'int',
des => "The max number of bytes that a MySQL database slave can be behind in replication and still be considered usable. Note that slave databases are never used for any 'important' read operations (and especially never writes, because writes only go to the master), so in general MySQL's async replication won't bite you. This mostly controls how fresh of data a visitor would see, not a content owner. But in reality, the default of 100k is pretty much real-time, so you can safely ignore this setting.",
);
add_conf('$MAX_S2COMPILED_CACHE_SIZE',
type => 'int',
des => "Threshold (in bytes) under which compiled S2 layers are cached in memcached. Default is 7500 bytes. If you have a lot of free memcached memory and a loaded database server with lots of queries to the s2compiled table, turn this up.",
);
add_conf('$MAX_USERPIC_KEYWORDS',
type => 'int',
des => "Max number of keywords allowed per userpic. Default is 10.",
);
add_conf('$MINIMAL_BML_SCHEME',
type => "string",
des => "The name of the BML scheme that implements the site's 'lite' interface for minimally capable devices such as cellphones/etc. See also %MINIMAL_USERAGENT.");
add_conf('%MINIMAL_USERAGENT',
des => "Set of user-agent prefixes (the part before the slash) that should be considered 'lite' devices and thus be given the site's minimal interface. Keys are prefixes, value is a boolean. See also \$MINIMAL_BML_SCHEME.",
);
add_conf('$MSG_DB_UNAVAILABLE',
type => "html",
des => "Message to show users on a database unavailable error.",
);
add_conf('$MSG_NO_COMMENT',
type => "html",
des => "Message to show users when they're not allowed to comment due to either their 'get_comments' or 'leave_comments' capability being disabled, probably by the admin to lower activity after a hardware rotation.",
);
add_conf('$MSG_NO_POST',
type => "html",
des => "Message to show users when they're not allowed to post due to their 'can_post' capability being disabled, probably by the admin to lower activity after a hardware rotation.",
);
add_conf('$MSG_READONLY_USER',
type => "string",
des => "Message to show users when their journal (or a journal they're visting) is in read-only mode due to maintenance.",
);
add_conf('$NEWUSER_CAPS',
type => 'int',
des => "Bitmask of capability classes that new users begin their accounts with. By default users aren't in any capability classes and get only the default site-wide capabilities. See also \%CAP.",
);
add_conf('$RATE_COMMENT_AUTH',
des => "Arrayref of rate rules to apply incoming comments from authenticated users . Each rate rule is an arrayref of two items: number of comments, and period of time. If user makes more comments in period of time, comment is denied, at least without a captcha.",
);
add_conf('$RATE_COMMENT_ANON',
des => "Arrayref of rate rules to apply incoming comments from anonymous users . Each rate rule is an arrayref of two items: number of comments, and period of time. If user makes more comments in period of time, comment is denied, at least without a captcha.",
);
add_conf('$SENDMAIL',
type => 'program+args',
des => "System path to sendmail, with arguments. Default is: '/usr/sbin/sendmail -t -oi'. This option is ignored if you've defined the higher-precedence option: \@MAIL_TRANSPORTS.",
);
add_conf('$SMTP_SERVER',
type => "hostip",
des => "Host/IP to outgoing SMTP server. Takes precedence over \$SENDMAIL.",
);
add_conf('$DMTP_SERVER',
type => "hostip:port",
des => "Host/IP with port number to outgoing DMTP server. Takes precedence over \$SMTP_SERVER. Note: the DMTP protocol and server is a dumb hack. If you have a good outgoing SMTP server, use that instead.",
);
add_conf('$SERVER_DOWN_SUBJECT',
type => "text",
des => "The error message subject/title to show when \$SERVER_DOWN is set.",
);
add_conf('$SERVER_DOWN_MESSAGE',
type => "html",
des => "The error message to show when \$SERVER_DOWN is set.",
);
add_conf('$SERVER_NAME',
des => "System's hostname. In a massive LJ webfarm, each node has its own value of this. The default is to query the local machine's hostname at runtime, so you don't need to set this. It's not used for anything too important anyway.");
add_conf('$SITENAME',
required => 1,
des => "Full name of your site. For instance, 'LiveJournal.com'. See also \$SITENAMESHORT and \$SITENAMEABBREV.");
add_conf('$SITENAMESHORT',
des => "Medium-length name of your site. For instance, 'LiveJournal'. See also \$SITENAME and \$SITENAMEABBREV. Defaults to \$SITENAME without any '.*' suffix");
add_conf('$SITENAMEABBREV',
required => 1,
des => "Shorted possible slang name of your site. For instance, 'LJ'.");
add_conf('$SITEROOT',
required => 1,
type => 'url',
no_trailing_slash => 1,
des => "URL prefix for the base of the site, including 'http://'. This can't be auto-detected because of reverse-proxies, etc. See also \$SSLROOT.");
add_conf('$SSLROOT',
required => 0,
type => 'url',
no_trailing_slash => 1,
des => "URL prefix for the base of the SSL-portion of the site, including 'https://'. This can't be auto-detected because of reverse-proxies, etc. See also \$SITEROOT.");
add_conf('$STATPREFIX',
required => 0,
type => 'url',
no_trailing_slash => 1,
des => "URL prefix for the static files. Defaults to \$SITEROOT/stc.",
);
add_conf('$WSTATPREFIX',
required => 0,
type => 'url',
no_trailing_slash => 1,
des => "URL prefix for the static files. Must be located on the same domain as \$DOMAIN_WEB.",
);
add_conf('$SPELLER',
type => 'program+args',
des => "If set, spell checking is enabled. Value is the full path plus arguments to an ispell-compatible spell checker. aspell is recommended, using: '/usr/bin/aspell pipe --sug-mode=fast --ignore-case'."
);
add_conf('$STATS_BLOCK_SIZE',
des => "Used in LJ/Stats.pm for scaling stat totals."
);
add_conf('$SUICIDE_UNDER',
des => "used in Apache/DebateSuicide.pm.")
;
add_conf('%SUICIDE_UNDER',
des => "used in Apache/DebateSuicide.pm."
);
add_conf('$SYNSUCK_MAX_THREADS',
des => "Limit number of threads available to synsuck worker."
);
add_conf('$SYND_CLUSTER',
type => 'integer',
des => "If defined, all syndication (RSS/Atom) 'users' are put on this cluster number. If undefined, syndication users are assigned to user clusters (partitions) in the normal way."
);
add_conf('$SUPPORT_EMAIL',
type => 'email',
des => "The customer support email address."
);
add_conf('@SUPPORT_SLOW_ROLES',
type => 'array',
des => "Array of database roles to be used for slow support queries, in order of precedence."
);
add_conf('$TALK_ABORT_REGEXP',
type => 'regexp',
des => "Regular expression which, when matched on incoming comment bodies, kills the comment."
);
add_conf('$TOOLS_RECENT_COMMENTS_MAX',
type => 'int',
des => "Number of recent comments to show on /tools/recent_comments.bml"
);
add_conf('$USERPIC_ROOT',
type => 'url',
no_trailing_slash => 1,
des => "URL prefix for userpics. Defaults to \$SITEROOT/userpic. See \%SUBDOMAIN_FUNCTION to use something else."
);
add_conf('$USER_DOMAIN',
type => 'domain',
des => "Domain for user email aliases and user virtual host domains. See \$USER_EMAIL and \$USER_VHOSTS.\n"
);
add_conf('%ALIAS_TO_SUPPORTCAT',
des => "This provides a way to declare more than one email address which is routed to a support category. The primary incoming email address for a support category is in the 'supportcat' table. If you need more than one, this hash maps from the email address you want to accept mail, to the primary email address of that support category. For instance: %ALIAS_TO_SUPPORTCAT = ('dmca\@example.com' => 'webmaster\@example.com') would mean that dmca\@ would go to the same support category that webmaster\@ would otherwise go to."
);
add_conf('@SCHEMES',
des => "An array of hashrefs describing the available site BML schemes (skins). Each hashref must contain the keys 'scheme' (the BML scheme to use), 'title', and optionally 'thumb', which should be an arrayref of [ partial URL, width, height ]. where partial URL is relative to \$IMGPREFIX."
);
add_conf('$LOCKDIR',
type => "directory",
des => "A directory to use for lock files if you're not using ddlockd for locking."
);
add_conf('$MAX_BANS',
type => "int",
des => "Maximum number of people that users are allowed to ban. Defaults to 5000."
);
add_conf('$AUTOSAVE_DRAFT_INTERVAL',
type => 'int',
default => 10,
des => "Number of seconds to use as interval to saving drafts back to the server. Defaults to 10."
);
add_conf('$MEMCACHE_CB_CONNECT_FAIL',
type => "subref",
des => "Callback when a connection to a memcached instance fails. Subref gets the IP address that was being connected to, but without the port number."
);
add_conf('$SQUAT_URL',
des => "For anti-squatter checking in Apache/LiveJournal.pm."
);
add_conf('$FRONTPAGE_JOURNAL',
des => "Username of journal to show on the front page (usually news)."
);
add_conf('$FREECHILDREN_BCAST',
des => "See Apache/SendStats.pm."
);
add_conf('$SENDSTATS_BCAST',
des => "See Apache/SendStats.pm."
);
add_conf('$MAX_FRIENDS_VIEW_AGE',
type => "int",
des => "Time range for reading page in seconds (default two weeks)."
);
add_conf('%FORCE_EMPTY_SUBSCRIPTIONS',
des => "Userids for which we don't show subscriptions on profile."
);
add_conf('@CLEANUP_HANDLERS',
des => "List of subroutines to be run by Apache's cleanup handler."
);
add_conf('%EXTERNAL_NAMESPACE',
des => "Used by extuser methods in LJ::User."
);
add_conf('$MEMCACHE_COMPRESS_THRESHOLD',
type => 'int',
des => "Number of bytes beyond which we compress data in memcache."
);
add_conf('$MEMCACHE_CONNECT_TIMEOUT',
type => 'int',
des => "Timeout threshold in seconds."
);
add_conf('%READONLY_CLUSTER',
des => "Hash of database clusters that should be read-only."
);
add_conf('%READONLY_CLUSTER_ADVISORY',
des => "Hash of information about which clusters can be read-only."
);
add_conf('%LOCKY_CACHE',
des => "Used by LJ::get_cap."
);
add_conf('$WHEN_NEEDED_THRES',
des => "Used by LJ::get_cap."
);
add_conf('%DEF_READER_ACTUALLY_SLAVE',
des => "Used by LJ::get_cluster_def_reader."
);
add_conf('%LOCK_OUT',
des => "Tracks locking of database tables."
);
add_conf('%DISABLE_PROTOCOL',
des => "Hash of protocol requests to temporarily disable."
);
add_conf('@TESTACCTS',
type => 'array',
des => "Array of usernames that are test accounts."
);
add_conf('$ALLOW_PICS_OVER_QUOTA',
des => "See LJ::User->activate_userpics."
);
add_conf('$SYSBAN_IP_REFRESH',
des => "How long we memcache IP bans, if they expire."
);
add_conf('%IP_BANNED',
des => "Hash in memory for caching banned IPs."
);
add_conf('%UNIQ_BANNED',
des => "Hash in memory for caching banned uniqs."
);
add_conf('IP_BANNED_LOADED',
type => 'int',
des => "Time the IP bans were last loaded."
);
add_conf('UNIQ_BANNED_LOADED',
type => 'int',
des => "Time the uniq bans were last loaded."
);
add_conf('%NEEDED_RES',
des => "Hash map for needed page resources such as css or js."
);
add_conf('$TALK_PAGE_SIZE',
type => 'int',
des => "See LJ::Talk::load_comments."
);
add_conf('$TALK_MAX_SUBJECTS',
type => 'int',
des => "See LJ::Talk::load_comments."
);
add_conf('$TALK_THREAD_POINT',
type => 'int',
des => "See LJ::Talk::load_comments."
);
add_conf('$ANTI_TALKSPAM',
type => 'bool',
des => "See LJ::Talk::check_rate."
);
add_conf('%FORM_DOMAIN_BANNED',
des => "Domains blocked by HTML cleaner."
);
add_conf('$LOCKER_OBJ',
des => "Used by LJ::locker."
);
add_conf('@LOCK_SERVERS',
des => "Used by LJ::locker."
);
add_conf('$SLOPPY_FRIENDS_THRESHOLD',
type => 'int',
des => "Number of watched users for memcache-only reading page."
);
add_conf('$WORK_REPORT_HOST',
des => "Used by LJ::work_report."
);
add_conf('$FILEEDIT_VIA_DB',
type => 'bool',
des => "Allow all htdocs/inc files to be edited via database."
);
add_conf('%FILEEDIT_VIA_DB',
des => "Hash of htdocs/inc files to allow for database edits."
);
add_conf('$BML_INC_DIR_ADMIN',
type => 'directory',
no_trailing_slash => 1,
des => "Used by htdocs/admin/fileedit."
);
add_conf('$BML_INC_DIR',
type => 'directory',
no_trailing_slash => 1,
des => "Used by htdocs/admin/fileedit."
);
add_conf('%USERPROP_INIT',
des => "Initial userprop settings for new users."
);
add_conf('$SYND_CAPS',
type => 'int',
des => "Bitmask of capability classes for syndicated users. If not set, use \$NEWUSER_CAPS."
);
add_conf('%CLUSTER_DOWN',
des => "Has of database clusters that are currently unavailable."
);
add_conf('@TALKSPAM',
type => 'array',
des => "Array of regular expressions to use for detecting comment spam."
);
add_conf('@INITIAL_SUBSCRIPTIONS',
type => 'array',
des => "Array of users for all new users to watch (e.g. news)."
);
add_conf('$LJMAINT_VERBOSE',
type => 'int',
des => "Indicate whether maintenance scripts should run in verbose mode."
);
add_conf('$MAILSPOOL',
type => 'directory',
no_trailing_slash => 1,
des => "Directory for server incoming mail spool."
);
add_conf('$DENY_REQUEST_FROM_EMAIL',
des => "Used by bin/worker/incoming-email to determine whether to bounce a support-related email."
);
add_conf('%DENY_REQUEST_FROM_EMAIL',
des => "Specify bounce messages for each email address."
);
add_conf('@PRIVATE_STATS',
des => "Used by bin/maint/stats.pl."
);
add_conf('%SUPPORT_DIAGNOSTICS',
des => "Diagnostics to turn on. Only supported key is 'track_useragent'."
);
add_conf('%CAP',
des => "Capability class limits as specified in etc/config.pl."
);
add_conf('@MAIL_TRANSPORTS',
type => 'array',
des => "Define available MTAs such as sendmail."
);
add_conf('%MOGILEFS_CONFIG',
des => "Configuration data for MogileFS::Admin."
);
add_conf('%SUPPORT_ABSTRACTS',
des => "See htdocs/support/help.bml."
);
add_conf('%MINIMAL_STYLE',
des => "Layers to use when viewing content on mobile devices."
);
add_conf('%USERPROP_DEF',
des => "Hash of userprop defaults. See also %USERPROP_INIT."
);
add_conf('@INITIAL_OPTOUT_SUBSCRIPTIONS',
des => "Array of users checked by default on create.bml."
);
add_conf('%CAP_DEF',
des => "Default limits for caps not specified in %CAP."
);
add_conf('%DISABLED',
des => "Selectively enable or disable site features."
);
add_conf('%HELPURL',
des => "Help topic -> url mapping."
);
add_conf('@INITIAL_OPTIONAL_SUBSCRIPTIONS',
des => "Array of users presented but not checked on create.bml."
);
add_conf('%SETTER',
des => "Used by 'set' console command."
);
add_conf('%SUBDOMAIN_FUNCTION',
des => "Map for determining subdomains."
);
add_conf('%REDIRECT_ALLOWED',
des => "IPs that are allowed to do site redirects."
);
add_conf('%HOOKS',
des => "Used by LJ/Hooks.pm."
);
add_conf('%GZIP_OKAY',
des => "The list of content types that can use gzip compression."
);
add_conf('%CAPTCHA_FOR',
type => 'hash',
des => '$captcha_type => 1 if we should display a captcha on this page; $captcha_type => 0, or leave out of the hash, if we shouldn\'t display a captcha on this page.'
);
add_conf('%DBINFO',
des => "Database connection information, including passwords."
);
add_conf('$CSSPROXY',
type => 'url',
des => "If set, external CSS should be proxied through this URL (URL is given a ?u= argument with the escaped URL of CSS to clean. If unset, remote CSS is blocked.",
);
add_conf('$PROFILE_BML_FILE',
type => 'file',
des => "The file (relative to htdocs) to use for the profile URL. Defaults to profile.bml",
);
my %bools = (
'USE_ACCT_CODES' => "Make joining the site require an 'invite code'. Note that this code might've bitrotted, so perhaps it should be kept off.",
'USER_VHOSTS' => "Let (at least some) users get *.\$USER_DOMAIN URLs. They'll also need the 'userdomain' cap.",
'USER_EMAIL' => "Let (at least some) users get email aliases on the site. They'll also need the 'useremail' cap. See also \$USER_DOMAIN",
'TRACK_URL_ACTIVE' => "record in memcached what URL a given host/pid is working on",
'TRUST_X_HEADERS' => "LiveJournal should trust the upstream's X-Forwarded-For and similar headers. Default is off (for direct connection to the net). If behind your own reverse proxies, you should enable this.",
'UNICODE' => "Unicode support is enabled. The default has been 'on' for ages, and turning it off is nowadays not recommended or even known to be working/reliable. Keep it enabled.",
'SUICIDE' => "Large processes should voluntarily kill themselves at the end of requests.",
'STATS_FORCE_SLOW' => "Make all stats hit the 'slow' database role, never using 'slave' or 'master'",
'SERVER_DOWN' => "The site is globally marked as 'down' and users get an error message, as defined by \$SERVER_DOWN_MESSAGE and \$SERVER_DOWN_SUBJECT. It's not clear why this should ever be used instead of \$SERVER_TOTALLY_DOWN",
'SERVER_TOTALLY_DOWN' => "The site is globally marked as 'down' and users get an error message, as defined by \$SERVER_DOWN_MESSAGE and \$SERVER_DOWN_SUBJECT. But compared to \$SERVER_DOWN, this error message is done incredibly early before any dispatch to different modules.",
"REQUIRE_TALKHASH" => "Require submitted comments to include a signed hidden value provided by the server. Slows down comment-spammers, at least, in that they have to fetch pages first, instead of just blasting away POSTs. Defaults to off.",
"REQUIRE_TALKHASH_NOTOLD" => "If \$REQUIRE_TALKHASH is on, also make sure that the talkhash provided was issued in the past two hours. Defaults to off.",
"DONT_LOG_IMAGES" => "Don't log requests for images.",
"DO_GZIP" => "Compress text content sent to browsers. Cuts bandwidth by over 50%.",
"EVERYONE_VALID" => "Users don't need to validate their email addresses.",
"IS_DEV_SERVER" => "This is a development installation only, and not used for production. A lot of debug info and intentional security holes for convenience are introduced when this is enabled.",
"LOG_GTOP" => "Log per-request CPU and memory usage, using gtop libraries.",
"NO_PASSWORD_CHECK" => "Don't do strong password checks. Users can use any old dumb password they'd like.",
"OPENID_CONSUMER" => "Accept OpenID identies for logging in and commenting.",
"OPENID_SERVER" => "Be an OpenID server.",
"USE_SSL" => "Links to SSL portions of the site should be visible.",
"USE_PGP" => "Let users set their PGP/GPG public key, and accept PGP/GPG-signed emails (for authentication)",
"OPENID_COMPAT" => "Support pre-1.0 OpenID specs as well as final spec.",
"OPENID_STATELESS" => "Speak stateless OpenID. Slower, but no local state needs to be kept.",
"ONLY_USER_VHOSTS" => "Don't allow www.* journals at /users/ and /~ and /community/. Only allow them on their own user virtual host domains.",
"USERPIC_MOGILEFS" => "Store userpics on MogileFS.",
"CONCAT_RES" => "Instruct Perlbal to concatenate static files on non-SSL pages",
"CONCAT_RES_SSL" => "Instruct Perlbal to concatenate static files on SSL pages",
);
foreach my $k (keys %bools) {
my $val = $bools{$k};
$val = { des => $val } unless ref $val;
$val->{type} = "bool",
$val->{des} = "If set to true, " . lcfirst($val->{des});
add_conf("\$$k", %$val);
}
1;