Skip to content

Commit

Permalink
Fix SSL wildcard handling
Browse files Browse the repository at this point in the history
  • Loading branch information
svpernova09 committed Jul 21, 2020
1 parent d74c492 commit 0c47371
Showing 1 changed file with 33 additions and 30 deletions.
63 changes: 33 additions & 30 deletions scripts/homestead.rb
Original file line number Diff line number Diff line change
Expand Up @@ -356,38 +356,41 @@ def self.configure(config, settings)
# specific site type script (defaults to laravel)
s.path = script_dir + "/site-types/#{type}.sh"
s.args = [
site['map'], # $1
site['to'], # $2
site['port'] ||= http_port, # $3
site['ssl'] ||= https_port, # $4
site['php'] ||= '7.4', # $5
params ||= '', # $6
site['xhgui'] ||= '', # $7
site['exec'] ||= 'false', # $8
headers ||= '', # $9
rewrites ||= '' # $10
site['map'], # $1
site['to'], # $2
site['port'] ||= http_port, # $3
site['ssl'] ||= https_port, # $4
site['php'] ||= '7.4', # $5
params ||= '', # $6
site['xhgui'] ||= '', # $7
site['exec'] ||= 'false', # $8
headers ||= '', # $9
rewrites ||= '' # $10
]

if site['use_wildcard'] != 'no'
if site['type'] != 'apache'
config.vm.provision 'shell' do |s|
s.inline = "sed -i \"s/$1.crt/*.$2.crt/\" /etc/nginx/sites-available/$1"
s.args = [site['map'], site['map'].partition('.').last]
end

config.vm.provision 'shell' do |s|
s.inline = "sed -i \"s/$1.key/*.$2.key/\" /etc/nginx/sites-available/$1"
s.args = [site['map'], site['map'].partition('.').last]
end
else
config.vm.provision 'shell' do |s|
s.inline = "sed -i \"s/$1.crt/*.$2.crt/\" /etc/apache2/sites-available/$1-ssl.conf"
s.args = [site['map'], site['map'].partition('.').last]
end

config.vm.provision 'shell' do |s|
s.inline = "sed -i \"s/$1.key/*.$2.key/\" /etc/apache2/sites-available/$1-ssl.conf"
s.args = [site['map'], site['map'].partition('.').last]
# Should we use the wildcard ssl?
if site['wildcard'] == 'yes' or site['use_wildcard'] == 'yes'
if site['use_wildcard'] != 'no'
if site['type'] != 'apache'
config.vm.provision 'shell' do |s|
s.inline = "sed -i \"s/$1.crt/*.$2.crt/\" /etc/nginx/sites-available/$1"
s.args = [site['map'], site['map'].partition('.').last]
end

config.vm.provision 'shell' do |s|
s.inline = "sed -i \"s/$1.key/*.$2.key/\" /etc/nginx/sites-available/$1"
s.args = [site['map'], site['map'].partition('.').last]
end
else
config.vm.provision 'shell' do |s|
s.inline = "sed -i \"s/$1.crt/*.$2.crt/\" /etc/apache2/sites-available/$1-ssl.conf"
s.args = [site['map'], site['map'].partition('.').last]
end

config.vm.provision 'shell' do |s|
s.inline = "sed -i \"s/$1.key/*.$2.key/\" /etc/apache2/sites-available/$1-ssl.conf"
s.args = [site['map'], site['map'].partition('.').last]
end
end
end
end
Expand Down

0 comments on commit 0c47371

Please sign in to comment.