Generalized logs and mailer (#312)

This commit is contained in:
Jesus Federico 2018-10-26 11:59:49 -04:00 committed by GitHub
parent b8785a3bf8
commit 3b67ffee40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 23 deletions

View File

@ -55,19 +55,16 @@ module Greenlight
config.bigbluebutton_secret_default = "8cd8ef52e8e101574e400365b55e11a6" config.bigbluebutton_secret_default = "8cd8ef52e8e101574e400365b55e11a6"
# Use standalone BigBlueButton server. # Use standalone BigBlueButton server.
config.bigbluebutton_endpoint = ENV["BIGBLUEBUTTON_ENDPOINT"] config.bigbluebutton_endpoint = ENV["BIGBLUEBUTTON_ENDPOINT"] || config.bigbluebutton_endpoint_default
config.bigbluebutton_secret = ENV["BIGBLUEBUTTON_SECRET"] config.bigbluebutton_secret = ENV["BIGBLUEBUTTON_SECRET"] || config.bigbluebutton_secret_default
# Fallback to testing credentails.
if config.bigbluebutton_endpoint.blank?
config.bigbluebutton_endpoint = config.bigbluebutton_endpoint_default
config.bigbluebutton_secret = config.bigbluebutton_secret_default
end
# Fix endpoint format if required. # Fix endpoint format if required.
config.bigbluebutton_endpoint += "api/" unless config.bigbluebutton_endpoint.ends_with?('api/') config.bigbluebutton_endpoint += "api/" unless config.bigbluebutton_endpoint.ends_with?('api/')
end end
# Specify the email address that all mail is sent from
config.email_sender = ENV['EMAIL_SENDER'].present? ? ENV['EMAIL_SENDER'] : "notifications@example.com"
# Determine if GreenLight should enable email verification # Determine if GreenLight should enable email verification
config.enable_email_verification = (ENV['ALLOW_MAIL_NOTIFICATIONS'] == "true") config.enable_email_verification = (ENV['ALLOW_MAIL_NOTIFICATIONS'] == "true")

View File

@ -28,8 +28,8 @@ Rails.application.configure do
config.cache_store = :null_store config.cache_store = :null_store
end end
# Tell Action Mailer to use smtp server # Tell Action Mailer to use smtp server, if configured
config.action_mailer.delivery_method = :smtp config.action_mailer.delivery_method = ENV['SMTP_SERVER'].present? ? :smtp : :sendmail
ActionMailer::Base.smtp_settings = { ActionMailer::Base.smtp_settings = {
address: ENV['SMTP_SERVER'], address: ENV['SMTP_SERVER'],

View File

@ -54,8 +54,8 @@ Rails.application.configure do
# Use a different cache store in production. # Use a different cache store in production.
# config.cache_store = :mem_cache_store # config.cache_store = :mem_cache_store
# Tell Action Mailer to use smtp server # Tell Action Mailer to use smtp server, if configured
config.action_mailer.delivery_method = :smtp config.action_mailer.delivery_method = ENV['SMTP_SERVER'].present? ? :smtp : :sendmail
ActionMailer::Base.smtp_settings = { ActionMailer::Base.smtp_settings = {
address: ENV['SMTP_SERVER'], address: ENV['SMTP_SERVER'],

View File

@ -5,10 +5,15 @@ services:
entrypoint: [bin/start] entrypoint: [bin/start]
image: bigbluebutton/greenlight:v2 image: bigbluebutton/greenlight:v2
container_name: greenlight-v2 container_name: greenlight-v2
env_file: env env_file: .env
restart: unless-stopped restart: unless-stopped
ports: ports:
- 5000:80 - 5000:80
volumes: volumes:
- ./db/production:/usr/src/app/db/production - ./db/production:/usr/src/app/db/production
- ./log:/usr/src/app/log - ./log:/usr/src/app/log
# logging:
# driver: $LOG_DRIVER
# options:
# syslog-address: $LOG_ADDRESS
# tag: $LOG_TAG

View File

@ -73,9 +73,11 @@ ALLOW_GREENLIGHT_ACCOUNTS=true
# Set this to true if you want GreenLight to send verification emails upon # Set this to true if you want GreenLight to send verification emails upon
# the creation of a new account # the creation of a new account
# #
# SMTP variables can be configured by following the template:
#
# ALLOW_MAIL_NOTIFICATIONS=true # ALLOW_MAIL_NOTIFICATIONS=true
#
# The notifications are sent using sendmail, unless the SMTP_SERVER variable is set.
# In that case, make sure the rest of the variables are properly set.
#
# SMTP_SERVER=smtp.gmail.com # SMTP_SERVER=smtp.gmail.com
# SMTP_PORT=587 # SMTP_PORT=587
# SMTP_DOMAIN=gmail.com # SMTP_DOMAIN=gmail.com
@ -84,7 +86,6 @@ ALLOW_GREENLIGHT_ACCOUNTS=true
# SMTP_AUTH=plain # SMTP_AUTH=plain
# SMTP_STARTTLS_AUTO=true # SMTP_STARTTLS_AUTO=true
# #
ALLOW_MAIL_NOTIFICATIONS=
SMTP_SERVER= SMTP_SERVER=
SMTP_PORT= SMTP_PORT=
SMTP_DOMAIN= SMTP_DOMAIN=
@ -110,17 +111,24 @@ BRANDING_IMAGE=
# #
# RAILS_LOG_TO_STDOUT=true # RAILS_LOG_TO_STDOUT=true
# #
# When using docker-compose the logs can be sent to an external service like PaperTrail # When using docker-compose the logs can be sent to an centralized repository like PaperTrail
# just by using the built in driver. Make sure to add to docker-compose.yml the next lines: # just by using the built in driver. Make sure to add to docker-compose.yml the next lines:
# #
# logging: # logging:
# driver: syslog # driver: $LOG_DRIVER
# options: # options:
# syslog-address: "tcp+tls://logs4.papertrailapp.com:[99999]" # syslog-address: $LOG_ADDRESS
# tag: greenlight.mydomain.com:v2 # tag: $LOG_TAG
# #
# And set this variables up:
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. #
# It is disabled by default. # LOG_DRIVER=syslog
# LOG_ADDRESS=udp://logs4.papertrailapp.com:[99999]
# LOG_TAG=greenlight.example.com:v2
#
# Check docker-compose and papertrail documentation for encrypting and
# protecting access to the log repository.
# https://docs.docker.com/config/containers/logging/syslog/#options
# https://help.papertrailapp.com/kb/configuration/encrypting-remote-syslog-with-tls-ssl/
# #
# ENABLE_SSL=true # ENABLE_SSL=true