OSDN Git Service

Plugin::DefaultConfig: add default values
authorhylom <hylom@users.osdn.me>
Wed, 19 Sep 2018 12:02:05 +0000 (21:02 +0900)
committerhylom <hylom@users.osdn.me>
Wed, 19 Sep 2018 12:02:05 +0000 (21:02 +0900)
src/newslash_web/lib/Newslash/Plugin/DefaultConfig.pm

index 011c61b..0e92b9c 100644 (file)
@@ -2,8 +2,141 @@ package Newslash::Plugin::DefaultConfig;
 use Mojo::Base 'Mojolicious::Plugin';
 
 my $defaults = {
-                Story => {
-                          submission_karma_bonus => 3,
+               BasicAuth => { enable => 0,
+                              username => "foo",
+                              password => "bar",
+                              message => "hoge",
+                            },
+
+               hypnotoad => { listen => [ 'http://*:80',
+                                          'https://*:443?cert=/etc/letsencrypt/live/example.com/cert.pem&key=/etc/letsencrypt/live/example.com/privkey.pem'
+                                        ],
+                              pid_file =>  '/var/run/newslash/newslash.pid',
+                            },
+
+               Site => { name => "srad",
+                         root => "/",
+                         base_url => "https://example.com",
+                         description => "yet another srad",
+                         img_path => "/img",
+                         css_path => "/css",
+                         topic_icon_base_url => "/img/topic_icon",
+                       },
+
+               ReCaptcha => { site_key =>  "<KEY_STRING>",
+                              secret_key => "<KEY_STRING>",
+                            },
+
+               ACL => { exclude => ["^/img/", "^/css/", "^/js/", "^/static/", "^/login", "^/logout", "^/banned"],
+                      },
+
+               Search => { searchd_host => "127.0.0.1",
+                           searchd_port => 6000,
+                         },
+
+               Searchd => { index_path => /var/newslash/lucene_index, },
+
+               Polls => { TTL => 120,
+                          TTL_unit => "days",
+                        },
+
+               Preprocessor => { targets => { css/newslash.css => { source => "css/newslash.less",
+                                                                    type => "less" },
+                                            },
+                                 less => { command => "/usr/bin/nodejs",
+                                           "content-type" => "text/css",
+                                           options => [ "--no-deprecation",
+                                                        "/usr/bin/lessc",
+                                                        { "--include-path" => "./css" },
+                                                        "--no-color",
+                                                        "-",
+                                                      ],
+                                         },
+                               },
+
+               JavaScriptLoader => { source_directory => "public/js",
+                                     mode => "production",
+                                   },
+
+               FeedFetcher => { fetch_timeout => 5,
+                                http_proxy => "http://proxy:8080/",
+                                https_proxy => "http://proxy:8080/",
+                              },
+
+               System => { secret_key => "<SECRET_KEY>",
+                           session_store => "kvs",
+                           salt => '',
+                           readonly => 0,
+                         },
+
+               Repository => {path => "/var/newslash/repository" },
+
+               Log => { access_log => "/var/log/newslash/access.log",
+                        system_log => "/var/log/newslash/newslash.log",
+                        local_file => 1,
+                        debug => 0,
+                        autoflush => 1,
+                        level => "info",
+                      },
+
+               Analytics => { tag => "<TAG>" },
+
+               Story => { title_max_byte => 100,
+                          submission_karma_bonus => 3,
+                        },
+
+               IndexPage => { story_per_page => 10, },
+
+               Timeline => { popular_period => { hours => 6 },
+                             item_per_page => 20,
+                           },
+
+               Database => { host => "db",
+                             name => "newslash",
+                             user => "newslash",
+                             password => "PASSWORD"
+                           },
+
+               KeyValueStore => { type => "redis",
+                                  host => "localhost:6379"
+                                },
+
+               Legacy => { memcached => "sd-master:11211" },
+
+               Faculties => { comments => { 1000 => [ipid, subnetid] },
+                              metamoderations => { 1000 => [uid] },
+                              moderations => { 1000 => [ipid, subnetid, uid, m2uid] },
+                              stories => { 1000 => [hits, hitparade] },
+                              submissions => { 1000 => [ipid, subnetid, note, comment] },
+                            },
+
+               Editor => { allowed_tags => { b =>  [],
+                                             i =>  [],
+                                             p =>  [],
+                                             br => [],
+                                             a =>  [href],
+                                             ol => [start],
+                                             ul => [],
+                                             li => [],
+                                             dl => [],
+                                             dt => [],
+                                             dd => [],
+                                             em => [],
+                                             strong => [],
+                                             tt => [],
+                                             blockquote => [title, cite],
+                                             div => [],
+                                             ecode => [],
+                                             del => [],
+                                             ins => [],
+                                             sub => [],
+                                             sup => [],
+                                             quote => [],
+                                             strike => [],
+                                           },
+                         },
+
+               Hsts => { redirect_non_ssl => 0, },
                };
 
 sub register {