Skip to content

Commit 29543ae

Browse files
Merge branch 'main' of github.com:fosrl/newt
2 parents 92bc883 + e68a38e commit 29543ae

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

.go-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.23.2

Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@ COPY . .
1515
# Build the application
1616
RUN CGO_ENABLED=0 GOOS=linux go build -o /newt
1717

18-
# Start a new stage from scratch
19-
FROM ubuntu:22.04 AS runner
18+
FROM alpine:3.19 AS runner
2019

21-
RUN apt-get update && apt-get install ca-certificates -y && rm -rf /var/lib/apt/lists/*
20+
RUN apk --no-cache add ca-certificates
2221

23-
# Copy the pre-built binary file from the previous stage and the entrypoint script
2422
COPY --from=builder /newt /usr/local/bin/
2523
COPY entrypoint.sh /
2624

2725
RUN chmod +x /entrypoint.sh
28-
29-
# Copy the entrypoint script
3026
ENTRYPOINT ["/entrypoint.sh"]
31-
32-
# Command to run the executable
3327
CMD ["newt"]

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ local:
2323

2424
go-build-release:
2525
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o bin/newt_linux_arm64
26+
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -o bin/newt_linux_arm32
27+
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -o bin/newt_linux_arm32v6
2628
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/newt_linux_amd64
29+
CGO_ENABLED=0 GOOS=linux GOARCH=riscv64 go build -o bin/newt_linux_riscv64
2730
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o bin/newt_darwin_arm64
2831
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/newt_darwin_amd64
2932
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/newt_windows_amd64.exe

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func startPingCheck(tnet *netstack.Net, serverIP string, stopChan chan struct{})
124124
err := ping(tnet, serverIP)
125125
if err != nil {
126126
logger.Warn("Periodic ping failed: %v", err)
127-
logger.Warn("HINT: Do you have UDP port 51280 (or the port in config.yml) open on your Pangolin server?")
127+
logger.Warn("HINT: Do you have UDP port 51820 (or the port in config.yml) open on your Pangolin server?")
128128
}
129129
case <-stopChan:
130130
logger.Info("Stopping ping check")

websocket/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ func (c *Client) getToken() (string, error) {
228228

229229
var tokenResp TokenResponse
230230
if err := json.NewDecoder(resp.Body).Decode(&tokenResp); err != nil {
231+
// print out the token response for debugging
232+
buf := new(bytes.Buffer)
233+
buf.ReadFrom(resp.Body)
234+
logger.Info("Token response: %s", buf.String())
231235
return "", fmt.Errorf("failed to decode token response: %w", err)
232236
}
233237

0 commit comments

Comments
 (0)