Skip to content

Commit 116bb69

Browse files
committed
Fix service startup
1 parent 32ee4d1 commit 116bb69

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.goreleaser.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ brews:
109109
repository:
110110
owner: claceio
111111
name: homebrew-clace
112+
dependencies:
113+
- name: "mkcert"
112114
service: |
113-
run [ opt_bin/"clace" ]
115+
run [ opt_bin/"clace", "server", "start" ]
114116
keep_alive true
115117
working_dir HOMEBREW_PREFIX
116118
log_path var/"log/clace.log"
@@ -120,6 +122,15 @@ brews:
120122
bin.install "clace"
121123
post_install: |-
122124
unless File.exist?("#{etc}/clace.toml")
123-
stderr = Utils.popen_read("#{opt_bin}/clace password 1>#{etc}/clace.toml 2>&1")
124-
puts stderr
125+
pid = spawn("#{opt_bin}/clace password", out: "#{etc}/clace.toml")
126+
puts "********** Initializing \"admin\" user **********"
127+
Process.wait(pid)
128+
puts "***********************************************"
129+
130+
mkcert_path = `which mkcert`.chomp
131+
unless mkcert_path.empty?
132+
system("mkdir -p #{HOMEBREW_PREFIX}/var/clace/config/certificates")
133+
system("#{mkcert_path} -cert-file #{HOMEBREW_PREFIX}/var/clace/config/certificates/default.crt -key-file #{HOMEBREW_PREFIX}/var/clace/config/certificates/default.key localhost 127.0.0.1 \"*.localhost\"")
134+
puts "Created localhost TLS certificates"
135+
end
125136
end

0 commit comments

Comments
 (0)