Updated unified sample.env and setup default values to some variables

This commit is contained in:
jfederico
2017-08-14 20:26:43 +00:00
parent 582ab30eb0
commit ea5c78db47
6 changed files with 140 additions and 171 deletions

View File

@ -37,13 +37,13 @@ module Greenlight
config.i18n.fallbacks = {'en' => 'en-US'}
# BigBlueButton
config.bigbluebutton_endpoint = ENV['BIGBLUEBUTTON_ENDPOINT']
config.bigbluebutton_secret = ENV['BIGBLUEBUTTON_SECRET']
config.bigbluebutton_endpoint = ENV['BIGBLUEBUTTON_ENDPOINT'] || 'http://test-install.blindsidenetworks.com/bigbluebutton/'
config.bigbluebutton_secret = ENV['BIGBLUEBUTTON_SECRET'] || '8cd8ef52e8e101574e400365b55e11a6'
config.use_webhooks = ENV['GREENLIGHT_USE_WEBHOOKS'] == "true"
config.mail_notifications = ENV['GREENLIGHT_MAIL_NOTIFICATIONS'] == "true"
config.disable_guest_access = ENV['DISABLE_GUEST_ACCESS'] == "true"
config.enable_youtube_uploading = ENV['ENABLE_YOUTUBE_UPLOADING'] == "true"
config.use_webhooks = ENV['GREENLIGHT_USE_WEBHOOKS'] && ENV['GREENLIGHT_USE_WEBHOOKS'] == "true"
config.mail_notifications = ENV['GREENLIGHT_MAIL_NOTIFICATIONS'] && ENV['GREENLIGHT_MAIL_NOTIFICATIONS'] == "true"
config.disable_guest_access = ENV['DISABLE_GUEST_ACCESS'] && ENV['DISABLE_GUEST_ACCESS'] == "true"
config.enable_youtube_uploading = ENV['ENABLE_YOUTUBE_UPLOADING'] && ENV['ENABLE_YOUTUBE_UPLOADING'] == "true"
# SMTP and action mailer
if config.mail_notifications
@ -57,7 +57,7 @@ module Greenlight
config.smtp_starttls_auto = ENV['SMTP_STARTTLS_AUTO'].nil? ? true : ENV['SMTP_STARTTLS_AUTO']
config.smtp_tls = ENV['SMTP_TLS'].nil? ? false : ENV['SMTP_TLS']
config.action_mailer.default_url_options = { host: ENV['GREENLIGHT_DOMAIN'] }
config.action_mailer.default_url_options = { host: ENV['GREENLIGHT_DOMAIN'] || 'localhost' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true

View File

@ -23,14 +23,15 @@ rescue URI::InvalidURIError
false
end
if !ENV['SLACK_WEBHOOK'].nil? && !ENV['SLACK_WEBHOOK'].empty? && uri?(ENV['SLACK_WEBHOOK']) then
# Initialize the slack notifier.
Rails.application.config.slack_notifier = Slack::Notifier.new ENV['SLACK_WEBHOOK'] do
defaults channel: ENV['SLACK_CHANNEL'],
username: "BigBlueButton",
icon_url: 'https://avatars3.githubusercontent.com/u/230228?v=3&s=200'
end
else
if !ENV['SLACK_WEBHOOK'] || !ENV['SLACK_CHANNEL'] || !uri?(ENV['SLACK_WEBHOOK']) then
# Initialize it to nil (slack not configured)
Rails.application.config.slack_notifier = nil
return
end
# Initialize the slack notifier.
Rails.application.config.slack_notifier = Slack::Notifier.new ENV['SLACK_WEBHOOK'] do
defaults channel: ENV['SLACK_CHANNEL'],
username: "BigBlueButton",
icon_url: 'https://avatars3.githubusercontent.com/u/230228?v=3&s=200'
end