| 1 | package OpenInteract2::Brick::WebsiteConfig; | ||||||||||
| 2 | |||||||||||
| 3 | 87 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 87 | ▶ | use base qw( OpenInteract2::Brick ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 87 | ▶ | use OpenInteract2::Exception; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 87 | my %INLINED_SUBS = ( | |||||||||
| 8 | 'bootstrap.ini' => 'BOOTSTRAPINI', | ||||||||||
| 9 | 'action_override.ini' => 'ACTION_OVERRIDEINI', | ||||||||||
| 10 | 'spops_override.ini' => 'SPOPS_OVERRIDEINI', | ||||||||||
| 11 | 'server.ini' => 'SERVERINI', | ||||||||||
| 12 | 'log4perl.conf' => 'LOG4PERLCONF', | ||||||||||
| 13 | 'observer.ini' => 'OBSERVERINI', | ||||||||||
| 14 | ); | ||||||||||
| 15 | |||||||||||
| 16 | 87 | ▶ | sub get_name { | ||||||||
|
Subroutine
get_name: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 17 | 87 | return 'website_config'; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 7 | ▶ | sub get_resources { | ||||||||
|
Subroutine
get_resources: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 21 | return ( | ||||||||||
| 22 | 7 | 'bootstrap.ini' => [ 'conf bootstrap.ini', 'yes' ], | |||||||||
| 23 | 'action_override.ini' => [ 'conf sample-action_override.ini', 'yes' ], | ||||||||||
| 24 | 'spops_override.ini' => [ 'conf sample-spops_override.ini', 'yes' ], | ||||||||||
| 25 | 'server.ini' => [ 'conf server.ini', 'yes' ], | ||||||||||
| 26 | 'log4perl.conf' => [ 'conf log4perl.conf', 'yes' ], | ||||||||||
| 27 | 'observer.ini' => [ 'conf observer.ini', 'yes' ], | ||||||||||
| 28 | ); | ||||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 6 | ▶ | sub load { | ||||||||
|
Subroutine
load: called CC=2 SCAR=7.4
Pod
undocumented
| |||||||||||
| 32 | 6 | my ( $self, $resource_name ) = @_; | |||||||||
| 33 | 6 | my $inline_sub_name = $INLINED_SUBS{ $resource_name }; | |||||||||
| 34 | 6 | ▶ | unless ( $inline_sub_name ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 0 | OpenInteract2::Exception->throw( | |||||||||
| 36 | "Resource name '$resource_name' not found ", | ||||||||||
| 37 | "in ", ref( $self ), "; cannot load content." ); | ||||||||||
| 38 | } | ||||||||||
| 39 | 6 | return $self->$inline_sub_name(); | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 87 | OpenInteract2::Brick->register_factory_type( get_name() => __PACKAGE__ ); | |||||||||
| 43 | |||||||||||
| 44 | =pod | ||||||||||
| 45 | |||||||||||
| 46 | =head1 NAME | ||||||||||
| 47 | |||||||||||
| 48 | OpenInteract2::Brick::WebsiteConfig - Various non-server-specific configuration files for OI2 website | ||||||||||
| 49 | |||||||||||
| 50 | =head1 SYNOPSIS | ||||||||||
| 51 | |||||||||||
| 52 | oi2_manage create_website --website_dir=/path/to/site | ||||||||||
| 53 | |||||||||||
| 54 | =head1 DESCRIPTION | ||||||||||
| 55 | |||||||||||
| 56 | This class holds various configuration files for running the OI2 website. | ||||||||||
| 57 | |||||||||||
| 58 | These resources are associated with OpenInteract2 version 1.99_06. | ||||||||||
| 59 | |||||||||||
| 60 | =head2 Resources | ||||||||||
| 61 | |||||||||||
| 62 | You can grab resources individually using the names below and | ||||||||||
| 63 | C<load_resource()> and C<copy_resources_to()>, or you can copy all the | ||||||||||
| 64 | resources at once using C<copy_all_resources_to()> -- see | ||||||||||
| 65 | L<OpenInteract2::Brick> for details. | ||||||||||
| 66 | |||||||||||
| 67 | =over 4 | ||||||||||
| 68 | |||||||||||
| 69 | |||||||||||
| 70 | =item B<bootstrap.ini> | ||||||||||
| 71 | |||||||||||
| 72 | =item B<action_override.ini> | ||||||||||
| 73 | |||||||||||
| 74 | =item B<spops_override.ini> | ||||||||||
| 75 | |||||||||||
| 76 | =item B<server.ini> | ||||||||||
| 77 | |||||||||||
| 78 | =item B<log4perl.conf> | ||||||||||
| 79 | |||||||||||
| 80 | =item B<observer.ini> | ||||||||||
| 81 | |||||||||||
| 82 | |||||||||||
| 83 | =back | ||||||||||
| 84 | |||||||||||
| 85 | =head1 COPYRIGHT | ||||||||||
| 86 | |||||||||||
| 87 | Copyright (c) 2005 Chris Winters. All rights reserved. | ||||||||||
| 88 | |||||||||||
| 89 | This library is free software; you can redistribute it and/or modify | ||||||||||
| 90 | it under the same terms as Perl itself. | ||||||||||
| 91 | |||||||||||
| 92 | =head1 AUTHORS | ||||||||||
| 93 | |||||||||||
| 94 | |||||||||||
| 95 | Chris Winters E<lt>chris@cwinters.comE<gt> | ||||||||||
| 96 | |||||||||||
| 97 | |||||||||||
| 98 | =cut | ||||||||||
| 99 | |||||||||||
| 100 | |||||||||||
| 101 | 1 | ▶ | sub BOOTSTRAPINI { | ||||||||
|
Subroutine
BOOTSTRAPINI: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 102 | 1 | return <<'SOMELONGSTRING'; | |||||||||
| 103 | # This configuration bootstraps the server into existence | ||||||||||
| 104 | [bootstrap] | ||||||||||
| 105 | website_dir = [% website_dir %] | ||||||||||
| 106 | config_dir = conf | ||||||||||
| 107 | config_file = server.ini | ||||||||||
| 108 | config_type = ini | ||||||||||
| 109 | config_class = OpenInteract2::Config::IniFile | ||||||||||
| 110 | package_dir = pkg | ||||||||||
| 111 | temp_lib_dir = tmplib | ||||||||||
| 112 | |||||||||||
| 113 | SOMELONGSTRING | ||||||||||
| 114 | } | ||||||||||
| 115 | |||||||||||
| 116 | 1 | ▶ | sub ACTION_OVERRIDEINI { | ||||||||
|
Subroutine
ACTION_OVERRIDEINI: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 117 | 1 | return <<'SOMELONGSTRING'; | |||||||||
| 118 | # $Id: action_override.ini,v 1.1 2005/01/28 15:37:10 lachoy Exp $ | ||||||||||
| 119 | |||||||||||
| 120 | # Sample action override rules. If you decide to use override rules, | ||||||||||
| 121 | # save them to '$WEBSITE_DIR/conf/action_override.ini'. | ||||||||||
| 122 | |||||||||||
| 123 | # | ||||||||||
| 124 | # modify the security for 'news' action | ||||||||||
| 125 | |||||||||||
| 126 | [news.security.DEFAULT] | ||||||||||
| 127 | action = replace | ||||||||||
| 128 | value = NONE | ||||||||||
| 129 | |||||||||||
| 130 | # | ||||||||||
| 131 | # change a template to use for the 'search' task | ||||||||||
| 132 | |||||||||||
| 133 | [news.template_source.search] | ||||||||||
| 134 | action = replace | ||||||||||
| 135 | value = news::my_search_results | ||||||||||
| 136 | |||||||||||
| 137 | SOMELONGSTRING | ||||||||||
| 138 | } | ||||||||||
| 139 | |||||||||||
| 140 | 1 | ▶ | sub SPOPS_OVERRIDEINI { | ||||||||
|
Subroutine
SPOPS_OVERRIDEINI: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 141 | 1 | return <<'SOMELONGSTRING'; | |||||||||
| 142 | # $Id: spops_override.ini,v 1.1 2005/01/28 15:37:10 lachoy Exp $ | ||||||||||
| 143 | |||||||||||
| 144 | # Sample SPOPS override rules. If you decide to use override rules, | ||||||||||
| 145 | # save them to '$WEBSITE_DIR/conf/spops_override.ini'. | ||||||||||
| 146 | |||||||||||
| 147 | # | ||||||||||
| 148 | # New objects will get added to "What's new?" | ||||||||||
| 149 | |||||||||||
| 150 | [news.rules_from] | ||||||||||
| 151 | action = add | ||||||||||
| 152 | value = OpenInteract2::WhatsNewTrack | ||||||||||
| 153 | type = list | ||||||||||
| 154 | |||||||||||
| 155 | # | ||||||||||
| 156 | # New objects will get added to the full-text index | ||||||||||
| 157 | |||||||||||
| 158 | [news.is_searchable] | ||||||||||
| 159 | action = replace | ||||||||||
| 160 | value = yes | ||||||||||
| 161 | |||||||||||
| 162 | SOMELONGSTRING | ||||||||||
| 163 | } | ||||||||||
| 164 | |||||||||||
| 165 | 1 | ▶ | sub SERVERINI { | ||||||||
|
Subroutine
SERVERINI: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 166 | 1 | return <<'SOMELONGSTRING'; | |||||||||
| 167 | # OPENINTERACT 2.x SERVER CONFIGURATION | ||||||||||
| 168 | # This is the main configuration file for OpenInteract 2.x. All | ||||||||||
| 169 | # comments can be removed with a one-liner: | ||||||||||
| 170 | # | ||||||||||
| 171 | # perl -ne 'print unless /^\s*#/' < server.ini > server_new.ini | ||||||||||
| 172 | |||||||||||
| 173 | # Items in this section will be available from the configuration | ||||||||||
| 174 | # object's root, at least for the time being | ||||||||||
| 175 | # | ||||||||||
| 176 | # promote_oi | ||||||||||
| 177 | # If set to 'yes' I'll put a 'X-Powered-By' header in all the | ||||||||||
| 178 | # pages I serve. | ||||||||||
| 179 | # ConfigurationRevision | ||||||||||
| 180 | # Used for debugging | ||||||||||
| 181 | # timezone | ||||||||||
| 182 | # Set to a timezone that can be used as the 'time_zone' parameter | ||||||||||
| 183 | # in a DateTime object (which in turn should be able to be used | ||||||||||
| 184 | # as the 'name' parameter to the DateTime::TimeZone->new() | ||||||||||
| 185 | # constructor. | ||||||||||
| 186 | |||||||||||
| 187 | [Global] | ||||||||||
| 188 | promote_oi = yes | ||||||||||
| 189 | ConfigurationRevision = $Revision: 1.52 $ | ||||||||||
| 190 | timezone = America/New_York | ||||||||||
| 191 | |||||||||||
| 192 | # General information about the context of your server | ||||||||||
| 193 | |||||||||||
| 194 | # deployed_under | ||||||||||
| 195 | # A top-level URL that the server runs under. By default this is | ||||||||||
| 196 | # blank so the server expects URLs at the top level. If you set | ||||||||||
| 197 | # this to '/MyOI' for instance, then '/User/search/' is | ||||||||||
| 198 | # equivalent to '/MyOI/User/search/' | ||||||||||
| 199 | # deployed_under_image | ||||||||||
| 200 | # Top-level URL that images are deployed under. If left blank | ||||||||||
| 201 | # images will be at '/images/...' | ||||||||||
| 202 | # deployed_under_static | ||||||||||
| 203 | # Top-level URL that static files (like PDFs, RSS, etc.) are | ||||||||||
| 204 | # deployed under. There's no default for this, so if left as is | ||||||||||
| 205 | # any URLs passed to OI2::URL will be unmodified. | ||||||||||
| 206 | |||||||||||
| 207 | [context_info] | ||||||||||
| 208 | deployed_under = | ||||||||||
| 209 | deployed_under_image = | ||||||||||
| 210 | deployed_under_static = | ||||||||||
| 211 | |||||||||||
| 212 | # | ||||||||||
| 213 | # Information about how to send email and some system email addresses | ||||||||||
| 214 | |||||||||||
| 215 | [mail] | ||||||||||
| 216 | smtp_host = 127.0.0.1 | ||||||||||
| 217 | admin_email = admin@mycompany.com | ||||||||||
| 218 | content_email = content@mycompany.com | ||||||||||
| 219 | |||||||||||
| 220 | |||||||||||
| 221 | # | ||||||||||
| 222 | # Define some system-wide datasources. (See also: | ||||||||||
| 223 | # 'session_info.datasource') | ||||||||||
| 224 | # spops | ||||||||||
| 225 | # Default datasource for SPOPS objects. | ||||||||||
| 226 | # system | ||||||||||
| 227 | # Default datasource for system tables. Some of these are not | ||||||||||
| 228 | # SPOPS objects. | ||||||||||
| 229 | # ldap | ||||||||||
| 230 | # Default datasource for LDAP objects. | ||||||||||
| 231 | # manager | ||||||||||
| 232 | # Class of the datasource manager | ||||||||||
| 233 | |||||||||||
| 234 | [datasource_config] | ||||||||||
| 235 | spops = main | ||||||||||
| 236 | system = main | ||||||||||
| 237 | ldap = main_ldap | ||||||||||
| 238 | manager = OpenInteract2::DatasourceManager | ||||||||||
| 239 | |||||||||||
| 240 | # | ||||||||||
| 241 | # Add datasource type mappings here. We may allow default driver | ||||||||||
| 242 | # settings here also - 'long_read_len', etc., but for now KISS is the | ||||||||||
| 243 | # rule of the day. | ||||||||||
| 244 | |||||||||||
| 245 | [datasource_type DBI] | ||||||||||
| 246 | connection_manager = OpenInteract2::Datasource::DBI | ||||||||||
| 247 | spops_config = OpenInteract2::SPOPS::DBI | ||||||||||
| 248 | |||||||||||
| 249 | [datasource_type LDAP] | ||||||||||
| 250 | connection_manager = OpenInteract2::Datasource::LDAP | ||||||||||
| 251 | spops_config = OpenInteract2::SPOPS::LDAP | ||||||||||
| 252 | |||||||||||
| 253 | # | ||||||||||
| 254 | # Enter your database connection parameters in the 'main' entry -- see | ||||||||||
| 255 | # 'OpenInteract2::Datasource::DBI' for more information about | ||||||||||
| 256 | # them). Briefly: | ||||||||||
| 257 | # | ||||||||||
| 258 | # type | ||||||||||
| 259 | # DBI (this should not change) | ||||||||||
| 260 | # dbi_type | ||||||||||
| 261 | # type of database (MySQL, Pg, Oracle, MSSQL, Sybase, ASAny, SQLite) | ||||||||||
| 262 | # dsn | ||||||||||
| 263 | # last part of the DBI DSN | ||||||||||
| 264 | # username | ||||||||||
| 265 | # who do we login as? | ||||||||||
| 266 | # password | ||||||||||
| 267 | # what password do we login with? | ||||||||||
| 268 | |||||||||||
| 269 | [datasource main] | ||||||||||
| 270 | type = DBI | ||||||||||
| 271 | dbi_type = | ||||||||||
| 272 | dsn = | ||||||||||
| 273 | username = | ||||||||||
| 274 | password = | ||||||||||
| 275 | |||||||||||
| 276 | # | ||||||||||
| 277 | # Enter your LDAP connection information if you're using | ||||||||||
| 278 | # LDAP. Briefly: | ||||||||||
| 279 | # | ||||||||||
| 280 | # host | ||||||||||
| 281 | # The IP address/hostname with the LDAP server | ||||||||||
| 282 | # port | ||||||||||
| 283 | # The port the LDAP server is running on (usually 389) | ||||||||||
| 284 | # bind_dn | ||||||||||
| 285 | # The distinguished name of the record to bind as. If left | ||||||||||
| 286 | # blank you will be doing an anonymous bind and the value for | ||||||||||
| 287 | # 'bind_password' will not be used. | ||||||||||
| 288 | # bind_password | ||||||||||
| 289 | # Password to use with 'bind_dn' to bind to the server. | ||||||||||
| 290 | # base_dn | ||||||||||
| 291 | # Can be used by modules to determine the Base DN where | ||||||||||
| 292 | # objects should be stored. This might be something like | ||||||||||
| 293 | # 'dc=MyCompany,dc=com' | ||||||||||
| 294 | # timeout | ||||||||||
| 295 | # Value (in seconds) to wait for a timed out connection | ||||||||||
| 296 | # version | ||||||||||
| 297 | # LDAP protocol version. Use '3' if you're using SASL | ||||||||||
| 298 | # sasl | ||||||||||
| 299 | # Set to a true value to use SASL authentication | ||||||||||
| 300 | # debug | ||||||||||
| 301 | # See entry in Net::LDAP->new() for possible values | ||||||||||
| 302 | |||||||||||
| 303 | [datasource main_ldap] | ||||||||||
| 304 | type = LDAP | ||||||||||
| 305 | spops = SPOPS::LDAP | ||||||||||
| 306 | host = | ||||||||||
| 307 | port = | ||||||||||
| 308 | bind_dn = | ||||||||||
| 309 | bind_password = | ||||||||||
| 310 | base_dn = | ||||||||||
| 311 | timeout = 120 | ||||||||||
| 312 | version = 2 | ||||||||||
| 313 | sasl = 0 | ||||||||||
| 314 | debug = 0 | ||||||||||
| 315 | |||||||||||
| 316 | |||||||||||
| 317 | # | ||||||||||
| 318 | # fulltext.default | ||||||||||
| 319 | # Decide which indexer to use. The name corresponds # to a | ||||||||||
| 320 | # configuration section under 'fulltext'. So 'default = DBI' # means | ||||||||||
| 321 | # to use the implementation in 'fulltext.DBI.class' | ||||||||||
| 322 | |||||||||||
| 323 | [fulltext] | ||||||||||
| 324 | default = DBI | ||||||||||
| 325 | |||||||||||
| 326 | # | ||||||||||
| 327 | # DBI full-text implementation | ||||||||||
| 328 | # This is the implementation found in the 'full_text' package | ||||||||||
| 329 | # shipped with OI2. Read more in the implementation class | ||||||||||
| 330 | # 'OpenInteract2::FullTextSearch::DBI' | ||||||||||
| 331 | |||||||||||
| 332 | [fulltext DBI] | ||||||||||
| 333 | class = OpenInteract2::FullTextIndexer::DBI | ||||||||||
| 334 | datasource = main | ||||||||||
| 335 | column_group = listing | ||||||||||
| 336 | min_word_length = 3 | ||||||||||
| 337 | max_word_length = 30 | ||||||||||
| 338 | index_table = full_text_index | ||||||||||
| 339 | class_map_table = full_text_index_class | ||||||||||
| 340 | stem_locale = en | ||||||||||
| 341 | |||||||||||
| 342 | # | ||||||||||
| 343 | # If you're not using a database-backed session store, just change | ||||||||||
| 344 | # 'class' to the relevant OpenInteract implementation class (e.g., | ||||||||||
| 345 | # 'OpenInteract2::SessionManager::File' or '::SQLite' and if necessary | ||||||||||
| 346 | # change 'impl_class' to the actual implementation class (e.g., | ||||||||||
| 347 | # 'Apache::Session::File'); you'll also need to create relevant | ||||||||||
| 348 | # entries in 'session_info.params' below (e.g., 'Directory' and | ||||||||||
| 349 | # 'LockDirectory' for 'Apache::Session::File'). | ||||||||||
| 350 | # | ||||||||||
| 351 | # If you are using a database-backed session store, you just need | ||||||||||
| 352 | # to change 'impl_class' to the relevant storage module (e.g., | ||||||||||
| 353 | # 'Apache::Session::Postgres') You can also change | ||||||||||
| 354 | # 'datasource' to the name of the datasource being used. | ||||||||||
| 355 | # | ||||||||||
| 356 | # Note that you can also set the expiration for the session | ||||||||||
| 357 | # cookie -- if you set it to be 'undef' the cookie will be | ||||||||||
| 358 | # 'short-lived', meaning it will expire when the user shuts | ||||||||||
| 359 | # down the browser. Otherwise, pass something like the | ||||||||||
| 360 | # following: '+3d' (3 days); '+3M' (3 months); '+480s' (480 | ||||||||||
| 361 | # seconds); '+15h' (15 hours); '+1y' (1 year) | ||||||||||
| 362 | # | ||||||||||
| 363 | # The setting for 'expires_in' is in minutes. If set to 0 or undefined | ||||||||||
| 364 | # the sessions will never be time-expired. | ||||||||||
| 365 | # | ||||||||||
| 366 | # The 'cache_*' settings determine whether the user, group and theme | ||||||||||
| 367 | # objects should be stored in the session. If set to 0 we fetch this | ||||||||||
| 368 | # information every request. If set to a positive number, we store the | ||||||||||
| 369 | # objects in the session and refresh it every x minutes. | ||||||||||
| 370 | |||||||||||
| 371 | [session_info] | ||||||||||
| 372 | class = OpenInteract2::SessionManager::File | ||||||||||
| 373 | impl_class = Apache::Session::File | ||||||||||
| 374 | datasource = main | ||||||||||
| 375 | expiration = +3M | ||||||||||
| 376 | expires_in = 0 | ||||||||||
| 377 | cache_user = 30 | ||||||||||
| 378 | cache_group = 30 | ||||||||||
| 379 | cache_theme = 30 | ||||||||||
| 380 | |||||||||||
| 381 | [session_info params] | ||||||||||
| 382 | Directory = cache/sessions | ||||||||||
| 383 | LockDirectory = cache/sessions_lock | ||||||||||
| 384 | |||||||||||
| 385 | # | ||||||||||
| 386 | # Unless you're using LDAP for authentication, you probably don't | ||||||||||
| 387 | # want to change these in the beginning. However, you might want | ||||||||||
| 388 | # to change them (particularly the 'theme' value) as your site | ||||||||||
| 389 | # grows. | ||||||||||
| 390 | |||||||||||
| 391 | [default_objects] | ||||||||||
| 392 | superuser = 1 | ||||||||||
| 393 | supergroup = 1 | ||||||||||
| 394 | theme = 1 | ||||||||||
| 395 | public_group = 2 | ||||||||||
| 396 | site_admin_group = 3 | ||||||||||
| 397 | |||||||||||
| 398 | |||||||||||
| 399 | # | ||||||||||
| 400 | # Define the box handler and the handler to take care of the | ||||||||||
| 401 | # default system boxes. The 'custom_box_handler' entry is for you | ||||||||||
| 402 | # to fill in if you'd like -- you can add other boxes to every | ||||||||||
| 403 | # page, add them depending on the request type, etc. | ||||||||||
| 404 | |||||||||||
| 405 | [box] | ||||||||||
| 406 | action = box_display | ||||||||||
| 407 | default_template = base_box::main_box_shell | ||||||||||
| 408 | default_separator = | ||||||||||
| 409 | default_method = | ||||||||||
| 410 | system_box_handler = OpenInteract2::Action::SystemBoxes | ||||||||||
| 411 | system_box_method = | ||||||||||
| 412 | custom_box_handler = | ||||||||||
| 413 | custom_box_method = | ||||||||||
| 414 | |||||||||||
| 415 | |||||||||||
| 416 | # | ||||||||||
| 417 | # Define login information. In the future you'll be able to define | ||||||||||
| 418 | # the object(s) used for logging in and possibly more. | ||||||||||
| 419 | # | ||||||||||
| 420 | # auth_user_class: Define the class used for getting login information | ||||||||||
| 421 | # (username/password), creating a user and checking the password. If | ||||||||||
| 422 | # you have custom login needs to may want to modify this -- see | ||||||||||
| 423 | # OpenInteract2::Auth::User for info. | ||||||||||
| 424 | # | ||||||||||
| 425 | # auth_group_class: Define the class used for getting the groups | ||||||||||
| 426 | # related to a logged-in user. This is rarer to change, but if you'd | ||||||||||
| 427 | # like to see OpenInteract2::Auth::Group for info. | ||||||||||
| 428 | # | ||||||||||
| 429 | # auth_admin_class: Define the class used to see whether a user/group | ||||||||||
| 430 | # combination is an administrator or not. See | ||||||||||
| 431 | # OpenInteract2::Auth::AdminCheck for info. | ||||||||||
| 432 | # | ||||||||||
| 433 | # custom_login_*: Class and method that specify an action that | ||||||||||
| 434 | # executes when a user logs in (Optional) | ||||||||||
| 435 | # | ||||||||||
| 436 | # crypt_password: Set whether you want to store encrypted passwords in | ||||||||||
| 437 | # the database (set by default and recommended). Note that if you're | ||||||||||
| 438 | # using LDAP or some SMB authentication you want to set this to '0' | ||||||||||
| 439 | # since the backend will take care of that for you. | ||||||||||
| 440 | # | ||||||||||
| 441 | # disable_superuser_password_change: If set to a true value you will | ||||||||||
| 442 | # not be able to set the superuser password using the | ||||||||||
| 443 | # 'create_password' management task. | ||||||||||
| 444 | # | ||||||||||
| 445 | # initial_login_expires: amount of time after which a 'cleanup_user' | ||||||||||
| 446 | # task (if run) will delete a user; if you never cleanup orphaned | ||||||||||
| 447 | # logins don't worry about this. | ||||||||||
| 448 | # | ||||||||||
| 449 | # *_field: These are the fields used to read in the username and | ||||||||||
| 450 | # password from the user and are used in the 'login_box' component | ||||||||||
| 451 | # shipped with OpenInteract and found in the 'base_box' package. Note | ||||||||||
| 452 | # that if 'remember_field' is not defined then we don't display the | ||||||||||
| 453 | # checkbox in the login box. | ||||||||||
| 454 | # | ||||||||||
| 455 | # always_remember: if true then we always remember the login (and | ||||||||||
| 456 | # don't display the checkbox) | ||||||||||
| 457 | # | ||||||||||
| 458 | # required: if set a login is always required; if the user isn't | ||||||||||
| 459 | # logged in she'll be sent to the URL in 'required_url' | ||||||||||
| 460 | # | ||||||||||
| 461 | # required_skip: zero or more regular expressions indicating the areas | ||||||||||
| 462 | # of the site that don't require a login even if 'required' is | ||||||||||
| 463 | # true. (Don't include your deployment path in these if you have one.) | ||||||||||
| 464 | |||||||||||
| 465 | [login] | ||||||||||
| 466 | auth_user_class = OpenInteract2::Auth::User | ||||||||||
| 467 | auth_group_class = OpenInteract2::Auth::Group | ||||||||||
| 468 | auth_admin_class = OpenInteract2::Auth::AdminCheck | ||||||||||
| 469 | |||||||||||
| 470 | custom_login_handler = | ||||||||||
| 471 | custom_login_method = | ||||||||||
| 472 | |||||||||||
| 473 | crypt_password = 1 | ||||||||||
| 474 | disable_superuser_password_change = 0 | ||||||||||
| 475 | |||||||||||
| 476 | initial_login_expires = 24h | ||||||||||
| 477 | login_field = login_login_name | ||||||||||
| 478 | password_field = login_password | ||||||||||
| 479 | remember_field = login_remember | ||||||||||
| 480 | always_remember = 0 | ||||||||||
| 481 | required = 0 | ||||||||||
| 482 | required_url = /login.html | ||||||||||
| 483 | required_skip = ^/$ | ||||||||||
| 484 | required_skip = ^/index.html$ | ||||||||||
| 485 | required_skip = ^/Login.* | ||||||||||
| 486 | required_skip = ^/help.* | ||||||||||
| 487 | |||||||||||
| 488 | |||||||||||
| 489 | # Various language settings | ||||||||||
| 490 | |||||||||||
| 491 | # default_language: default language for this website; this will be | ||||||||||
| 492 | # used for the superuser (when the site is created), users who aren't | ||||||||||
| 493 | # logged in, and users who don't have a language selected | ||||||||||
| 494 | # | ||||||||||
| 495 | # choice_param_name: if a user isn't logged in we check the GET/POST | ||||||||||
| 496 | # parameters to see if a particular language has been chosen for this | ||||||||||
| 497 | # request; this setting names the parameter we check | ||||||||||
| 498 | |||||||||||
| 499 | [language] | ||||||||||
| 500 | default_language = en | ||||||||||
| 501 | choice_param_name = oi_language | ||||||||||
| 502 | |||||||||||
| 503 | # | ||||||||||
| 504 | # How to do HTTP redirects | ||||||||||
| 505 | # | ||||||||||
| 506 | # use_meta_redirect: if set to 1 we'll create a redirect using META | ||||||||||
| 507 | # tags (old way) | ||||||||||
| 508 | # | ||||||||||
| 509 | # use_header_redirect: if set to 1 we'll perform a redirect using HTTP | ||||||||||
| 510 | # headers (new way); overrides 'use_header_redirect' if set | ||||||||||
| 511 | # | ||||||||||
| 512 | # show_redirect_message: if using 'use_meta_redirect' controls whether | ||||||||||
| 513 | # we display a message in the page using META tags | ||||||||||
| 514 | |||||||||||
| 515 | |||||||||||
| 516 | [redirect] | ||||||||||
| 517 | use_meta_redirect = 0 | ||||||||||
| 518 | use_header_redirect = 1 | ||||||||||
| 519 | show_redirect_message = 0 | ||||||||||
| 520 | |||||||||||
| 521 | |||||||||||
| 522 | # Internal mapping for convenience. | ||||||||||
| 523 | |||||||||||
| 524 | [system_class] | ||||||||||
| 525 | repository = OpenInteract2::Repository | ||||||||||
| 526 | package = OpenInteract2::Package | ||||||||||
| 527 | template = OpenInteract2::SiteTemplate | ||||||||||
| 528 | setup = OpenInteract2::Setup | ||||||||||
| 529 | ini_reader = OpenInteract2::Config::Ini | ||||||||||
| 530 | |||||||||||
| 531 | # List your OI2::Request and OI2::Response implementations; these are | ||||||||||
| 532 | # registered at server startup but not included until you request them | ||||||||||
| 533 | |||||||||||
| 534 | [request] | ||||||||||
| 535 | apache = OpenInteract2::Request::Apache | ||||||||||
| 536 | apache2 = OpenInteract2::Request::Apache2 | ||||||||||
| 537 | cgi = OpenInteract2::Request::CGI | ||||||||||
| 538 | lwp = OpenInteract2::Request::LWP | ||||||||||
| 539 | standalone = OpenInteract2::Request::Standalone | ||||||||||
| 540 | |||||||||||
| 541 | [response] | ||||||||||
| 542 | apache = OpenInteract2::Response::Apache | ||||||||||
| 543 | apache2 = OpenInteract2::Response::Apache2 | ||||||||||
| 544 | cgi = OpenInteract2::Response::CGI | ||||||||||
| 545 | lwp = OpenInteract2::Response::LWP | ||||||||||
| 546 | standalone = OpenInteract2::Response::Standalone | ||||||||||
| 547 | |||||||||||
| 548 | |||||||||||
| 549 | # | ||||||||||
| 550 | # Define what your system uses for certain IDs. Defaults are fine | ||||||||||
| 551 | # for most uses -- the most common need for changing these is | ||||||||||
| 552 | # if you're using LDAP to store user and group objects. | ||||||||||
| 553 | # | ||||||||||
| 554 | # Currently accepted values for *_type: 'int', 'char' | ||||||||||
| 555 | # | ||||||||||
| 556 | # If _type is set to 'char', then _size should be set to the necessary | ||||||||||
| 557 | # width of the field. Default is 25. | ||||||||||
| 558 | |||||||||||
| 559 | [id] | ||||||||||
| 560 | user_type = int | ||||||||||
| 561 | user_size = 25 | ||||||||||
| 562 | group_type = int | ||||||||||
| 563 | group_size = 25 | ||||||||||
| 564 | |||||||||||
| 565 | |||||||||||
| 566 | # | ||||||||||
| 567 | # Directories used by OpenInteract. Only change these if you know what | ||||||||||
| 568 | # you're doing. Note that 'website' is replaced when the server starts | ||||||||||
| 569 | # up, so any value you set there will be overwritten. When this | ||||||||||
| 570 | # configuration file is read all other keys (like $WEBSITE) get | ||||||||||
| 571 | # replaced with the corresponding value under 'dir'. The | ||||||||||
| 572 | # subdirectories are space-separated so we can pass them to File::Spec | ||||||||||
| 573 | # and get a os-specific path. | ||||||||||
| 574 | # | ||||||||||
| 575 | # TODO: Be sure to modify all references from get_dir( 'base' ) to | ||||||||||
| 576 | # {dir}{website} | ||||||||||
| 577 | |||||||||||
| 578 | [dir] | ||||||||||
| 579 | website = | ||||||||||
| 580 | html = $WEBSITE/html | ||||||||||
| 581 | help = $WEBSITE/html/help | ||||||||||
| 582 | download = $WEBSITE/html/downloads | ||||||||||
| 583 | error = $WEBSITE/error | ||||||||||
| 584 | log = $WEBSITE/logs | ||||||||||
| 585 | config = $WEBSITE/conf | ||||||||||
| 586 | data = $WEBSITE/data | ||||||||||
| 587 | mail = $WEBSITE/mail | ||||||||||
| 588 | msg = $WEBSITE/msg | ||||||||||
| 589 | overflow = $WEBSITE/overflow | ||||||||||
| 590 | upload = $WEBSITE/uploads | ||||||||||
| 591 | template = $WEBSITE/template | ||||||||||
| 592 | package = $WEBSITE/pkg | ||||||||||
| 593 | |||||||||||
| 594 | # | ||||||||||
| 595 | # Control OpenInteract caching. If 'use' is set to 'no' the no caching | ||||||||||
| 596 | # will be enabled. The 'class' key controls where the cache is | ||||||||||
| 597 | # stored. Some implementations respect 'max_size' (in bytes). The | ||||||||||
| 598 | # 'cleanup' key controls whether the cache is cleaned out at server | ||||||||||
| 599 | # startup. And the '::File' implementation will use 'directory' (to | ||||||||||
| 600 | # specify where the cache root begins) and 'directory_depth' so that you | ||||||||||
| 601 | # don't put too many files in a single directory. | ||||||||||
| 602 | |||||||||||
| 603 | [cache] | ||||||||||
| 604 | use = no | ||||||||||
| 605 | use_spops = no | ||||||||||
| 606 | default_expire = 600 | ||||||||||
| 607 | directory = [% website_dir %]/cache/content | ||||||||||
| 608 | class = OpenInteract2::Cache::File | ||||||||||
| 609 | max_size = 2000000 | ||||||||||
| 610 | cleanup = yes | ||||||||||
| 611 | directory_depth = 3 | ||||||||||
| 612 | |||||||||||
| 613 | # | ||||||||||
| 614 | # Define the different content generators (Template Toolkit, | ||||||||||
| 615 | # HTML::Template, SOAP, etc.). Each content generator can have its own | ||||||||||
| 616 | # configuration settings. | ||||||||||
| 617 | |||||||||||
| 618 | # | ||||||||||
| 619 | # Template Toolkit configuration settings | ||||||||||
| 620 | # | ||||||||||
| 621 | # template_ext: Default extension for template files. We also check | ||||||||||
| 622 | # for files with a given name and no extension | ||||||||||
| 623 | # | ||||||||||
| 624 | # cache_size: How many templates TT should cache in memory | ||||||||||
| 625 | # | ||||||||||
| 626 | # cache_size: How long TT should keep cached templates in memory (seconds) | ||||||||||
| 627 | # | ||||||||||
| 628 | # compile_cleanup: If true, will remove all compiled files on server | ||||||||||
| 629 | # restart (production boxes can set this to false so that startup | ||||||||||
| 630 | # costs aren't so heavy) | ||||||||||
| 631 | # | ||||||||||
| 632 | # compile_dir: Directory where compiled files are stored; this is | ||||||||||
| 633 | # resolved at runtime under the website directory. | ||||||||||
| 634 | # | ||||||||||
| 635 | # compile_ext: Extension for compiled TT files. Most people won't (or | ||||||||||
| 636 | # shouldn't) care about this. | ||||||||||
| 637 | # | ||||||||||
| 638 | # custom_init_class: Location of 'custom_template_initialize()' class method | ||||||||||
| 639 | # that's called before the template object is initialized. Here you | ||||||||||
| 640 | # can define a PRE_PROCESS template (for instance, with BLOCKs having | ||||||||||
| 641 | # all your common widgets) or set any of the other configuration | ||||||||||
| 642 | # information specified in 'Template::Manual::Config' | ||||||||||
| 643 | # | ||||||||||
| 644 | # custom_variable_class: Location of 'custom_template_vars()' class | ||||||||||
| 645 | # method that's called before every template is processed. If you have | ||||||||||
| 646 | # common BLOCKs, formatting elements or other items that are not | ||||||||||
| 647 | # full-blown OI components, you can add them to the variables seen by | ||||||||||
| 648 | # every template. | ||||||||||
| 649 | |||||||||||
| 650 | [content_generator TT] | ||||||||||
| 651 | class = OpenInteract2::ContentGenerator::TT2Process | ||||||||||
| 652 | template_ext = tmpl | ||||||||||
| 653 | cache_size = 100 | ||||||||||
| 654 | cache_expire = 900 | ||||||||||
| 655 | compile_cleanup = 1 | ||||||||||
| 656 | compile_dir = cache/tt | ||||||||||
| 657 | compile_ext = .ttc | ||||||||||
| 658 | custom_init_class = | ||||||||||
| 659 | custom_variable_class = | ||||||||||
| 660 | |||||||||||
| 661 | # Sample for Text::Template | ||||||||||
| 662 | #[content_generator TextTemplate] | ||||||||||
| 663 | #class = OpenInteract2::ContentGenerator::TextTemplate | ||||||||||
| 664 | |||||||||||
| 665 | # Sample for HTML::Template | ||||||||||
| 666 | #[content_generator HTMLTemplate] | ||||||||||
| 667 | #class = OpenInteract2::ContentGenerator::HtmlTemplate | ||||||||||
| 668 | |||||||||||
| 669 | # | ||||||||||
| 670 | # Define the main controller; if you create additional | ||||||||||
| 671 | # interfaces for your website(s) (e.g. SOAP) then you | ||||||||||
| 672 | # will need to add entries here | ||||||||||
| 673 | |||||||||||
| 674 | [controller tt-template] | ||||||||||
| 675 | content_generator = TT | ||||||||||
| 676 | class = OpenInteract2::Controller::MainTemplate | ||||||||||
| 677 | |||||||||||
| 678 | [controller html-template] | ||||||||||
| 679 | content_generator = HTMLTemplate | ||||||||||
| 680 | class = OpenInteract2::Controller::MainTemplate | ||||||||||
| 681 | |||||||||||
| 682 | [controller text-template] | ||||||||||
| 683 | content_generator = TextTemplate | ||||||||||
| 684 | class = OpenInteract2::Controller::MainTemplate | ||||||||||
| 685 | |||||||||||
| 686 | [controller raw] | ||||||||||
| 687 | class = OpenInteract2::Controller::Raw | ||||||||||
| 688 | |||||||||||
| 689 | # The action table defines how OpenInteract responds to URLs; the only | ||||||||||
| 690 | # information we hold here is for default information | ||||||||||
| 691 | # ('action_info.default') -- information that does not need to be | ||||||||||
| 692 | # specified in the individual package's 'conf/action.ini' file; we | ||||||||||
| 693 | # also define how OpenInteract should respond to a null action (under | ||||||||||
| 694 | # 'action_info.none') and how it should respond to an action that is | ||||||||||
| 695 | # not found (under 'action_info.not_found') | ||||||||||
| 696 | |||||||||||
| 697 | [action_info] | ||||||||||
| 698 | none = page | ||||||||||
| 699 | not_found = page | ||||||||||
| 700 | |||||||||||
| 701 | [action_info default] | ||||||||||
| 702 | controller = tt-template | ||||||||||
| 703 | content_generator = TT | ||||||||||
| 704 | |||||||||||
| 705 | [action_types] | ||||||||||
| 706 | template_only = OpenInteract2::Action::TemplateOnly | ||||||||||
| 707 | lookup = OpenInteract2::Action::LookupEdit | ||||||||||
| 708 | |||||||||||
| 709 | # Define additional observers to SPOPS/action configuration | ||||||||||
| 710 | # initialization. Package authors typically take care of this in the | ||||||||||
| 711 | # package's 'package.conf', but just in case. Use a | ||||||||||
| 712 | # 'class = My::Class' format where 'My::Class' is your observer class. | ||||||||||
| 713 | |||||||||||
| 714 | [config_watcher] | ||||||||||
| 715 | |||||||||||
| 716 | SOMELONGSTRING | ||||||||||
| 717 | } | ||||||||||
| 718 | |||||||||||
| 719 | 1 | ▶ | sub LOG4PERLCONF { | ||||||||
|
Subroutine
LOG4PERLCONF: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 720 | 1 | return <<'SOMELONGSTRING'; | |||||||||
| 721 | ######################################## | ||||||||||
| 722 | # ROOT CATEGORY | ||||||||||
| 723 | |||||||||||
| 724 | log4perl.logger = FATAL, FileAppender, OIAppender | ||||||||||
| 725 | |||||||||||
| 726 | ######################################## | ||||||||||
| 727 | # OI2 CATEGORIES | ||||||||||
| 728 | |||||||||||
| 729 | # This is the root OI2 logger. Lowering its level without specifying | ||||||||||
| 730 | # the other OI2 loggers will result in lots of messages. | ||||||||||
| 731 | |||||||||||
| 732 | log4perl.logger.OI2 = INFO | ||||||||||
| 733 | #log4perl.logger.OI2.ACTION = WARN | ||||||||||
| 734 | #log4perl.logger.OI2.APP = DEBUG | ||||||||||
| 735 | #log4perl.logger.OI2.AUTH = DEBUG | ||||||||||
| 736 | #log4perl.logger.OI2.CACHE = WARN | ||||||||||
| 737 | log4perl.logger.OI2.CONFIG = WARN | ||||||||||
| 738 | #log4perl.logger.OI2.DS = WARN | ||||||||||
| 739 | #log4perl.logger.OI2.INITIALIZE = WARN | ||||||||||
| 740 | #log4perl.logger.OI2.REQUEST = WARN | ||||||||||
| 741 | #log4perl.logger.OI2.RESPONSE = WARN | ||||||||||
| 742 | #log4perl.logger.OI2.SECURITY = WARN | ||||||||||
| 743 | #log4perl.logger.OI2.SESSION = WARN | ||||||||||
| 744 | #log4perl.logger.OI2.SPOPS = WARN | ||||||||||
| 745 | log4perl.logger.OI2.TEMPLATE = WARN | ||||||||||
| 746 | # Uncomment this to see message keys in the localized messages | ||||||||||
| 747 | #log4perl.logger.OI2.TRANSLATE = DEBUG | ||||||||||
| 748 | |||||||||||
| 749 | ######################################## | ||||||||||
| 750 | # SPOPS CATEGORIES | ||||||||||
| 751 | |||||||||||
| 752 | # Unlike OI2, SPOPS uses its class names as categories; a few of the | ||||||||||
| 753 | # classes you'll probably be interested in are listed | ||||||||||
| 754 | |||||||||||
| 755 | log4perl.logger.SPOPS = WARN | ||||||||||
| 756 | #log4perl.logger.SPOPS.ClassFactory = INFO | ||||||||||
| 757 | #log4perl.logger.SPOPS.DBI = INFO | ||||||||||
| 758 | #log4perl.logger.SPOPS.Export = INFO | ||||||||||
| 759 | #log4perl.logger.SPOPS.Import = INFO | ||||||||||
| 760 | #log4perl.logger.SPOPS.LDAP = INFO | ||||||||||
| 761 | #log4perl.logger.SPOPS.Secure = INFO | ||||||||||
| 762 | #log4perl.logger.SPOPS.SQLInterface = INFO | ||||||||||
| 763 | |||||||||||
| 764 | ######################################## | ||||||||||
| 765 | # CUSTOM CATEGORIES | ||||||||||
| 766 | |||||||||||
| 767 | # Add your custom categories here... | ||||||||||
| 768 | |||||||||||
| 769 | ######################################## | ||||||||||
| 770 | # OI2 APPENDERS | ||||||||||
| 771 | |||||||||||
| 772 | # Normal file log | ||||||||||
| 773 | log4perl.appender.FileAppender = Log::Log4perl::Appender::File | ||||||||||
| 774 | log4perl.appender.FileAppender.filename = [% website_dir %]/logs/oi2.log | ||||||||||
| 775 | log4perl.appender.FileAppender.layout = Log::Log4perl::Layout::PatternLayout | ||||||||||
| 776 | log4perl.appender.FileAppender.layout.ConversionPattern = %d{HH:mm:ss} %p %c %C (%L) %m %n | ||||||||||
| 777 | |||||||||||
| 778 | # Stores errors to the filesystem for later browsing. | ||||||||||
| 779 | |||||||||||
| 780 | log4perl.appender.OIAppender = OpenInteract2::Log::OIAppender | ||||||||||
| 781 | log4perl.appender.OIAppender.layout = Log::Log4perl::Layout::PatternLayout | ||||||||||
| 782 | log4perl.appender.OIAppender.layout.ConversionPattern = %c && %C && %L && %m | ||||||||||
| 783 | log4perl.appender.OIAppender.Threshold = ERROR | ||||||||||
| 784 | |||||||||||
| 785 | |||||||||||
| 786 | SOMELONGSTRING | ||||||||||
| 787 | } | ||||||||||
| 788 | |||||||||||
| 789 | 1 | ▶ | sub OBSERVERINI { | ||||||||
|
Subroutine
OBSERVERINI: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 790 | 1 | return <<'SOMELONGSTRING'; | |||||||||
| 791 | # observer.ini: Specify observers that can react to observations | ||||||||||
| 792 | # published by actions or other objects. Filters are the most common | ||||||||||
| 793 | # example of these. | ||||||||||
| 794 | # | ||||||||||
| 795 | # Example, declare observers: | ||||||||||
| 796 | # | ||||||||||
| 797 | # [observer] | ||||||||||
| 798 | # wiki = OpenInteract2::Filter::WikiFormat | ||||||||||
| 799 | # useperl = OpenInteract2::Observer::UsePerlPost | ||||||||||
| 800 | # | ||||||||||
| 801 | # Example, map observer to action | ||||||||||
| 802 | # | ||||||||||
| 803 | # [map] | ||||||||||
| 804 | # wiki = page | ||||||||||
| 805 | # useperl = news | ||||||||||
| 806 | |||||||||||
| 807 | # See docs for OpenInteract2::Action under OBSERVABLE ACTIONS for more | ||||||||||
| 808 | |||||||||||
| 809 | SOMELONGSTRING | ||||||||||
| 810 | } | ||||||||||
| 811 | |||||||||||