mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 11:44:02 +00:00
Drop Rails.application.secrets usage
That feature is gone and we already use environment variables... https://github.com/rails/rails/pull/47801
This commit is contained in:
parent
4ec9aee5da
commit
ddcd8dfc69
7 changed files with 9 additions and 89 deletions
|
|
@ -14,11 +14,6 @@ module UsersHelper
|
||||||
|
|
||||||
providers = []
|
providers = []
|
||||||
Devise.omniauth_providers.each do |provider|
|
Devise.omniauth_providers.each do |provider|
|
||||||
provider_key = "#{provider}_key"
|
|
||||||
provider_secret = "#{provider}_secret"
|
|
||||||
unless Rails.application.secrets.send(provider_key).blank? || Rails.application.secrets.send(provider_secret).blank?
|
|
||||||
providers << provider
|
|
||||||
end
|
|
||||||
providers << provider if ENV.fetch("OSEM_#{provider.upcase}_KEY", nil).present? && ENV.fetch("OSEM_#{provider.upcase}_SECRET", nil).present?
|
providers << provider if ENV.fetch("OSEM_#{provider.upcase}_KEY", nil).present? && ENV.fetch("OSEM_#{provider.upcase}_SECRET", nil).present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,5 +23,5 @@
|
||||||
%script.stripe-button{ src: "https://checkout.stripe.com/checkout.js",
|
%script.stripe-button{ src: "https://checkout.stripe.com/checkout.js",
|
||||||
data: { amount: @total_amount_to_pay.cents, label: "Pay #{humanized_money_with_symbol @total_amount_to_pay}",
|
data: { amount: @total_amount_to_pay.cents, label: "Pay #{humanized_money_with_symbol @total_amount_to_pay}",
|
||||||
email: current_user.email, currency: @total_amount_to_pay.currency, name: ENV.fetch('OSEM_NAME', 'OSEM'),
|
email: current_user.email, currency: @total_amount_to_pay.currency, name: ENV.fetch('OSEM_NAME', 'OSEM'),
|
||||||
description: "book your tickets", key: Rails.application.secrets.stripe_publishable_key, locale: "auto"}}
|
description: "book your tickets", key: ENV.fetch('STRIPE_PUBLISHABLE_KEY'), locale: "auto"}}
|
||||||
= link_to 'Edit Purchase', conference_tickets_path(@conference.short_title), class: 'btn btn-default'
|
= link_to 'Edit Purchase', conference_tickets_path(@conference.short_title), class: 'btn btn-default'
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,9 @@ Devise.setup do |config|
|
||||||
# Pass each provider to User model in :omniauth_providers (for open_id providers use their name)
|
# Pass each provider to User model in :omniauth_providers (for open_id providers use their name)
|
||||||
|
|
||||||
config.omniauth :open_id, name: 'suse', identifier: 'http://www.opensuse.org/openid/user'
|
config.omniauth :open_id, name: 'suse', identifier: 'http://www.opensuse.org/openid/user'
|
||||||
config.omniauth :google_oauth2, ENV.fetch('OSEM_GOOGLE_KEY', Rails.application.secrets.google_key), ENV.fetch('OSEM_GOOGLE_SECRET', Rails.application.secrets.google_secret),
|
config.omniauth :google_oauth2, ENV.fetch('OSEM_GOOGLE_KEY', nil), ENV.fetch('OSEM_GOOGLE_SECRET', nil), name: 'google', scope: 'email'
|
||||||
name: 'google',
|
config.omniauth :facebook, ENV.fetch('OSEM_FACEBOOK_KEY', nil), ENV.fetch('OSEM_FACEBOOK_SECRET', nil)
|
||||||
scope: 'email'
|
config.omniauth :github, ENV.fetch('OSEM_GITHUB_KEY', nil), ENV.fetch('OSEM_GITHUB_SECRET', nil)
|
||||||
config.omniauth :facebook, ENV.fetch('OSEM_FACEBOOK_KEY', Rails.application.secrets.facebook_key), ENV.fetch('OSEM_FACEBOOK_SECRET', Rails.application.secrets.facebook_secret)
|
|
||||||
config.omniauth :github, ENV.fetch('OSEM_GITHUB_KEY', Rails.application.secrets.github_key), ENV.fetch('OSEM_GITHUB_SECRET', Rails.application.secrets.github_secret)
|
|
||||||
|
|
||||||
# ==> Mailer Configuration
|
# ==> Mailer Configuration
|
||||||
# Configure the e-mail address which will be shown in Devise::Mailer,
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
Sentry.init do |config|
|
Sentry.init do |config|
|
||||||
config.dsn = ENV.fetch('OSEM_SENTRY_DSN', Rails.application.secrets.sentry_dsn)
|
config.dsn = ENV.fetch('OSEM_SENTRY_DSN', nil)
|
||||||
config.breadcrumbs_logger = [:active_support_logger]
|
config.breadcrumbs_logger = [:active_support_logger]
|
||||||
|
|
||||||
# To activate performance monitoring, set one of these options.
|
# To activate performance monitoring, set one of these options.
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Stripe.api_key = Rails.application.secrets.stripe_secret_key
|
Stripe.api_key = ENV.fetch('STRIPE_SECRET_KEY', nil)
|
||||||
|
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
development:
|
|
||||||
# Generate your own with rake secret
|
|
||||||
# secret_key_base: '12345'
|
|
||||||
|
|
||||||
########## OMNIAUTH Providers ##########
|
|
||||||
# This is just sample data so mocks work
|
|
||||||
google_key: 'sample'
|
|
||||||
google_secret: 'sample'
|
|
||||||
|
|
||||||
facebook_key: 'sample'
|
|
||||||
facebook_secret: 'sample'
|
|
||||||
|
|
||||||
suse_key: 'sample'
|
|
||||||
suse_secret: 'sample'
|
|
||||||
|
|
||||||
# Register on stripe and add TEST keys here
|
|
||||||
# https://dashboard.stripe.com/account/apikeys
|
|
||||||
stripe_publishable_key: <%= ENV['STRIPE_PUBLISHABLE_KEY'] %>
|
|
||||||
stripe_secret_key: <%= ENV['STRIPE_SECRET_KEY'] %>
|
|
||||||
|
|
||||||
test:
|
|
||||||
# Generate your own with rake secret
|
|
||||||
# secret_key_base: '12345'
|
|
||||||
|
|
||||||
# Register on stripe and add TEST keys here
|
|
||||||
# https://dashboard.stripe.com/account/apikeys
|
|
||||||
stripe_publishable_key: <%= ENV['STRIPE_PUBLISHABLE_KEY'] %>
|
|
||||||
stripe_secret_key: <%= ENV['STRIPE_SECRET_KEY'] %>
|
|
||||||
|
|
||||||
production:
|
|
||||||
# Generate your own with rake secret or use the environment
|
|
||||||
# secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
|
||||||
|
|
||||||
# Your sentry.io DSN key
|
|
||||||
# sentry_dsn: '12345'
|
|
||||||
|
|
||||||
########## OMNIAUTH Providers ##########
|
|
||||||
# Leave the variables' names empty, unless you use the providers, in which
|
|
||||||
# case you need to register your applicaton and add the actual keys.
|
|
||||||
#
|
|
||||||
# If you add a provider, keep the format of the variables:
|
|
||||||
# *provider*_key and *provider*_secret
|
|
||||||
|
|
||||||
# If you add a provider that does not require a key, you still have to
|
|
||||||
# create the 2 variables with sample data or they won't show up in the app.
|
|
||||||
|
|
||||||
# Register your appllication with Google from
|
|
||||||
# https://code.google.com/apis/console#:access
|
|
||||||
google_key: ''
|
|
||||||
google_secret: ''
|
|
||||||
|
|
||||||
# Register your application with Facebook from
|
|
||||||
# https://developers.facebook.com/
|
|
||||||
facebook_key: ''
|
|
||||||
facebook_secret: ''
|
|
||||||
|
|
||||||
# Developers do not need to register their application for suse account to
|
|
||||||
# work. You must, however, add some sample value to the variables, for the
|
|
||||||
# login option to appear. For example:
|
|
||||||
#suse_key: 'sample data'
|
|
||||||
#suse_secret: 'sample data'
|
|
||||||
suse_key: ''
|
|
||||||
suse_secret: ''
|
|
||||||
|
|
||||||
# Register your application with GitHub from
|
|
||||||
# https://github.com/settings/applications
|
|
||||||
github_key: ''
|
|
||||||
github_secret: ''
|
|
||||||
|
|
||||||
# Register on stripe and add LIVE keys here
|
|
||||||
# https://dashboard.stripe.com/account/apikeys
|
|
||||||
stripe_publishable_key: <%= ENV['STRIPE_PUBLISHABLE_KEY'] %>
|
|
||||||
stripe_secret_key: <%= ENV['STRIPE_SECRET_KEY'] %>
|
|
||||||
|
|
@ -42,7 +42,7 @@ feature Registration do
|
||||||
purchase = TicketPurchase.where(user_id: participant.id, ticket_id: ticket.id).first
|
purchase = TicketPurchase.where(user_id: participant.id, ticket_id: ticket.id).first
|
||||||
expect(purchase.quantity).to eq(2)
|
expect(purchase.quantity).to eq(2)
|
||||||
|
|
||||||
if Rails.application.secrets.stripe_publishable_key
|
if ENV.fetch('STRIPE_PUBLISHABLE_KEY', nil)
|
||||||
find('.stripe-button-el').click
|
find('.stripe-button-el').click
|
||||||
|
|
||||||
stripe_iframe = all('iframe[name=stripe_checkout_app]').last
|
stripe_iframe = all('iframe[name=stripe_checkout_app]').last
|
||||||
|
|
@ -81,7 +81,7 @@ feature Registration do
|
||||||
purchase = TicketPurchase.where(user_id: participant.id, ticket_id: ticket.id).first
|
purchase = TicketPurchase.where(user_id: participant.id, ticket_id: ticket.id).first
|
||||||
expect(purchase.quantity).to eq(2)
|
expect(purchase.quantity).to eq(2)
|
||||||
|
|
||||||
if Rails.application.secrets.stripe_publishable_key
|
if ENV.fetch('STRIPE_PUBLISHABLE_KEY', nil)
|
||||||
find('.stripe-button-el').click
|
find('.stripe-button-el').click
|
||||||
|
|
||||||
stripe_iframe = all('iframe[name=stripe_checkout_app]').last
|
stripe_iframe = all('iframe[name=stripe_checkout_app]').last
|
||||||
|
|
@ -172,7 +172,7 @@ feature Registration do
|
||||||
purchase = TicketPurchase.where(user_id: participant.id, ticket_id: ticket.id).first
|
purchase = TicketPurchase.where(user_id: participant.id, ticket_id: ticket.id).first
|
||||||
expect(purchase.quantity).to eq(2)
|
expect(purchase.quantity).to eq(2)
|
||||||
|
|
||||||
if Rails.application.secrets.stripe_publishable_key
|
if ENV.fetch('STRIPE_PUBLISHABLE_KEY', nil)
|
||||||
find('.stripe-button-el').click
|
find('.stripe-button-el').click
|
||||||
|
|
||||||
stripe_iframe = all('iframe[name=stripe_checkout_app]').last
|
stripe_iframe = all('iframe[name=stripe_checkout_app]').last
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue