docbrown/Envfile
Vaidehi Joshi f71c8b16e7
Allow dynamic authoring of welcome notifications (#6045) [deploy]
* Add "Welcome" type to Broadcasts, allow dynamic "authoring" of Broadcasts

This adds a new `type_of` to the Broadcast model: "Welcome". As we begin to create a new "welcome notification" workflow, we'll categorize them by making them all of the same type.

This also adds a concept of a "welcoming user", which can be set via an ENV var. The WELCOMING_USER_ID will allow us to explicitly set (and change) which user in the database is the one that "sends" welcoming notification. In production, we plan for this to be dev.to/sloan.

* Allow WelcomeNotificationWorker to accept + send any kind of broadcast

This abstracts out the logic of deciding which broadcast to send from the woker into the calling method. This will help us send many different kinds of welcome notifications using one, resuable worker class.

* Raise if a Notification can't be created

* Add STAFF_USER_ID as an ENV var

This is in preparation for moving away from SiteConfig.staff_user_id, and replacing it with an ENV var. We will need to set this in production first, and then make a separate PR to replace all instances of staff_user_id with the newly-set ENV var.
2020-02-12 13:50:37 -08:00

185 lines
7.1 KiB
Text

# Most of the things are optional. If you need to use a
# custom key, please create an application.yml for it
enable_defaults! { ENV["RACK_ENV"] != "production" }
################################################
############## Basic configuration #############
################################################
# App domain + Protocol setting for development
variable :APP_DOMAIN, :String, default: "localhost:3000"
variable :APP_PROTOCOL, :String, default: "http://"
variable :COMMUNITY_NAME, :String, default: "DEV(local)"
# Service timeout length
variable :RACK_TIMEOUT_WAIT_TIMEOUT, :Integer, default: 100_000
variable :RACK_TIMEOUT_SERVICE_TIMEOUT, :Integer, default: 100_000
# Heroku release slug used to bust caches on deploys
variable :HEROKU_SLUG_COMMIT, :String, default: "Optional"
# Redis caching storage
variable :REDIS_URL, :String, default: "redis://localhost:6379"
# Redis sessions storage
variable :REDIS_SESSIONS_URL, :String, default: "redis://localhost:6379"
variable :SESSION_KEY, :String, default: "_Dev_Community_Session"
variable :SESSION_EXPIRY_SECONDS, :Integer, default: 1209600 # two weeks in seconds
# Redis Sidekiq storage
variable :REDIS_SIDEKIQ_URL, :String, default: "redis://localhost:6379"
# Elasticsearch
variable :ELASTICSEARCH_URL, :String, default: "http://localhost:9200"
################################################
############## 3rd Party Services ##############
################################################
# It's best if you have the following configured
# for more development experience
# Github for github related access
# (https://developer.github.com/v3/guides/basics-of-authentication/)
variable :GITHUB_KEY, :String, default: "Optional"
variable :GITHUB_SECRET, :String, default: "Optional"
# Twitter for normal twitter access
# (https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens)
variable :TWITTER_KEY, :String, default: "Optional"
variable :TWITTER_SECRET, :String, default: "Optional"
################################################
######### Optional 3rd Party Services ##########
################################################
# Honeybadger for error tracking
# (https://docs.honeybadger.io/lib/ruby/getting-started/introduction.html)
variable :HONEYBADGER_API_KEY, :String, default: "Optional"
variable :HONEYBADGER_JS_API_KEY, :String, default: "Optional"
# Algolia for search (not optional)
# (https://www.algolia.com/doc/)
only_in_test = proc { ENV["RACK_ENV"] == "test" ? "test-test" : nil }
variable :ALGOLIASEARCH_API_KEY, :String, default: only_in_test
variable :ALGOLIASEARCH_APPLICATION_ID, :String, default: only_in_test
variable :ALGOLIASEARCH_SEARCH_ONLY_KEY, :String, default: only_in_test
# AWS for images storages
variable :AWS_ID, :String, default: "Optional"
variable :AWS_SECRET, :String, default: "Optional"
variable :AWS_BUCKET_NAME, :String, default: "Optional"
variable :AWS_UPLOAD_REGION, :String, default: ""
# AWS SDK
# (https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/setup-config.html)
variable :AWS_DEFAULT_REGION, :String, default: "us-east-1"
variable :AWS_SDK_KEY, :String, default: "Optional"
variable :AWS_SDK_SECRET, :String, default: "Optional"
# AWS for video storage
variable :AWS_S3_INPUT_BUCKET, :String, default: "Optional"
variable :AWS_S3_VIDEO_ID, :String, default: "Optional"
variable :AWS_S3_VIDEO_KEY, :String, default: "Optional"
# Buffer for sending to buffer
# (https://buffer.com/developers/api)
variable :BUFFER_ACCESS_TOKEN, :String, default: "Optional"
variable :BUFFER_FACEBOOK_ID, :String, default: "Optional"
variable :BUFFER_LINKEDIN_ID, :String, default: "Optional"
variable :BUFFER_PROFILE_ID, :Integer, default: 0
variable :BUFFER_TWITTER_ID, :String, default: "Optional"
variable :BUFFER_LISTINGS_PROFILE, :String, default: "Optional"
# Cloudinary for image resizing and cache??
# (https://cloudinary.com/documentation/rails_integration)
variable :CLOUDINARY_API_KEY, :String, default: "Optional"
variable :CLOUDINARY_API_SECRET, :String, default: "Optional"
variable :CLOUDINARY_CLOUD_NAME, :String, default: "Optional"
variable :CLOUDINARY_SECURE, :String, default: "Optional"
# HTML/CSS to Image for generating social preview images
# (https://docs.htmlcsstoimage.com/example-code/ruby)
variable :HCTI_API_USER_ID, :String, default: "Optional"
variable :HCTI_API_KEY, :String, default: "Optional"
# Fastly for edge caching
# (https://docs.fastly.com/api/)
variable :FASTLY_API_KEY, :String, default: "Optional"
variable :FASTLY_SERVICE_ID, :String, default: "Optional"
# Honeycomb for monitoring and observability
# (https://www.honeycomb.io/)
variable :HONEYCOMB_API_KEY, :String, default: ""
# Google analytic
# (https://developers.google.com/analytics/devguides/reporting/core/v4)
variable :GA_SERVICE_ACCOUNT_JSON, :String, default: "Optional"
variable :GA_TRACKING_ID, :String, default: "Optional"
# Mailchimp for mails
# (https://mailchimp.com/developer/)
variable :MAILCHIMP_API_KEY, :String, default: "Optional-valid"
# Pusher for DEV Connect/notfications
# (https://pusher.com/docs)
variable :PUSHER_APP_ID, :String, default: "Optional"
variable :PUSHER_CLUSTER, :String, default: "Optional"
variable :PUSHER_KEY, :String, default: "Optional"
variable :PUSHER_SECRET, :String, default: "Optional"
variable :PUSHER_BEAMS_ID, :String, default: "Optional"
variable :PUSHER_BEAMS_KEY, :String, default: "Optional"
# Google recaptcha
# (https://developers.google.com/recaptcha/intro)
variable :RECAPTCHA_SECRET, :String, default: "Optional"
variable :RECAPTCHA_SITE, :String, default: "Optional"
# Slack for customer alerts
# (https://api.slack.com/)
variable :SLACK_CHANNEL, :String, default: ""
variable :SLACK_WEBHOOK_URL, :String, default: ""
# Stripe for payment system
# (https://stripe.com/docs/api)
variable :STRIPE_PUBLISHABLE_KEY, :String, default: "Optional"
variable :STRIPE_SECRET_KEY, :String, default: "Optional"
variable :STRIPE_CANCELLATION_SECRET, :String, default: "Optional"
# For video calling in DEV Connect
# (https://www.twilio.com/docs/video)
variable :TWILIO_ACCOUNT_SID, :String, default: "Optional"
variable :TWILIO_VIDEO_API_KEY, :String, default: "Optional"
variable :TWILIO_VIDEO_API_SECRET, :String, default: "Optional"
# For Twitch live stream integration
# (https://dev.twitch.tv/docs)
variable :TWITCH_CLIENT_ID, :String, default: "Optional"
variable :TWITCH_CLIENT_SECRET, :String, default: "Optional"
variable :TWITCH_WEBHOOK_SECRET, :String, default: "Optional"
# For calling the Stack Exchange API
# (https://api.stackexchange.com/docs)
variable :STACK_EXCHANGE_APP_KEY, :String, default: ""
# For setting the IDs of the staff and welcoming users
variable :STAFF_USER_ID, :Integer, default: 1
variable :WELCOMING_USER_ID, :Integer, default: 1
group :production do
variable :SECRET_KEY_BASE, :String
# Timber
# (https://docs.timber.io/)
variable :SEND_LOGS_TO_TIMBER, :String # Defaults to true in production, false in development
variable :TIMBER, :String # Only required if above is "true" or unset
# Sendgrid
# (https://sendgrid.com/docs/API_Reference/api_v3.html)
variable :SENDGRID_USERNAME_ACCEL, :String
variable :SENDGRID_PASSWORD_ACCEL, :String
# Heroku
variable :HEROKU_APP_URL, :String # practicaldev.herokuapp.com
end