Skip to content

Commit

Permalink
internal/packer: use new UpdateOpts.NoPassword (#69)
Browse files Browse the repository at this point in the history
Updates gokrazy/gokrazy#265
Updates tailscale/tailscale#1866

Signed-off-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
bradfitz authored Jun 9, 2024
1 parent 34b02e2 commit ee071a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/breml/rootcerts v0.2.10
github.com/donovanhide/eventsource v0.0.0-20210830082556-c59027999da0
github.com/gokrazy/internal v0.0.0-20240510165500-68dd68393b7a
github.com/gokrazy/internal v0.0.0-20240607160728-3c7bf66a62e9
github.com/gokrazy/updater v0.0.0-20230215172637-813ccc7f21e2
github.com/google/go-cmp v0.5.9
github.com/google/renameio/v2 v2.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ github.com/breml/rootcerts v0.2.10/go.mod h1:24FDtzYMpqIeYC7QzaE8VPRQaFZU5TIUDly
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/donovanhide/eventsource v0.0.0-20210830082556-c59027999da0 h1:C7t6eeMaEQVy6e8CarIhscYQlNmw5e3G36y7l7Y21Ao=
github.com/donovanhide/eventsource v0.0.0-20210830082556-c59027999da0/go.mod h1:56wL82FO0bfMU5RvfXoIwSOP2ggqqxT+tAfNEIyxuHw=
github.com/gokrazy/internal v0.0.0-20240510165500-68dd68393b7a h1:FKeN678rNpKTpWRdFbAhYL9mWzPu57R5XPXCR3WmXdI=
github.com/gokrazy/internal v0.0.0-20240510165500-68dd68393b7a/go.mod h1:t3ZirVhcs9bH+fPAJuGh51rzT7sVCZ9yfXvszf0ZjF0=
github.com/gokrazy/internal v0.0.0-20240607160728-3c7bf66a62e9 h1:SLjEgU2ufDL13xVW4+BWTcwhGFTOwf2LXAiJQiolASU=
github.com/gokrazy/internal v0.0.0-20240607160728-3c7bf66a62e9/go.mod h1:t3ZirVhcs9bH+fPAJuGh51rzT7sVCZ9yfXvszf0ZjF0=
github.com/gokrazy/updater v0.0.0-20230215172637-813ccc7f21e2 h1:kBY5R1tSf+EYZ+QaSrofLaVJtBqYsVNVBWkdMq3Smcg=
github.com/gokrazy/updater v0.0.0-20230215172637-813ccc7f21e2/go.mod h1:PYOvzGOL4nlBmuxu7IyKQTFLaxr61+WPRNRzVtuYOHw=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
Expand Down
14 changes: 8 additions & 6 deletions internal/packer/packer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ func (pack *Pack) logic(programName string) error {
update.Hostname = updateHostname
}

if update.HTTPPassword == "" {
if update.HTTPPassword == "" && !update.NoPassword {
pw, err := ensurePasswordFileExists(updateHostname, defaultPassword)
if err != nil {
return err
Expand Down Expand Up @@ -1374,11 +1374,13 @@ func (pack *Pack) logic(programName string) error {

etc.Dirents = append(etc.Dirents, ssl)

etc.Dirents = append(etc.Dirents, &FileInfo{
Filename: "gokr-pw.txt",
Mode: 0400,
FromLiteral: update.HTTPPassword,
})
if !update.NoPassword {
etc.Dirents = append(etc.Dirents, &FileInfo{
Filename: "gokr-pw.txt",
Mode: 0400,
FromLiteral: update.HTTPPassword,
})
}

etc.Dirents = append(etc.Dirents, &FileInfo{
Filename: "http-port.txt",
Expand Down

0 comments on commit ee071a0

Please sign in to comment.