diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000000000000000000000000000000000000..05bf31281d63f36abeb68debfae97caa941d6361 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,20 @@ +FROM golang as build-back +WORKDIR /wg-gen-web +ADD . . +RUN go build -o wg-gen-web-linux-amd64 + +FROM node:10-alpine as build-front +WORKDIR /ui +ADD ui . +RUN npm install +RUN npm run build + +FROM debian:stable-slim +WORKDIR /app +COPY --from=build-back /wg-gen-web/wg-gen-web-linux-amd64 . +COPY --from=build-front /ui/dist ./ui/dist +ADD .env . +RUN chmod +x ./wg-gen-web-linux-amd64 +EXPOSE 8080 + +CMD ["/app/wg-gen-web-linux-amd64"] diff --git a/README.md b/README.md index 9a563ec04c1f22aaa2833e1e4e8f5c4b2b3c042a..a08e54649f2b1f4aa3cd15dbc6da67598af4dc56 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ Feel free to modify this file in order to use your existing keys ## What is out of scope * Generation or application of any `iptables` or `nftables` rules - * Application of configuration to WireGuard + * Application of configuration to WireGuard by Wg Gen Web itself ## TODO diff --git a/repository/repository.go b/repository/repository.go index 193abecbe4d6b4186120b192a52916954ce7d847..53e6016dd3495dbc247e69d523e74b2baa33b105 100644 --- a/repository/repository.go +++ b/repository/repository.go @@ -258,7 +258,7 @@ func UpdateServer(server *model.Server) (*model.Server, error) { // Write object to disk func serialize(id string, c interface{}) error { - b, err := json.Marshal(c) + b, err := json.MarshalIndent(c, "", " ") if err != nil { return err }