Added CORS configuration to puppet-storyboard
Storyboard will soon support CORS, which is configured via storyboard.conf. This patch adds the two relevant properties to the puppet module, and makes them accessible in storyboard::application. Depends on https://review.openstack.org/#/c/124163/ Change-Id: I33a33076a18a9192b067a9f6f08d752ff8c22e3b
This commit is contained in:
parent
8c4feb93f8
commit
23410116c6
@ -8,6 +8,7 @@ description 'This module configures StoryBoard either as a standalone, localhost
|
||||
project_page 'https://github.com/openstack-ci/puppet-storyboard'
|
||||
|
||||
## Add dependencies, if any:
|
||||
dependency 'puppetlabs/stdlib', '= 3.2.0'
|
||||
dependency 'puppetlabs/mysql', '= 0.6.1'
|
||||
dependency 'puppetlabs/apache', '= 0.0.4'
|
||||
dependency 'puppetlabs/rabbitmq', '= 4.0.0'
|
||||
|
@ -25,6 +25,8 @@ class storyboard::application (
|
||||
$www_root = '/var/lib/storyboard/www',
|
||||
$server_admin = undef,
|
||||
$hostname = $::fqdn,
|
||||
$cors_allowed_origins = undef,
|
||||
$cors_max_age = 3600,
|
||||
|
||||
# storyboard.conf parameters
|
||||
$access_token_ttl = 3600,
|
||||
@ -48,6 +50,12 @@ class storyboard::application (
|
||||
$webclient_filename = 'storyboard-webclient-latest.tar.gz'
|
||||
$webclient_url = "http://tarballs.openstack.org/storyboard-webclient/${webclient_filename}"
|
||||
|
||||
if $cors_allowed_origins {
|
||||
$cors_allowed_origins_string = join($cors_allowed_origins, ',')
|
||||
} else {
|
||||
$cors_allowed_origins_string = undef
|
||||
}
|
||||
|
||||
# Dependencies
|
||||
require storyboard::params
|
||||
include apache
|
||||
|
@ -50,6 +50,18 @@ refresh_token_ttl = <%= @refresh_token_ttl %>
|
||||
# and subscriptions.
|
||||
enable_notifications = <%= @enable_notifications %>
|
||||
|
||||
<% if scope.lookupvar("storyboard::application::cors_allowed_origins_string") != :undef %>
|
||||
[cors]
|
||||
# W3C CORS configuration. For more information, see http://www.w3.org/TR/cors/
|
||||
|
||||
# List of permitted CORS domains.
|
||||
allowed_origins = <%= @cors_allowed_origins_string %>
|
||||
|
||||
# CORS browser options cache max age (in seconds)
|
||||
max_age=<%= @cors_max_age %>
|
||||
|
||||
<% end %>
|
||||
|
||||
[database]
|
||||
# This line MUST be changed to actually run storyboard
|
||||
# Example:
|
||||
|
Loading…
x
Reference in New Issue
Block a user