Skip to content

Commit

Permalink
Test webrick gem
Browse files Browse the repository at this point in the history
  • Loading branch information
aapomm committed Nov 28, 2022
1 parent 65eb7f0 commit aa420b6
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .do/deploy.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ spec:
value: enabled
scope: RUN_TIME
git:
branch: develop
branch: fix-heroku-1-click
repo_clone_url: https://github.com/dradis/dradis-ce.git
name: web
run_command: ./bin/setup
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Rails stuff
/db/*.sqlite3
/db/*.sqlite3-*
/config/database.yml
/config/secrets.yml
/config/smtp.yml
/log/*
Expand Down
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"keywords": ["infosec", "pentest", "osint"],
"logo": "https://github.com/dradis/dradis-ce/raw/deploy-to-heroku/app/assets/images/logo_small.png",
"name": "Dradis Framework - Community Edition",
"repository": "https://github.com/dradis/dradis-ce/tree/deploy-to-heroku",
"repository": "https://github.com/dradis/dradis-ce/tree/develop",
"scripts": {
"postdeploy": "bin/heroku"
},
Expand Down
36 changes: 36 additions & 0 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000

development:
<<: *default
database: db/development.sqlite3

# MySQL version - make sure the mysql2 gem is included in your Gemfile
# If you uncomment this development: block, comment the previous one.
# development:
# adapter: mysql2
# encoding: utf8
# collation: utf8_bin
# database: dradis_dev
# username: root
# socket: /tmp/mysql.sock


# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3

production:
<<: *default
database: db/production.sqlite3
22 changes: 22 additions & 0 deletions config/unicorn.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
preload_app true

before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end

defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end

after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
end

defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end

0 comments on commit aa420b6

Please sign in to comment.