Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
Adjust to load ENVs
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed Apr 16, 2021
1 parent aeea6c4 commit f389da1
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 51 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ gem 'wkhtmltopdf-binary', '~> 0.12.3'
gem 'rails_autoscale_agent', '~> 0.3.1'

group :development, :test do
gem 'byebug'
gem 'listen', '~> 3.0.5'

gem 'spring'
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ GEM
aws-sigv4 (1.0.3)
bootsnap (1.3.2)
msgpack (~> 1.0)
bugsnag (6.10.0)
bugsnag (6.20.0)
concurrent-ruby (~> 1.0)
builder (3.2.4)
byebug (10.0.2)
Expand All @@ -92,10 +92,10 @@ GEM
docile (1.3.1)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.5.0)
dotenv-rails (2.5.0)
dotenv (= 2.5.0)
railties (>= 3.2, < 6.0)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
email_spec (2.2.0)
htmlentities (~> 4.3.3)
launchy (~> 2.1)
Expand Down
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true


require_relative 'boot'

require 'rails'
Expand All @@ -19,6 +20,8 @@
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

Dotenv::Railtie.load

module Api
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
Expand Down
92 changes: 46 additions & 46 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,85 +11,85 @@
# if you're sharing your code publicly.

common: &common
bugsnag_api_key: <%= ENV.fetch("BUGSNAG_API_KEY") %>
bugsnag_api_key: <%= ENV["BUGSNAG_API_KEY"] %>

action_mailer_default_host: <%= ENV.fetch("ACTION_MAILER_DEFAULT_HOST") %>
smtp_address: <%= ENV.fetch("SMTP_ADDRESS") %>
smtp_port: <%= ENV.fetch("SMTP_PORT") %>
smtp_username: <%= ENV.fetch("SMTP_USERNAME") %>
smtp_password: <%= ENV.fetch("SMTP_PASSWORD") %>
smtp_domain: <%= ENV.fetch("SMTP_DOMAIN") %>
action_mailer_default_host: <%= ENV["ACTION_MAILER_DEFAULT_HOST"] %>
smtp_address: <%= ENV["SMTP_ADDRESS"] %>
smtp_port: <%= ENV["SMTP_PORT"] %>
smtp_username: <%= ENV["SMTP_USERNAME"] %>
smtp_password: <%= ENV["SMTP_PASSWORD"] %>
smtp_domain: <%= ENV["SMTP_DOMAIN"] %>

google_maps_api_key: <%= ENV.fetch("GOOGLE_MAPS_API_KEY") %>
google_maps_api_key: <%= ENV["GOOGLE_MAPS_API_KEY"] %>

streak_api_key: <%= ENV.fetch("STREAK_API_KEY") %>
streak_club_pipeline_key: <%= ENV.fetch("STREAK_CLUB_PIPELINE_KEY") %>
streak_club_applications_pipeline_key: <%= ENV.fetch("STREAK_CLUB_APPLICATIONS_PIPELINE_KEY") %>
streak_leader_pipeline_key: <%= ENV.fetch("STREAK_LEADER_PIPELINE_KEY") %>
streak_letter_pipeline_key: <%= ENV.fetch("STREAK_LETTER_PIPELINE_KEY") %>
streak_fundraising_pipeline_key: <%= ENV.fetch("STREAK_FUNDRAISING_PIPELINE_KEY") %>
streak_api_key: <%= ENV["STREAK_API_KEY"] %>
streak_club_pipeline_key: <%= ENV["STREAK_CLUB_PIPELINE_KEY"] %>
streak_club_applications_pipeline_key: <%= ENV["STREAK_CLUB_APPLICATIONS_PIPELINE_KEY"] %>
streak_leader_pipeline_key: <%= ENV["STREAK_LEADER_PIPELINE_KEY"] %>
streak_letter_pipeline_key: <%= ENV["STREAK_LETTER_PIPELINE_KEY"] %>
streak_fundraising_pipeline_key: <%= ENV["STREAK_FUNDRAISING_PIPELINE_KEY"] %>

cloud9_username: <%= ENV.fetch("CLOUD9_USERNAME") %>
cloud9_password: <%= ENV.fetch("CLOUD9_PASSWORD") %>
cloud9_team_name: <%= ENV.fetch("CLOUD9_TEAM_NAME") %>
cloud9_username: <%= ENV["CLOUD9_USERNAME"] %>
cloud9_password: <%= ENV["CLOUD9_PASSWORD"] %>
cloud9_team_name: <%= ENV["CLOUD9_TEAM_NAME"] %>

segment_write_key: <%= ENV.fetch("SEGMENT_WRITE_KEY") %>
segment_write_key: <%= ENV["SEGMENT_WRITE_KEY"] %>

# For Athul
athul_auth_token: <%= ENV.fetch("ATHUL_AUTH_TOKEN") %>
athul_auth_token: <%= ENV["ATHUL_AUTH_TOKEN"] %>

# For outreach:teacher_emails tasks
streak_outreach_school_pipeline_key: <%= ENV.fetch("STREAK_OUTREACH_SCHOOL_PIPELINE_KEY") %>
streak_outreach_teacher_pipeline_key: <%= ENV.fetch("STREAK_OUTREACH_TEACHER_PIPELINE_KEY") %>
streak_outreach_school_pipeline_key: <%= ENV["STREAK_OUTREACH_SCHOOL_PIPELINE_KEY"] %>
streak_outreach_teacher_pipeline_key: <%= ENV["STREAK_OUTREACH_TEACHER_PIPELINE_KEY"] %>

# For RecordSlackStatsJob
slack_admin_email: <%= ENV.fetch("SLACK_ADMIN_EMAIL") %>
slack_admin_password: <%= ENV.fetch("SLACK_ADMIN_PASSWORD") %>
slack_admin_email: <%= ENV["SLACK_ADMIN_EMAIL"] %>
slack_admin_password: <%= ENV["SLACK_ADMIN_PASSWORD"] %>

# This is quoted because Slack's client ID has a period in it.
slack_client_id: "<%= ENV.fetch('SLACK_CLIENT_ID') %>"
slack_client_secret: <%= ENV.fetch("SLACK_CLIENT_SECRET") %>
default_slack_team_id: <%= ENV.fetch("DEFAULT_SLACK_TEAM_ID") %>
slack_client_id: "<%= ENV['SLACK_CLIENT_ID'] %>"
slack_client_secret: <%= ENV["SLACK_CLIENT_SECRET"] %>
default_slack_team_id: <%= ENV["DEFAULT_SLACK_TEAM_ID"] %>

tech_domain_redemption_secret_code: <%= ENV.fetch("TECH_DOMAIN_REDEMPTION_SECRET_CODE") %>
tech_domain_redemption_secret_code: <%= ENV["TECH_DOMAIN_REDEMPTION_SECRET_CODE"] %>

guggy_api_key: <%= ENV.fetch("GUGGY_API_KEY") %>
guggy_api_key: <%= ENV["GUGGY_API_KEY"] %>

default_streak_task_assignee: <%= ENV.fetch("DEFAULT_STREAK_TASK_ASSIGNEE") %>
default_streak_task_assignee: <%= ENV["DEFAULT_STREAK_TASK_ASSIGNEE"] %>

hackbot_mirror_channel_id: <%= ENV.fetch("HACKBOT_MIRROR_CHANNEL_ID") %>
hackbot_admins: <%= ENV.fetch("HACKBOT_ADMINS").split(",") %>
hackbot_mirror_channel_id: <%= ENV["HACKBOT_MIRROR_CHANNEL_ID"] %>
hackbot_admins: <%= ENV["HACKBOT_ADMINS"].present? ? ENV["HACKBOT_ADMINS"].split(",") : ENV["HACKBOT_ADMINS"] %>

# This is for the DemoCheckIn interaction
streak_demo_user_box_key: <%= ENV.fetch("STREAK_DEMO_USER_BOX_KEY") %>
streak_demo_user_box_key: <%= ENV["STREAK_DEMO_USER_BOX_KEY"] %>

github_bot_access_token: <%= ENV.fetch("GITHUB_BOT_ACCESS_TOKEN") %>
github_bot_access_token: <%= ENV["GITHUB_BOT_ACCESS_TOKEN"] %>

slack_admin_access_token: <%= ENV.fetch("SLACK_ADMIN_ACCESS_TOKEN") %>
slack_admin_access_token: <%= ENV["SLACK_ADMIN_ACCESS_TOKEN"] %>

repo_files_root: vendor/hackclub
stripe_publishable_key: <%= ENV.fetch("STRIPE_PUBLISHABLE_KEY") %>
stripe_secret_key: <%= ENV.fetch("STRIPE_SECRET_KEY") %>
stripe_publishable_key: <%= ENV["STRIPE_PUBLISHABLE_KEY"] %>
stripe_secret_key: <%= ENV["STRIPE_SECRET_KEY"] %>

channels_to_clear: <%= ENV.fetch("CHANNELS_TO_CLEAR") %>
channels_to_clear: <%= ENV["CHANNELS_TO_CLEAR"] %>

sidekiq_http_username: <%= ENV.fetch("SIDEKIQ_HTTP_USERNAME") %>
sidekiq_http_password: <%= ENV.fetch("SIDEKIQ_HTTP_PASSWORD") %>
sidekiq_http_username: <%= ENV["SIDEKIQ_HTTP_USERNAME"] %>
sidekiq_http_password: <%= ENV["SIDEKIQ_HTTP_PASSWORD"] %>

# ActiveStorage backend
s3_access_key_id: <%= ENV.fetch("S3_ACCESS_KEY_ID") %>
s3_secret_access_key: <%= ENV.fetch("S3_SECRET_ACCESS_KEY") %>
s3_region: <%= ENV.fetch("S3_REGION") %>
s3_bucket: <%= ENV.fetch("S3_BUCKET") %>
s3_access_key_id: <%= ENV["S3_ACCESS_KEY_ID"] %>
s3_secret_access_key: <%= ENV["S3_SECRET_ACCESS_KEY"] %>
s3_region: <%= ENV["S3_REGION"] %>
s3_bucket: <%= ENV["S3_BUCKET"] %>

# URL to trigger rebuilds of https://hackathons.hackclub.com from Netlify
hackathons_site_rebuild_hook: <%= ENV.fetch("HACKATHONS_SITE_REBUILD_HOOK") %>
hackathons_site_rebuild_hook: <%= ENV["HACKATHONS_SITE_REBUILD_HOOK"] %>

# Screenshotlayer API Key
screenshotlayer_api_key: <%= ENV.fetch("SCREENSHOTLAYER_API_KEY") %>
screenshotlayer_api_key: <%= ENV["SCREENSHOTLAYER_API_KEY"] %>

# MLH Local Hack Day API Key
mlh_lhd_api_key: <%= ENV.fetch("MLH_LHD_API_KEY") %>
mlh_lhd_api_key: <%= ENV["MLH_LHD_API_KEY"] %>

development:
<<: *common
Expand Down

0 comments on commit f389da1

Please sign in to comment.