Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make app deployable to DigitalOcean #1

Merged
merged 7 commits into from
Apr 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ gem "annotate", "~> 3.1"
gem "rexml", "~> 3.2"

gem 'rails_admin', '~> 2.0'

# Fix segmentation fault on assets:precompile - https://github.com/sass/sassc-ruby/issues/207
gem 'sprockets', '< 4'
6 changes: 5 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ GEM
nio4r (2.5.7)
nokogiri (1.11.3-arm64-darwin)
racc (~> 1.4)
nokogiri (1.11.3-x86_64-linux)
racc (~> 1.4)
pg (1.2.3)
public_suffix (4.0.6)
puma (5.2.2)
Expand Down Expand Up @@ -223,7 +225,7 @@ GEM
rubyzip (>= 1.2.2)
semantic_range (3.0.0)
spring (2.1.1)
sprockets (4.0.2)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
Expand Down Expand Up @@ -262,6 +264,7 @@ GEM

PLATFORMS
arm64-darwin-20
x86_64-linux

DEPENDENCIES
annotate (~> 3.1)
Expand All @@ -279,6 +282,7 @@ DEPENDENCIES
sass-rails (>= 6)
selenium-webdriver
spring
sprockets (< 4)
sqlite3 (~> 1.4)
turbolinks (~> 5)
tzinfo-data
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<%= csp_meta_tag %>

<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>

Expand Down
19 changes: 19 additions & 0 deletions config/initializers/rails_admin.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
# https://github.com/sferik/rails_admin/issues/887
require "nested_form/engine"
require "nested_form/builder_mixin"

unless Rails.env.development? || Rails.env.test?
ADMIN_PASSWORD = ENV['ADMIN_PASSWORD']
raise "ADMIN_PASSWORD is unset" unless ADMIN_PASSWORD
end

RailsAdmin.config do |config|
if ADMIN_PASSWORD
config.authenticate_with do
authenticate_or_request_with_http_basic('Login required') do |username, password|
if username != 'wd' || password != ADMIN_PASSWORD
raise "Unauthorized login to Rails Admin: #{username}/#{password}"
end
true
end
end
end

### Popular gems integration

Expand Down