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:
Jeremy Stanley 2016-07-25 20:05:47 +00:00
parent 237495f0a4
commit 8f84e57f53
4 changed files with 9 additions and 0 deletions

View File

@ -7,6 +7,7 @@
class askbot::config ( class askbot::config (
$db_password, $db_password,
$redis_password, $redis_password,
$akismet_api_key = undef,
$askbot_debug = false, $askbot_debug = false,
$custom_theme_enabled = false, $custom_theme_enabled = false,
$custom_theme_name = undef, $custom_theme_name = undef,

View File

@ -57,6 +57,7 @@
class askbot ( class askbot (
$db_password, $db_password,
$redis_password, $redis_password,
$akismet_api_key = undef,
$askbot_branch = 'master', $askbot_branch = 'master',
$askbot_debug = false, $askbot_debug = false,
$askbot_ensure = 'present', $askbot_ensure = 'present',
@ -155,6 +156,7 @@ class askbot (
redis_max_memory => $redis_max_memory, redis_max_memory => $redis_max_memory,
redis_bind => $redis_bind, redis_bind => $redis_bind,
redis_password => $redis_password, redis_password => $redis_password,
akismet_api_key => $akismet_api_key,
site_ssl_enabled => $site_ssl_enabled, site_ssl_enabled => $site_ssl_enabled,
site_ssl_cert_file_contents => $site_ssl_cert_file_contents, site_ssl_cert_file_contents => $site_ssl_cert_file_contents,
site_ssl_key_file_contents => $site_ssl_key_file_contents, site_ssl_key_file_contents => $site_ssl_key_file_contents,

View File

@ -21,6 +21,7 @@ class askbot::site::config (
$smtp_port, $smtp_port,
$solr_enabled, $solr_enabled,
$template_settings, $template_settings,
$akismet_api_key = undef,
) { ) {
case $db_provider { case $db_provider {

View File

@ -94,6 +94,11 @@ ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
# Make up some unique string, and don't share it with anybody. # Make up some unique string, and don't share it with anybody.
SECRET_KEY = '44fb9b7219e3743bffabb6861cbc9a28' 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. # List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (
'askbot.skins.loaders.Loader', 'askbot.skins.loaders.Loader',