From 86754b06515e3f541f2e2a63264a7bcedd9335db Mon Sep 17 00:00:00 2001 From: Philipp Haussleiter Date: Wed, 27 Dec 2017 20:52:20 +0100 Subject: [PATCH 1/3] providing the root pass as env var --- lib/tasks/bootstrap.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/bootstrap.rake b/lib/tasks/bootstrap.rake index a1de1a5f..4505684f 100644 --- a/lib/tasks/bootstrap.rake +++ b/lib/tasks/bootstrap.rake @@ -195,8 +195,8 @@ namespace :bootstrap do u = User.new(username: "root", email: "root@localhost.local") # Ask for password/password_confirmation and hide the characters - password = nil - password_confirmation = nil + password = ENV['ROOTPASS'] + password_confirmation = ENV['ROOTPASS'] console = HighLine.new until password.present? && password == password_confirmation password = console.ask("Enter your password: ") { |q| q.echo = false } From 888523fda7c43dc433e88812bb491b0cb210dbf2 Mon Sep 17 00:00:00 2001 From: Philipp Haussleiter Date: Wed, 27 Dec 2017 21:12:14 +0100 Subject: [PATCH 2/3] providing the hostname as env var --- lib/tasks/bootstrap.rake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tasks/bootstrap.rake b/lib/tasks/bootstrap.rake index 4505684f..169d4d5b 100644 --- a/lib/tasks/bootstrap.rake +++ b/lib/tasks/bootstrap.rake @@ -217,8 +217,9 @@ namespace :bootstrap do unless File.exist?("config/settings.yaml") hostname = args.hostame puts "Grenerating settings.yaml file, if blank default to \"localhost:3000\"" - print "Hostname: " - hostname = STDIN.gets.chomp + hostname = ENV['HOSTNAME'] + print "Hostname: " if hostname.empty? + hostname = STDIN.gets.chomp if hostname.empty? hostname = "localhost:3000" if hostname.empty? h = {} File.open("config/settings.yaml", "w") do |file| From a859102cdaf65589bb44968affd6f433225fdb05 Mon Sep 17 00:00:00 2001 From: Ricky Chilcott Date: Thu, 28 Dec 2017 00:36:01 -0500 Subject: [PATCH 3/3] Cleaning up bootstrap hostname assignment --- lib/tasks/bootstrap.rake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/tasks/bootstrap.rake b/lib/tasks/bootstrap.rake index 169d4d5b..8fced818 100644 --- a/lib/tasks/bootstrap.rake +++ b/lib/tasks/bootstrap.rake @@ -215,12 +215,14 @@ namespace :bootstrap do desc "Create a settings.yaml file, if missing" task :settings, [:settings, :hostname] => :environment do |_t, args| unless File.exist?("config/settings.yaml") - hostname = args.hostame puts "Grenerating settings.yaml file, if blank default to \"localhost:3000\"" - hostname = ENV['HOSTNAME'] - print "Hostname: " if hostname.empty? + + hostname = args.hostname if hostname.empty? + hostname = ENV['HOSTNAME'] if hostname.empty? hostname = STDIN.gets.chomp if hostname.empty? hostname = "localhost:3000" if hostname.empty? + print "Hostname: #{hostname}" + h = {} File.open("config/settings.yaml", "w") do |file| h[:action_mailer] = { host: hostname.to_s }