4 # Do not edit this file. You should edit ljconfig.pl, which you should have at
5 # cgi-bin/ljconfig.pl. If you don't, copy it from doc/ljconfig.pl.txt to cgi-bin
6 # and edit it there. This file only provides backup default values for upgrading.
13 $LJ::DEFAULT_STYLE
||= {
15 'layout' => 'generator/layout',
16 'i18n' => 'generator/en',
19 $LJ::HOME
= $ENV{'LJHOME'};
20 $LJ::HTDOCS
= "$LJ::HOME/htdocs";
21 $LJ::SSLDOCS
||= "$LJ::HOME/ssldocs";
22 $LJ::BIN
= "$LJ::HOME/bin";
24 $LJ::SERVER_NAME
||= Sys
::Hostname
::hostname
();
26 $LJ::UNICODE
= 1 unless defined $LJ::UNICODE
;
28 @LJ::LANGS
= ("en") unless @LJ::LANGS
;
29 $LJ::DEFAULT_LANG
||= $LJ::LANGS
[0];
31 $LJ::SITENAME
||= "NameNotConfigured.com";
32 unless ($LJ::SITENAMESHORT
) {
33 $LJ::SITENAMESHORT
= $LJ::SITENAME
;
34 $LJ::SITENAMESHORT
=~ s/\..*//; # remove .net/.com/etc
36 $LJ::SITENAMEABBREV
||= "[??]";
38 $LJ::MSG_READONLY_USER
||= "Database temporarily in read-only mode during maintenance.";
40 $LJ::DOMAIN_WEB
||= "www.$LJ::DOMAIN";
41 $LJ::SITEROOT
||= "http://$LJ::DOMAIN_WEB";
42 $LJ::IMGPREFIX
||= "$LJ::SITEROOT/img";
43 $LJ::STATPREFIX
||= "$LJ::SITEROOT/stc";
44 $LJ::WSTATPREFIX
||= "$LJ::SITEROOT/stc";
45 $LJ::JSPREFIX
||= "$LJ::SITEROOT/js";
46 $LJ::USERPIC_ROOT
||= "$LJ::SITEROOT/userpic";
47 $LJ::PALIMGROOT
||= "$LJ::SITEROOT/palimg";
49 # path to sendmail and any necessary options
50 $LJ::SENDMAIL
||= "/usr/sbin/sendmail -t -oi";
52 # protocol, mailserver hostname, and preferential weight.
53 # qmtp, smtp, dmtp, and sendmail are the currently supported protocols.
54 @LJ::MAIL_TRANSPORTS
= ( [ 'sendmail', $LJ::SENDMAIL
, 1 ] ) unless @LJ::MAIL_TRANSPORTS
;
56 # roles that slow support queries should use in order of precedence
57 @LJ::SUPPORT_SLOW_ROLES
= ('slow') unless @LJ::SUPPORT_SLOW_ROLES
;
59 # where we set the cookies (note the period before the domain)
60 $LJ::COOKIE_DOMAIN
||= ".$LJ::DOMAIN";
61 $LJ::COOKIE_PATH
||= "/";
62 @LJ::COOKIE_DOMAIN_RESET
= ("", "$LJ::DOMAIN", ".$LJ::DOMAIN") unless @LJ::COOKIE_DOMAIN_RESET
;
64 $LJ::MAX_SCROLLBACK_LASTN
||= 100;
65 $LJ::MAX_SCROLLBACK_FRIENDS
||= 1000;
66 $LJ::MAX_USERPIC_KEYWORDS
||= 10;
68 $LJ::AUTOSAVE_DRAFT_INTERVAL
||= 3;
70 # this option can be a boolean or a URL, but internally we want a URL
71 # (which can also be a boolean)
72 if ($LJ::OPENID_SERVER
&& $LJ::OPENID_SERVER
eq 1) {
73 $LJ::OPENID_SERVER
= "$LJ::SITEROOT/openid/server.bml";
76 # set default capability limits if the site maintainer hasn't.
80 'checkfriends_interval' => 60,
81 'friendsviewupdate' => 30,
84 'moodthemecreate' => 1,
103 'leave_comments' => 1,
105 'mod_queue_per_poster' => 1,
107 'hide_email_after' => 0,
109 'maxcomments' => 10000,
110 'maxcomments-before-captcha' => 5000,
111 'rateperiod-lostinfo' => 24*60, # 24 hours
112 'rateallowed-lostinfo' => 5,
113 'tools_recent_comments_display' => 50,
114 'rateperiod-invitefriend' => 60, # 1 hour
115 'rateallowed-invitefriend' => 20,
116 'subscriptions' => 25,
117 'usermessage_length' => 5000,
119 foreach my $k (keys %defcap) {
120 next if (defined $LJ::CAP_DEF
{$k});
121 $LJ::CAP_DEF
{$k} = $defcap{$k};
125 # FIXME: should forcibly limit userlinks to 255 (tinyint)
127 # set default userprop limits if site maintainer hasn't
130 's1_lastn_style' => 'lastn/Generator',
131 's1_friends_style' => 'friends/Generator',
132 's1_calendar_style' => 'calendar/Generator',
133 's1_day_style' => 'day/Generator',
135 foreach my $k (keys %defuser) {
136 next if (defined $LJ::USERPROP_DEF
{$k});
137 $LJ::USERPROP_DEF
{$k} = $defuser{$k};
141 # Send community invites from the admin address unless otherwise specified
142 $LJ::COMMUNITY_EMAIL
||= $LJ::ADMIN_EMAIL
;
144 # The list of content types that we consider valid for gzip compression.
146 'text/html' => 1, # regular web pages; XHTML 1.0 "may" be this
147 'text/xml' => 1, # regular XML files
148 'application/xml' => 1, # XHTML 1.1 "may" be this
149 'application/xhtml+xml' => 1, # XHTML 1.1 "should" be this
150 'application/rdf+xml' => 1, # FOAF should be this
151 'application/json' => 1,
152 'application/javascript' => 1,
153 ) unless %LJ::GZIP_OKAY
;
155 # maximum FOAF friends to return (so the server doesn't get overloaded)
156 $LJ::MAX_FOAF_FRIENDS
||= 1000;
158 # maximum number of friendofs to load/memcache (affects userinfo.bml display)
159 $LJ::MAX_FRIENDOF_LOAD
||= 5000;
161 # whether to proactively delete any comments associated with an entry when we assign
162 # a new jitemid (see the big comment above LJ::Protocol::new_entry_cleanup_hack)
163 $LJ::NEW_ENTRY_CLEANUP_HACK
||= 0;
165 # block size is used in stats generation code that gets n rows from the db at a time
166 $LJ::STATS_BLOCK_SIZE
||= 10_000
;
168 # Maximum number of comments to display on Recent Comments page
169 $LJ::TOOLS_RECENT_COMMENTS_MAX
||= 50;
171 # Default to allow all reproxying.
172 %LJ::REPROXY_DISABLE
= () unless %LJ::REPROXY_DISABLE
;
174 # Default error message for age verification needed
175 $LJ::UNDERAGE_ERROR
||= "Sorry, your account needs to be <a href='$LJ::SITEROOT/agecheck/'>age verified</a> before you can leave any comments.";
177 # Terms of Service revision requirements
180 [ title
=> 'Terms of Service agreement required' ],
185 $LJ::REQUIRED_TOS
{$_->[0]} = $_->[1]
186 unless defined $LJ::REQUIRED_TOS
{$_->[0]};
189 # setup default minimal style information
190 $LJ::MINIMAL_USERAGENT
{$_} ||= 1 foreach qw(Links Lynx w BlackBerry WebTV); # w is for w3m
191 $LJ::MINIMAL_BML_SCHEME
||= 'lynx';
192 $LJ::MINIMAL_STYLE
{'core'} ||= 'core1';
194 $LJ::S2COMPILED_MIGRATION_DONE
||= 0; # turn on after s2compiled2 migration
196 # max limit of schools attended
197 $LJ::SCHOOLSMAX
||= {
204 # max content length we should read via ATOM api
206 $LJ::MAX_ATOM_UPLOAD
||= 26214400;
208 $LJ::CAPTCHA_AUDIO_MAKE
||= 100;
209 $LJ::CAPTCHA_AUDIO_PREGEN
||= 100;
210 $LJ::CAPTCHA_IMAGE_PREGEN
||= 500;
211 $LJ::CAPTCHA_IMAGE_RAW
||= "$LJ::HOME/htdocs/img/captcha";
213 $LJ::DEFAULT_EDITOR
||= 'rich';
216 unless(scalar(@LJ::PORTAL_BOXES
)) {
217 @LJ::PORTAL_BOXES
= (
236 unless(scalar(@LJ::PORTAL_BOXES_HIDDEN
)) {
237 @LJ::PORTAL_BOXES_HIDDEN
= (
242 unless (keys %LJ::PORTAL_DEFAULTBOXSTATES
) {
243 %LJ::PORTAL_DEFAULTBOXSTATES
= (
269 'PopWithFriends' => {
273 'RecentComments' => {
305 unless (@LJ::EVENT_TYPES
) {
306 @LJ::EVENT_TYPES
= qw
(
321 foreach my $evt (@LJ::EVENT_TYPES
) {
322 $evt = "LJ::Event::$evt";
326 unless (@LJ::NOTIFY_TYPES
) {
327 @LJ::NOTIFY_TYPES
= (
330 foreach my $evt (@LJ::NOTIFY_TYPES
) {
331 $evt = "LJ::NotificationMethod::$evt";
334 unless (%LJ::BLOBINFO
) {
337 1 => "$LJ::HOME/var/blobs/",
342 unless (scalar @LJ::PROTECTED_USERNAMES
) {
343 @LJ::PROTECTED_USERNAMES
= ("^ex_", "^ext_", "^s_", "^_", '_$', '__');
346 $LJ::USERPROP_DEF
{'blob_clusterid'} ||= 1;
348 # setup default limits for mogilefs classes
349 if (%LJ::MOGILEFS_CONFIG
) {
350 my %classes = (userpics
=> 3,
354 $LJ::MOGILEFS_CONFIG
{classes
} ||= {};
355 foreach my $class (keys %classes) {
356 $LJ::MOGILEFS_CONFIG
{classes
}{$class} ||= $classes{$class};
361 $LJ::SMS_DOMAIN
||= $LJ::DOMAIN
;
362 $LJ::SMS_TITLE
||= "$LJ::SITENAMESHORT SMS";
364 # random user defaults to a week
365 $LJ::RANDOM_USER_PERIOD
= 7;
367 # how far in advance to send out birthday notifications
368 $LJ::BIRTHDAY_NOTIFS_ADVANCE
||= 2*24*60*60;
371 # add default URI handler mappings
373 delcomment
=> "delcomment.bml",
374 talkscreen
=> "talkscreen.bml",
375 spamcomment
=> "spamcomment.bml",
376 talkmulti
=> "talkmulti.bml",
377 controlstrip
=> "tools/endpoints/controlstrip.bml",
378 ctxpopup
=> "tools/endpoints/ctxpopup.bml",
379 changerelation
=> "tools/endpoints/changerelation.bml",
380 userpicselect
=> "tools/endpoints/getuserpics.bml",
381 esn_inbox
=> "tools/endpoints/esn_inbox.bml",
382 esn_subs
=> "tools/endpoints/esn_subs.bml",
383 trans_save
=> "tools/endpoints/trans_save.bml",
384 dirsearch
=> "tools/endpoints/directorysearch.bml",
385 poll
=> "tools/endpoints/poll.bml",
386 jobstatus
=> "tools/endpoints/jobstatus.bml",
387 widget
=> "tools/endpoints/widget.bml",
388 multisearch
=> "tools/endpoints/multisearch.bml",
389 give_tokens
=> "give_tokens.bml",
392 foreach my $src (keys %ajaxmapping) {
393 $LJ::AJAX_URI_MAP
{$src} ||= $ajaxmapping{$src};
395 $LJ::AJAX_URI_MAP
{load_state_codes
} = 'tools/endpoints/load_state_codes.bml';
396 $LJ::AJAX_URI_MAP
{profileexpandcollapse
} = 'tools/endpoints/profileexpandcollapse.bml';
397 $LJ::AJAX_URI_MAP
{dismisspagenotice
} = 'tools/endpoints/dismisspagenotice.bml';
399 # List all countries that have states listed in 'codes' table in DB
400 # These countries will be displayed with drop-down menu on Profile edit page
401 # 'type' is used as 'type' attribute value in 'codes' table
402 # 'save_region_code' specifies what to save in 'state' userprop -
403 # '1' mean save short region code and '0' - save full region name
404 %LJ::COUNTRIES_WITH_REGIONS
= (
405 'US' => { type
=> 'state', save_region_code
=> 1, },
406 'RU' => { type
=> 'stateru', save_region_code
=> 1, },
407 #'AU' => { type => 'stateau', save_region_code => 0, },
408 #'CA' => { type => 'stateca', save_region_code => 0, },
409 #'DE' => { type => 'statede', save_region_code => 0, },
412 %LJ::VALID_PAGE_NOTICES
= (
414 settings_design
=> 1,
417 @LJ::IDENTITY_TYPES
= qw( openid ) unless @LJ::IDENTITY_TYPES
;
419 unless (@LJ::TALK_METHODS_ORDER
) {
420 @LJ::TALK_METHODS_ORDER
= qw(
427 if ($LJ::IS_DEV_SERVER
) {
428 $LJ::CAPTCHA_MOGILEFS
= 1 unless defined $LJ::CAPTCHA_MOGILEFS
;
429 $LJ::USERPIC_MOGILEFS
= 1 unless defined $LJ::USERPIC_MOGILEFS
;
430 $LJ::PHONEPOST_MOGILEFS
= 1 unless defined $LJ::PHONEPOST_MOGILEFS
;
431 $LJ::TRUST_X_HEADERS
= 1 unless defined $LJ::TRUST_X_HEADERS
;
432 $LJ::NO_PASSWORD_CHECK
= 1 unless defined $LJ::NO_PASSWORD_CHECK
;
434 unless (@LJ::CLUSTERS
) {
435 @LJ::CLUSTERS
= ( 1, 2 );
438 unless ( defined $LJ::DEFAULT_CLUSTER
) {
439 $LJ::DEFAULT_CLUSTER
= [ 1, 2 ];
442 unless (%LJ::DBINFO
) {
445 'host' => 'localhost',
448 'dbname' => 'livejournal',
449 'role' => { 'master' => 1, 'slow' => 1 }
453 'host' => 'localhost',
457 'role' => { 'cluster1' => 1 },
461 'host' => 'localhost',
465 'role' => { 'cluster2' => 1 },
470 # theschwartz config for dev servers
471 # for production config, see cvs/ljconfs/site/etc/ljconfig.pl
472 my $mast = $LJ::DBINFO
{'master'};
473 my $dbname = $mast->{'dbname'} || 'livejournal';
474 my $dbhost = $mast->{'host'} || 'localhost';
475 unless (%LJ::THESCHWARTZ_DBS
) {
476 %LJ::THESCHWARTZ_DBS
= (
478 'dsn' => "dbi:mysql:$dbname;host=$dbhost",
479 'user' => $mast->{'user'},
480 'pass' => $mast->{'pass'},
485 unless (%LJ::THESCHWARTZ_DBS_ROLES
) {
486 %LJ::THESCHWARTZ_DBS_ROLES
= (
487 'default' => [ 'dev' ],
488 'worker' => [ 'dev' ],
493 unless (%LJ::MOGILEFS_CONFIG
) {
494 %LJ::MOGILEFS_CONFIG
= (
495 domain
=> 'danga.com::lj',
496 hosts
=> [ '127.0.0.1:7001' ],
508 @LJ::MEMCACHE_SERVERS
= qw( 127.0.0.1:11211 )
509 unless @LJ::MEMCACHE_SERVERS
;
511 @LJ::GEARMAN_SERVERS
= qw( 127.0.0.1:8000 )
512 unless @LJ::GEARMAN_SERVERS
;
515 # cluster 0 is no longer supported
516 $LJ::DEFAULT_CLUSTER
||= 1;
517 @LJ::CLUSTERS
= (1) unless @LJ::CLUSTERS
;