Repository navigation
Expand file tree
/
Copy pathopenrun.rb
More file actions
72 lines (63 loc) · 2.37 KB
/
Copy pathopenrun.rb
File metadata and controls
72 lines (63 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# typed: false
# frozen_string_literal: true
# This file was generated by GoReleaser. DO NOT EDIT.
class Openrun < Formula
desc ""
homepage "https://openrun.dev"
version "0.20.5"
depends_on "mkcert"
on_macos do
if Hardware::CPU.intel?
url "https://github.com/openrundev/openrun/releases/download/v0.20.5/openrun-v0.20.5-darwin-amd64.tar.gz"
sha256 "11186f6e4f2e84bcc86a2e53c94b30257d5c25c744e585564b911afa7a4a21fd"
def install
bin.install "openrun"
end
end
if Hardware::CPU.arm?
url "https://github.com/openrundev/openrun/releases/download/v0.20.5/openrun-v0.20.5-darwin-arm64.tar.gz"
sha256 "513ada7f8081d164883d0d94c868676fa001bcd77796596d77193307835f8d5d"
def install
bin.install "openrun"
end
end
end
on_linux do
if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
url "https://github.com/openrundev/openrun/releases/download/v0.20.5/openrun-v0.20.5-linux-amd64.tar.gz"
sha256 "ffad06f2fcec8c76c54d19f1d70ccd44408231d4502d5eeb32d3cf668120712d"
def install
bin.install "openrun"
end
end
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://github.com/openrundev/openrun/releases/download/v0.20.5/openrun-v0.20.5-linux-arm64.tar.gz"
sha256 "652dd3b8555c4ffa80ce29fec6b432e8b56db9e196df636ad1d3f1a1581c5e48"
def install
bin.install "openrun"
end
end
end
def post_install
unless File.exist?("#{etc}/openrun.toml")
pid = spawn("#{opt_bin}/openrun password", out: "#{etc}/openrun.toml")
puts "********** Initializing \"admin\" user **********"
Process.wait(pid)
puts "************* Save this password ****************"
mkcert_path = `which mkcert`.chomp
unless mkcert_path.empty?
system("mkdir -p #{HOMEBREW_PREFIX}/var/openrun/config/certificates")
system("#{mkcert_path} -install")
system("#{mkcert_path} -cert-file #{HOMEBREW_PREFIX}/var/openrun/config/certificates/default.crt -key-file #{HOMEBREW_PREFIX}/var/openrun/config/certificates/default.key localhost 127.0.0.1 \"*.localhost\"")
puts "Created localhost TLS certificates"
end
end
end
service do
run [ opt_bin/"openrun", "server", "start" ]
keep_alive true
working_dir HOMEBREW_PREFIX
log_path var/"log/openrun.log"
error_log_path var/"log/openrun.log"
end
end