From: hylom Date: Wed, 19 Sep 2018 12:02:05 +0000 (+0900) Subject: Plugin::DefaultConfig: add default values X-Git-Tag: v0.1.5~35^2~1 X-Git-Url: http://git.osdn.net/view?p=newslash%2Fnewslash.git;a=commitdiff_plain;h=57b992e2351b082b764c6eeaac8ce8397902bed0 Plugin::DefaultConfig: add default values --- diff --git a/src/newslash_web/lib/Newslash/Plugin/DefaultConfig.pm b/src/newslash_web/lib/Newslash/Plugin/DefaultConfig.pm index 011c61b1..0e92b9c6 100644 --- a/src/newslash_web/lib/Newslash/Plugin/DefaultConfig.pm +++ b/src/newslash_web/lib/Newslash/Plugin/DefaultConfig.pm @@ -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 => "", + secret_key => "", + }, + + 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 => "", + 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 => "" }, + + 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 {