mirror of
https://github.com/fosrl/olm.git
synced 2026-03-27 13:06:40 +00:00
Compare commits
5 Commits
v1.4.3
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0efe6b20cc | ||
|
|
703fe4fe5d | ||
|
|
42ef1f5ee3 | ||
|
|
31eed74933 | ||
|
|
ac5c11dff0 |
19
Dockerfile
19
Dockerfile
@@ -1,4 +1,8 @@
|
|||||||
FROM golang:1.25-alpine AS builder
|
# FROM golang:1.25-alpine AS builder
|
||||||
|
FROM public.ecr.aws/docker/library/golang:1.26-alpine AS builder
|
||||||
|
|
||||||
|
# Install git and ca-certificates
|
||||||
|
RUN apk --no-cache add ca-certificates git tzdata
|
||||||
|
|
||||||
# Set the working directory inside the container
|
# Set the working directory inside the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -13,21 +17,16 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /olm
|
ARG VERSION=dev
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X main.olmVersion=${VERSION}" -o /olm
|
||||||
|
|
||||||
# Start a new stage from scratch
|
FROM public.ecr.aws/docker/library/alpine:3.23 AS runner
|
||||||
FROM alpine:3.23 AS runner
|
|
||||||
|
|
||||||
RUN apk --no-cache add ca-certificates
|
RUN apk --no-cache add ca-certificates tzdata iputils
|
||||||
|
|
||||||
# Copy the pre-built binary file from the previous stage and the entrypoint script
|
|
||||||
COPY --from=builder /olm /usr/local/bin/
|
COPY --from=builder /olm /usr/local/bin/
|
||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
# Copy the entrypoint script
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
# Command to run the executable
|
|
||||||
CMD ["olm"]
|
CMD ["olm"]
|
||||||
15
olm/peer.go
15
olm/peer.go
@@ -20,6 +20,11 @@ func (o *Olm) handleWgPeerAdd(msg websocket.WSMessage) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if o.peerManager == nil {
|
||||||
|
logger.Debug("Ignoring add-peer message: peerManager is nil (shutdown in progress)")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
jsonData, err := json.Marshal(msg.Data)
|
jsonData, err := json.Marshal(msg.Data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("Error marshaling data: %v", err)
|
logger.Error("Error marshaling data: %v", err)
|
||||||
@@ -76,6 +81,11 @@ func (o *Olm) handleWgPeerRemove(msg websocket.WSMessage) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if o.peerManager == nil {
|
||||||
|
logger.Debug("Ignoring remove-peer message: peerManager is nil (shutdown in progress)")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
jsonData, err := json.Marshal(msg.Data)
|
jsonData, err := json.Marshal(msg.Data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("Error marshaling data: %v", err)
|
logger.Error("Error marshaling data: %v", err)
|
||||||
@@ -113,6 +123,11 @@ func (o *Olm) handleWgPeerUpdate(msg websocket.WSMessage) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if o.peerManager == nil {
|
||||||
|
logger.Debug("Ignoring update-peer message: peerManager is nil (shutdown in progress)")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
jsonData, err := json.Marshal(msg.Data)
|
jsonData, err := json.Marshal(msg.Data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("Error marshaling data: %v", err)
|
logger.Error("Error marshaling data: %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user