Warning instead of fail if no public IP

This commit is contained in:
Anders Pitman 2022-01-05 22:42:11 -07:00
parent 769097c270
commit e5cee3bbb9
3 changed files with 13 additions and 11 deletions

View File

@ -67,9 +67,8 @@ func Listen() {
ip, err := namedropClient.GetPublicIp()
if err != nil {
log.Fatal(err)
}
fmt.Printf("WARNING: Failed to determine public IP: %s\n", err.Error())
} else {
err = namedrop.CheckPublicAddress(ip, *httpPort)
if err != nil {
fmt.Printf("WARNING: Failed to access port %d from the internet\n", *httpPort)
@ -79,6 +78,7 @@ func Listen() {
if err != nil {
fmt.Printf("WARNING: Failed to access port %d from the internet\n", *httpsPort)
}
}
autoCerts := true
if *httpPort != 80 || *httpsPort != 443 {

2
go.mod
View File

@ -10,7 +10,7 @@ require (
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
github.com/takingnames/namedrop-go v0.4.0
github.com/takingnames/namedrop-go v0.6.0
)
require (

2
go.sum
View File

@ -142,6 +142,8 @@ github.com/takingnames/namedrop-go v0.3.0 h1:qblZaAFQzkxOJvqVbqH3Oqevfd8mSkgF4k9
github.com/takingnames/namedrop-go v0.3.0/go.mod h1:E3nx6fxAMfestthd1O3VhbaPesLaiYSGkWXRD1nIc88=
github.com/takingnames/namedrop-go v0.4.0 h1:dtCANCL+pQ/oBftGN5+gIeHglk5Yo/3Qokp5Uw90UHk=
github.com/takingnames/namedrop-go v0.4.0/go.mod h1:E3nx6fxAMfestthd1O3VhbaPesLaiYSGkWXRD1nIc88=
github.com/takingnames/namedrop-go v0.6.0 h1:1iIHjSww47fwalBFfs3Caovkqzz5UMqwDFzisy6iPag=
github.com/takingnames/namedrop-go v0.6.0/go.mod h1:E3nx6fxAMfestthd1O3VhbaPesLaiYSGkWXRD1nIc88=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=