# Offense count: 27
# Configuration parameters: CountComments.
Metrics/BlockLength:
- Max: 356
+ Max: 359
# Offense count: 3
Metrics/CyclomaticComplexity:
~FC001
+~FC021
~FC064
~FC065
ports = new_resource.ssl_enabled ? [80, 443] : [80]
+ ssl_certificate new_resource.name do
+ domains [new_resource.name] + Array(new_resource.aliases)
+ only_if { new_resource.ssl_enabled }
+ end
+
apache_site new_resource.name do
cookbook "mediawiki"
template "apache.erb"
directory site_directory
variables :aliases => Array(new_resource.aliases),
:private => new_resource.private,
- :ports => ports,
- :ssl_certificate => new_resource.ssl_certificate,
- :ssl_certificate_chain => new_resource.ssl_certificate_chain
+ :ssl_enabled => new_resource.ssl_enabled,
+ :ports => ports
reload_apache false
end
attribute :admin_user, :kind_of => String, :default => "Admin"
attribute :admin_password, :kind_of => String, :required => true
attribute :ssl_enabled, :kind_of => [TrueClass, FalseClass], :default => false
-attribute :ssl_certificate, :kind_of => String
-attribute :ssl_certificate_chain, :kind_of => String
attribute :private_accounts, :kind_of => [TrueClass, FalseClass], :default => false
attribute :private, :kind_of => [TrueClass, FalseClass], :default => false
attribute :recaptcha_public_key, :kind_of => String
DocumentRoot <%= @directory %>
+<% if @ssl_enabled -%>
+ RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
+<% end -%>
+
php_admin_value open_basedir <%= @directory %>/:/usr/share/php/:/tmp/
#php_admin_value disable_functions "exec,shell_exec,system,passthru,popen,proc_open"
php_value memory_limit 128M
RewriteCond %{REQUEST_URI} !^/api\.php$
RewriteCond %{REQUEST_URI} !^/opensearch_desc\.php$
RewriteCond %{REQUEST_URI} !^/server-status
+ RewriteCond %{REQUEST_URI} !^/.well-known/
RewriteCond %{LA-U:REQUEST_FILENAME} !-f
RewriteCond %{LA-U:REQUEST_FILENAME} !-d
RewriteRule ^/(.*) /wiki/$1 [R,L]