Compare commits

...

3 Commits

Author SHA1 Message Date
Maxi Quoß 3b9decd572 add container_name, fix health whitespace 2023-02-11 22:54:19 +01:00
Maxi Quoß 9a1a816f25 change error messages 2023-02-11 22:49:23 +01:00
Maxi Quoß 8d43554e0e check if To4() == nil 2023-02-11 22:48:16 +01:00
3 changed files with 14 additions and 6 deletions
+1 -1
View File
@@ -17,5 +17,5 @@ RUN apk update &&\
WORKDIR /app
COPY --from=downloader /app/upsnap upsnap
HEALTHCHECK --interval=10s \
CMD curl -fs "http://localhost:8090/api/health " || exit 1
CMD curl -fs "http://localhost:8090/api/health" || exit 1
ENTRYPOINT ["./upsnap", "serve", "--http=0.0.0.0:8090"]
+12 -5
View File
@@ -54,15 +54,22 @@ func wakeUDP(addr string, target net.HardwareAddr, password []byte) error {
func getBroadcastIp(ipStr, maskStr string) (string, error) {
ip := net.ParseIP(ipStr)
if ip == nil {
return "", errors.New("invalid IP address")
return "", errors.New("ip not a valid ipv4 address")
}
mask := net.ParseIP(maskStr)
if mask == nil {
return "", errors.New("invalid subnet mask")
ip = ip.To4()
if ip == nil {
return "", errors.New("ip not a valid ipv4 address")
}
ip = ip.To4()
mask := net.ParseIP(maskStr)
if mask == nil {
return "", errors.New("subnet mask not a valid ipv4 address")
}
mask = mask.To4()
ip = ip.To4()
if ip == nil {
return "", errors.New("subnet mask not a valid ipv4 address")
}
broadcast := make(net.IP, 4)
for i := range ip {
+1
View File
@@ -1,6 +1,7 @@
version: "3"
services:
upsnap:
container_name: upsnap
image: ghcr.io/seriousm4x/upsnap:3
network_mode: host
restart: unless-stopped