diff --git a/Dockerfile b/Dockerfile index 671686e7..faaa8a9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,10 @@ ARG version ARG tags WORKDIR /app COPY . . -# RUN mkdir -p /Users/abhishekk/go/src/github.com/gravitl -# ADD ../netclient /Users/abhishekk/go/src/github.com/gravitl ENV GO111MODULE=auto -# RUN apk add git -# RUN GOOS=linux CGO_ENABLED=1 go build ${tags} -ldflags="-s -X 'main.version=${version}'" . +RUN apk add git +RUN GOOS=linux CGO_ENABLED=1 go build ${tags} -ldflags="-s -X 'main.version=${version}'" . # RUN go build -tags=ee . -o netmaker main.go FROM alpine:3.16.2 @@ -18,7 +16,7 @@ RUN apk add gcompat iptables wireguard-tools # set the working directory WORKDIR /root/ RUN mkdir -p /etc/netclient/config -COPY --from=builder /app/bin/netmaker . +COPY --from=builder /app/netmaker . COPY --from=builder /app/config config EXPOSE 8081 ENTRYPOINT ["./netmaker"] diff --git a/controllers/node.go b/controllers/node.go index 97454c94..fdefdc36 100644 --- a/controllers/node.go +++ b/controllers/node.go @@ -34,7 +34,7 @@ func nodeHandlers(r *mux.Router) { r.HandleFunc("/api/nodes/{network}/{nodeid}/createingress", logic.SecurityCheck(false, http.HandlerFunc(createIngressGateway))).Methods("POST") r.HandleFunc("/api/nodes/{network}/{nodeid}/deleteingress", logic.SecurityCheck(false, http.HandlerFunc(deleteIngressGateway))).Methods("DELETE") r.HandleFunc("/api/nodes/{network}/{nodeid}/approve", authorize(false, true, "user", http.HandlerFunc(uncordonNode))).Methods("POST") - r.HandleFunc("/api/nodes/{network}/{nodeid}", authorize(true, true, "node", http.HandlerFunc(createNode))).Methods("POST") + r.HandleFunc("/api/nodes/{network}/{nodeid}", authorize(true, true, "node", http.HandlerFunc(updateNode))).Methods("POST") r.HandleFunc("/api/nodes/{network}", nodeauth(checkFreeTierLimits(node_l, http.HandlerFunc(createNode)))).Methods("POST") r.HandleFunc("/api/nodes/adm/{network}/authenticate", authenticate).Methods("POST") }