diff --git a/HomebrewFormula/mkcert.rb b/HomebrewFormula/mkcert.rb new file mode 100644 index 0000000..f1be4f8 --- /dev/null +++ b/HomebrewFormula/mkcert.rb @@ -0,0 +1,18 @@ +class Mkcert < Formula + desc "Simple tool to make locally-trusted development certificates" + homepage "https://github.com/FiloSottile/mkcert" + head "https://github.com/FiloSottile/mkcert.git" + + depends_on "go" => :build + + def install + ENV["GOPATH"] = buildpath + mkcertpath = buildpath/"src/github.com/FiloSottile/mkcert" + mkcertpath.install buildpath.children + cd mkcertpath do + system "go", "build", "-o", bin/"mkcert" + prefix.install_metafiles + end + end +end + \ No newline at end of file diff --git a/README.md b/README.md index 7823db0..8ffa3ab 100644 --- a/README.md +++ b/README.md @@ -20,18 +20,18 @@ Created a new certificate valid for the following names 📜 The certificate is at "./example.com+4.pem" and the key at "./example.com+4-key.pem" ✅ ``` -![Chrome screenshot](https://user-images.githubusercontent.com/1225294/41887838-7acd55ca-78d0-11e8-8a81-139a54faaf87.png) +

Chrome screenshot

-Obtaining certificates from real CAs for development can be dangerous or impossible (for hosts like `localhost` or `127.0.0.1`), but self-signed certificates cause trust errors. Managing your own CA is the best solution, but usually involves arcane commands, specialized knowledge and manual steps. +Using certificates from real CAs for development can be dangerous or impossible (for hosts like `localhost` or `127.0.0.1`), but self-signed certificates cause trust errors. Managing your own CA is the best solution, but usually involves arcane commands, specialized knowledge and manual steps. -mkcert automatically creates and installs a local CA in the system root store, and generates locally-trusted certificates for any hosts. +mkcert automatically creates and installs a local CA in the system root store, and generates locally-trusted certificates. ## Installation On macOS, use Homebrew. ``` -TODO +brew install --HEAD FiloSottile/mkcert/mkcert ``` On Linux, use [the pre-built binaries](https://github.com/FiloSottile/mkcert/releases), or build from source. diff --git a/main.go b/main.go index 27435d7..5bdec6e 100644 --- a/main.go +++ b/main.go @@ -81,7 +81,23 @@ func (m *mkcert) Run(args []string) { } if len(args) == 0 { - log.Println("Usage: TODO") + log.Printf(` +Usage: + + $ mkcert -install + Install the local CA in the system trust store. + + $ mkcert example.org + Generate "example.org.pem" and "example.org-key.pem". + + $ mkcert example.com myapp.dev localhost 127.0.0.1 ::1 + Generate "example.com+4.pem" and "example.com+4-key.pem". + + $ mkcert -uninstall + Unnstall the local CA (but do not delete it). + +Change the CA certificate and key storage location by setting $CAROOT. +`) return }