# `mix star_view.trust`
[🔗](https://github.com/Neophen/star_view/blob/v0.7.0/lib/mix/tasks/star_view.trust.ex#L1)

Adds the configured StarView development host to `/etc/hosts` and generates a
browser-trusted development certificate with `mkcert`.

The task infers the host from:

    config :my_app, star_view: [dev_url: "https://my-app.test:4001"]

If no `:dev_url` is configured, it falls back to the current Mix application
name with underscores converted to hyphens.

This task asks before running local machine setup. If accepted, it may prompt
for your password through `sudo` when updating `/etc/hosts` or when `mkcert`
installs its local certificate authority.

`mkcert` must be installed first. On macOS:

    brew install mkcert nss

## Examples

    mix star_view.trust
    mix star_view.trust --host my-app.test
    mix star_view.trust --cert priv/cert/selfsigned.pem
    mix star_view.trust --key priv/cert/selfsigned_key.pem
    mix star_view.trust --yes

## Options

  * `--host` - hostname to add and generate a certificate for. Defaults to
    the configured StarView dev URL host.
  * `--cert` - certificate path. Defaults to `priv/cert/selfsigned.pem`.
  * `--key` - private key path. Defaults to `priv/cert/selfsigned_key.pem`.
  * `--ip` - IP address for the hosts entry. Defaults to `127.0.0.1`.
  * `--dry-run` - print the commands without running them.
  * `--yes` - skip the confirmation prompt.

