Skip to content

Commit

Permalink
Refractor/tomato to sofia (#947)
Browse files Browse the repository at this point in the history
* Intial commit

* updated apliction.rb

* Fixed mistake in credentials

* Made it so the file is backwards compatiable

* Fixed a typo

* Update amber_oauth2.rb

remove tomato paramater
  • Loading branch information
lodewiges authored Nov 27, 2024
1 parent 2b2d578 commit 19f0502
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $ EDITOR="code --wait" bundle exec rails credentials:edit
In OAuth AMBER (github.com/csvalpha/amber-api), execute the following command (in `rails console`):

```ruby
app = Doorkeeper::Application.create(name: 'SOFIA - Streepsysteem der C.S.V. Alpha', redirect_uri: 'http://localhost:5000/users/auth/amber_oauth2/callback', scopes: 'public tomato')
app = Doorkeeper::Application.create(name: 'SOFIA - Streepsysteem der C.S.V. Alpha', redirect_uri: 'http://localhost:5000/users/auth/amber_oauth2/callback', scopes: 'public sofia')
app.uid
app.plaintext_secret
```
Expand Down
2 changes: 1 addition & 1 deletion app/models/payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def self.create_with_mollie(description, attributes = nil)
mollie_payment = Mollie::Payment.create(
amount: { value: format('%<amount>.2f', amount: attributes[:amount]), currency: 'EUR' },
description: description,
redirect_url: "http://#{Rails.application.config.x.tomato_host}/payments/#{obj.id}/callback"
redirect_url: "http://#{Rails.application.config.x.sofia_host}/payments/#{obj.id}/callback"
)

obj.update(mollie_id: mollie_payment.id)
Expand Down
4 changes: 2 additions & 2 deletions app/views/partials/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<footer class="footer d-flex justify-content-between">
<span class="text-danger text-uppercase fw-bold mx-2">
<% if Rails.application.config.x.tomato_host == 'stagingstreep.csvalpha.nl' %>
<% if Rails.application.config.x.sofia_host == 'stagingstreep.csvalpha.nl' %>
For demo and testing purposes only
<% elsif Rails.application.config.x.tomato_host != 'streep.csvalpha.nl' %>
<% elsif Rails.application.config.x.sofia_host != 'streep.csvalpha.nl' %>
Development mode
<% end %>
</span>
Expand Down
4 changes: 2 additions & 2 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Application < Rails::Application
Rails.env.to_sym, :amber_client_secret
) || ENV.fetch('AMBER_CLIENT_SECRET', nil)

config.x.amber_host = credentials.dig(Rails.env.to_sym, :amber_host)
config.x.tomato_host = credentials.dig(Rails.env.to_sym, :tomato_host)
config.x.amber_host = credentials.dig(Rails.env.to_sym, :amber_host)
config.x.sofia_host = credentials.dig(Rails.env.to_sym, :sofia_host)

config.x.slack_webhook = credentials.dig(Rails.env.to_sym, :slack_webhook) || ''
config.x.slack_channel = '#monitoring'
Expand Down
2 changes: 1 addition & 1 deletion config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
38UAhGCN6gvsrpCR7TLGT4zffXEfkWvGcnv8mXhZbQvej5tdBE847d6KX1P2Gri240u8dtu0WXuTtZPYw3F/hlAg+0eKwZVX45nVHFtQbe8A37rjLIS+cLwFX3y5T4FmUAvfOSb+5fIkPaYW3tbzUtwuD8I2LGyOMr6xDlKwX1eQX7KIH75/XyObE2ABbXd3wNzEHZO1TXhyTbUwt09JA0Ck/zSRf9mb1vYG6gnEBF3Inv3kVVU6DUtI5OUrrZ541jAnyd1vtE19N+9GA1DQaboRtk65/+mJ7uhks8trw2PwY0NC0W0iVeFCUWaQUrw1UPKMrlCdWCzoxECGqfA+VOO7CjqCgVQ3ClmU8ym6oJ055PHjAyAvYludIwkVJj9QKW3XcqVP3qAxeXjxDRs9j9H3whMdu2NFcBoOWnPUWQNLfMtJKovJ1PVbB0zf8UdJwNiGJ4LRZ4167Fsv6UeL5ktZ7/HfmgGZ8YHaENZBL5/u103+RxzJ6blsxjfMZ4DZjDdZT/c4miEB+pQUCk5zPKu5De6WPBQq5zhfB4KpKtVqJq8RvsXcBsQMDrjPL748T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hLxgFH40FMSXNXEBjwzuvr2crcTwPC7lPCsVDeQrtOLfzTbEk3iWeKfZ18m3ORJO6VAjAVnMm8ztaHDmXNBKrV0owN1ZMaeez4jWtZKcjgNZQijOqs2Lm19abzTInzz4QGoeDKGjZx3ipkGMgZcwmfivzeTgUH4YMSArQj+vfox6FjKG43GPs0xMYSBplK2pLDAPwl7++7D8LiATuIbMxauEZeg96llt3ryBwj1VMcVLfTjvbp+Td6Jnh0AofgclSuZpjQxiF0uho3lDnwhh3qLXq7S0uiY+P25+YGoXEM90KbbdG25YK037haLUOaUaZw0XEiD3omsbnFG3IzEFt88mE7A+LHBiSf30CVCht3sAurgRaZBMCds3NlWxiWiUCVYQ9WMItoQas7Lwv0mhIwTot4yoZaNbplHO6rz9DDVFEUAVDJj1a+q3WjxmD59IpYHriT4I/m00Etc+08f57KfTNkM2uSnC8VrltX4/+EuzQWixYh756ntw==--32WLAptEbUz5grLv--qA/GkDJDSgWC8w1geJYPRw==
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')

config.action_mailer.default_url_options = {
scheme: 'https', host: Rails.application.config.x.tomato_host
scheme: 'https', host: Rails.application.config.x.sofia_host
}

config.action_mailer.delivery_method = :smtp
Expand Down
2 changes: 1 addition & 1 deletion lib/omniauth/strategies/amber_oauth2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AmberOauth2 < OmniAuth::Strategies::OAuth2

def authorize_params
params = super
params[:scope] = 'public tomato'
params[:scope] = 'public sofia'
params
end

Expand Down

0 comments on commit 19f0502

Please sign in to comment.