diff options
| author | mo khan <mo@mokhan.ca> | 2021-07-10 19:02:12 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2021-07-10 19:02:12 -0600 |
| commit | 97c411e29f82c259c979d7126b689f41f496c808 (patch) | |
| tree | 25186efbccb3fde2ccbf6fc4e57c548c93741bc1 /bin | |
| parent | 2217bcfa6d27a5156b22be27a26f03c4d4f323d9 (diff) | |
chore: generate key pair for development tls
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/server | 4 | ||||
| -rwxr-xr-x | bin/setup | 48 | ||||
| -rwxr-xr-x | bin/test | 4 |
3 files changed, 25 insertions, 31 deletions
@@ -1,3 +1,7 @@ #!/bin/sh +set -e + +cd "$(dirname "$0")/.." + bundle exec rails server @@ -1,36 +1,22 @@ -#!/usr/bin/env ruby -require "fileutils" +#!/bin/sh -# path to your application root. -APP_ROOT = File.expand_path('..', __dir__) +set -e -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end +cd "$(dirname "$0")/.." -FileUtils.chdir APP_ROOT do - # This script is a way to set up or update your development environment automatically. - # This script is idempotent, so that you can run it at any time and get an expectable outcome. - # Add necessary setup steps to this file. +gem install bundler --conservative +bundle install +bin/yarn - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') +bin/rails db:prepare +bin/rails log:clear tmp:clear +bin/rails restart - # Install JavaScript dependencies - system! 'bin/yarn' - - # puts "\n== Copying sample files ==" - # unless File.exist?('config/database.yml') - # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' - # end - - puts "\n== Preparing database ==" - system! 'bin/rails db:prepare' - - puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'bin/rails restart' -end +if [ ! -f config/key.pem ] && [ ! -f config/certificiate.pem ]; then + openssl req -x509 -newkey rsa:4096\ + -days 999 \ + -nodes \ + -subj "/C=/ST=/L=/O=/OU=/CN=*.test" \ + -keyout config/key.pem \ + -out config/certificate.pem +fi @@ -1,3 +1,7 @@ #!/bin/sh +set -e + +cd "$(dirname "$0")/.." + bundle exec rails test "$@" |
