Add explicit configuration support for Akismet
The Akismet spam detection feature can be configured through a settings page, but in order to be able to keep the API key private (in hiera) we need to be able to set it through configuration management instead. Change-Id: Ie64ece3e84af407b5e4124c874f59dad5ab23d4e
This commit is contained in:
parent
237495f0a4
commit
8f84e57f53
@ -7,6 +7,7 @@
|
||||
class askbot::config (
|
||||
$db_password,
|
||||
$redis_password,
|
||||
$akismet_api_key = undef,
|
||||
$askbot_debug = false,
|
||||
$custom_theme_enabled = false,
|
||||
$custom_theme_name = undef,
|
||||
|
@ -57,6 +57,7 @@
|
||||
class askbot (
|
||||
$db_password,
|
||||
$redis_password,
|
||||
$akismet_api_key = undef,
|
||||
$askbot_branch = 'master',
|
||||
$askbot_debug = false,
|
||||
$askbot_ensure = 'present',
|
||||
@ -155,6 +156,7 @@ class askbot (
|
||||
redis_max_memory => $redis_max_memory,
|
||||
redis_bind => $redis_bind,
|
||||
redis_password => $redis_password,
|
||||
akismet_api_key => $akismet_api_key,
|
||||
site_ssl_enabled => $site_ssl_enabled,
|
||||
site_ssl_cert_file_contents => $site_ssl_cert_file_contents,
|
||||
site_ssl_key_file_contents => $site_ssl_key_file_contents,
|
||||
|
@ -21,6 +21,7 @@ class askbot::site::config (
|
||||
$smtp_port,
|
||||
$solr_enabled,
|
||||
$template_settings,
|
||||
$akismet_api_key = undef,
|
||||
) {
|
||||
|
||||
case $db_provider {
|
||||
|
@ -94,6 +94,11 @@ ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
|
||||
# Make up some unique string, and don't share it with anybody.
|
||||
SECRET_KEY = '44fb9b7219e3743bffabb6861cbc9a28'
|
||||
|
||||
<% if @akismet_api_key != nil -%>
|
||||
# To help mitigate spam, Akismet integration needs the API key for your account
|
||||
AKISMET_API_KEY = '<%= @akismet_api_key %>'
|
||||
<% end -%>
|
||||
|
||||
# List of callables that know how to import templates from various sources.
|
||||
TEMPLATE_LOADERS = (
|
||||
'askbot.skins.loaders.Loader',
|
||||
|
Loading…
x
Reference in New Issue
Block a user