Developing on macOS #74

Closed
opened 8 months ago by prologic · 5 comments
Owner

Here's what I'm doing in my development enviornment on macOS:

Checkout the project:

$ mkdir ~/Proejcts
$ cd ~/Projects
$ git clone https://git.mills.io/saltyim/saltyim.git
$ cd saltyim

Install some useful tools:

$ go install github.com/jsha/minica@latest
$ go install git.mills.io/prologic/devdns@latest

Create a CA certificate and certificates for salty.home.darpa:

$ cd certs && $ minica --domains salty.home.arpa

So that curl and friends work:

$ export CURL_CA_BUNDLE=~/Projects/saltyim/saltyim/certs/minica.pem

Run devdns to point salty.home.arpa to 127.0.0.1:

$ sudo devdns salty.home.arpa

Build and run saltyd:

$ go build ./cmd/saltyd/... && ./saltyd -D -b :https -u https://salty.home.arpa --tls --tls-key ./certs/salty.home.arpa/key.pem --tls-cert ./certs/salty.home.arpa/cert.pem --svc-user salty@salty.home.arpa

NB: Building directly with go is required so that the built binary for local dev and testing uses the CGO resolver and your system's resolver (which devdns is automatically configuring and serving).

Here's what I'm doing in my development enviornment on macOS: Checkout the project: ```#!sh $ mkdir ~/Proejcts $ cd ~/Projects $ git clone https://git.mills.io/saltyim/saltyim.git $ cd saltyim ``` Install some useful tools: ```#!sh $ go install github.com/jsha/minica@latest $ go install git.mills.io/prologic/devdns@latest ``` Create a CA certificate and certificates for `salty.home.darpa`: ```#!sh $ cd certs && $ minica --domains salty.home.arpa ``` So that `curl` and friends work: ```#!sh $ export CURL_CA_BUNDLE=~/Projects/saltyim/saltyim/certs/minica.pem ``` Run `devdns` to point `salty.home.arpa` to `127.0.0.1`: ```#!sh $ sudo devdns salty.home.arpa ``` Build and run `saltyd`: ```#!sh $ go build ./cmd/saltyd/... && ./saltyd -D -b :https -u https://salty.home.arpa --tls --tls-key ./certs/salty.home.arpa/key.pem --tls-cert ./certs/salty.home.arpa/cert.pem --svc-user salty@salty.home.arpa ``` **NB:** Building directly with `go` _is required_ so that the built binary for local dev and testing uses the CGO resolver and your system's resolver (which `devdns` is automatically configuring and serving).
Owner

Oh boy. I just use caddy trust and the Caddyfile for salty.home.arpa (an alias for localhost in my /etc/hosts)

Oh boy. I just use `caddy trust` and the Caddyfile for `salty.home.arpa` (an alias for localhost in my /etc/hosts)
Poster
Owner

Oh boy. I just use caddy trust and the Caddyfile for salty.home.arpa (an alias for localhost in my /etc/hosts)

What does caddy trust do though?

> Oh boy. I just use `caddy trust` and the Caddyfile for `salty.home.arpa` (an alias for localhost in my /etc/hosts) > What does `caddy trust` do though?
prologic added the
area/docs
label 8 months ago
prologic closed this issue 8 months ago
prologic reopened this issue 8 months ago
Poster
Owner

Ooops, we shoud document this somewhere...

Ooops, we _shoud_ document this somewhere...
Poster
Owner

Also similar seutp doing dev on a Debian server:

[root@gostdlib saltyim]# cat Corefile
.:53 {
  log
  errors
  health
  file db.home.arpa
  forward . 108.61.10.10 {
    except home.arpa
  }
}
[root@gostdlib saltyim]# cat runme.sh
#!/bin/sh

nohup coredns &> coredns.log &
nohup make dev &> saltyd.log &
[root@gostdlib saltyim]#
Also similar seutp doing dev on a Debian server: ```#!sh [root@gostdlib saltyim]# cat Corefile .:53 { log errors health file db.home.arpa forward . 108.61.10.10 { except home.arpa } } [root@gostdlib saltyim]# cat runme.sh #!/bin/sh nohup coredns &> coredns.log & nohup make dev &> saltyd.log & [root@gostdlib saltyim]# ```
prologic referenced this issue from a commit 2 months ago
prologic closed this issue 2 months ago
Poster
Owner

Documentation is already covered in Development Guide

Documentation is already covered in [Development Guide](https://git.mills.io/saltyim/saltyim/src/branch/master/docs/Development.md)
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: saltyim/saltyim#74
Loading…
There is no content yet.