Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from JesusGautamah/staging
Browse files Browse the repository at this point in the history
Include Hotfix and New Env Variables to Main Branch
  • Loading branch information
JesusGautamah committed Feb 1, 2023
2 parents 18eee08 + 260869f commit 2aeed54
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ gem "activerecord-import"
# Google Firestore
gem "google-cloud-firestore", "~> 2.6"

# Rack Cors
gem "rack-cors"


# Use Sass to process CSS
# gem "sassc-rails"
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ GEM
nio4r (~> 2.0)
racc (1.6.2)
rack (2.2.6.2)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-test (2.0.2)
rack (>= 1.3)
rails (7.0.4.1)
Expand Down Expand Up @@ -378,6 +380,7 @@ DEPENDENCIES
jbuilder (~> 2.11)
pg (~> 1.4)
puma (~> 5.6)
rack-cors
rails (~> 7.0)
rails-controller-testing (~> 1.0)
rspec-rails (~> 6.0)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ https://blockchain-staging.outerspacecoding.com
* [ ] Better layout for the blockchain web interface
* [ ] Add and correct documentation, create api documentation page
## Todo
* [ ] Better Rack Cors Config
* [ ] Add Rack Attack and Rack Attack Throttle
* [ ] Simplify SMTP configuration
* [ ] Create a template for the user registration email
* [ ] Create blockchain report mailer to admin
Expand Down
11 changes: 11 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ class Application < Rails::Application
config.load_defaults 7.0
config.autoload_paths << Rails.root.join("lib")

config.middleware.insert_before 0, Rack::Cors do
allow do
origins '*'
resource(
'*',
headers: :any,
methods: [:get, :patch, :put, :delete, :post, :options, :head]
)
end
end

# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
Expand Down
6 changes: 2 additions & 4 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ default: &default
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: db
username: postgres
password: secret
username: <%= ENV['POSTGRES_USER'] %>
password: <%= ENV['POSTGRES_PASSWORD'] %>

development:
<<: *default
Expand All @@ -17,5 +17,3 @@ test:
production:
<<: *default
database: outerspace_blockchain_production
username: outerspace_blockchain
password: <%= ENV["OUTERSPACE_BLOCKCHAIN_DATABASE_PASSWORD"] %>
3 changes: 1 addition & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

Rails.application.configure do
config.hosts << "lvh.me"
config.hosts << "outerspacecoding.com"
config.hosts << "osbc.outerspacecoding.com"
config.hosts << "devtest.outerspacecoding.com"
# Settings specified here will take precedence over those in config/application.rb.

# In the development environment your application's code is reloaded any time
Expand Down
3 changes: 3 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# Code is not reloaded between requests.
config.cache_classes = true

# force ssl
# config.force_ssl = ENV["FORCE_SSL"] == "true"

# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
Expand Down

0 comments on commit 2aeed54

Please sign in to comment.