Skip to content

Commit

Permalink
fix: sample config installation (move to post_install)
Browse files Browse the repository at this point in the history
  • Loading branch information
chetan committed Dec 16, 2020
1 parent adb95a5 commit 4fa096a
Showing 1 changed file with 37 additions and 30 deletions.
67 changes: 37 additions & 30 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,44 +103,51 @@ brews:
install: |
bin.install "vproxy"
# only create if it doesn't already exist
conf_file = "#{etc}/vproxy.conf"
if !File.exist?(conf_file) then
File.open(conf_file, "w") do |f|
str = <<-EOF
# Sample config file
# All commented settings below are defaults
post_install: |
str = <<-EOF
# Sample config file
# All commented settings below are defaults
[server]
# IP on which server will listen
# To listen on all IPs, set listen = "0.0.0.0"
#listen = "127.0.0.1"
[server]
# IP on which server will listen
# To listen on all IPs, set listen = "0.0.0.0"
#listen = "127.0.0.1"
# Ports to listen on
#http = 80
#https = 443
# Ports to listen on
#http = 80
#https = 443
# The following paths are set explicitly to facilitate running as root
# The following paths are set explicitly to facilitate running as root
# mkcert's CAROOT path
# Set to output of `mkcert -CAROOT`
caroot_path = "#{`mkcert -CAROOT`.strip}"
# mkcert's CAROOT path
# Set to output of `mkcert -CAROOT`
caroot_path = "#{`mkcert -CAROOT`.strip}"
# Path where generated certificates should be stored
cert_path = "#{ENV['HOME']}/.vproxy"
# Path where generated certificates should be stored
cert_path = "#{ENV['HOME']}/.vproxy"
# Path to mkcert program
mkcert_path = "#{`which mkcert`.strip}"
# Path to mkcert program
mkcert_path = "#{`which mkcert`.strip}"
[client]
#host = "127.0.0.1"
#http = 80
[client]
#host = "127.0.0.1"
#http = 80
# Use this in local config files, i.e., a .vproxy.conf file located in a
# project folder
#bind = ""
EOF
f.puts str.gsub(/^\s+/, "")
# Use this in local config files, i.e., a .vproxy.conf file located in a
# project folder
#bind = ""
EOF
# only create if it doesn't already exist
conf_file = "#{etc}/vproxy.conf"
if File.exist?(conf_file) then
File.open(conf_file, "w") do |f|
f.puts str.gsub(/^[\t ]+/, "")
end
end
# always write new sample file
File.open(conf_file+".sample", "w") do |f|
f.puts str.gsub(/^[\t ]+/, "")
end

0 comments on commit 4fa096a

Please sign in to comment.