From 9cccc0f26b3336f329755cc1d1e6811b42f6f0df Mon Sep 17 00:00:00 2001
From: vx3r <vx3r@127-0-0-1.fr>
Date: Sat, 1 Feb 2020 16:08:37 +0900
Subject: [PATCH] indent generated json

---
 Dockerfile.dev           | 20 ++++++++++++++++++++
 README.md                |  2 +-
 repository/repository.go |  2 +-
 3 files changed, 22 insertions(+), 2 deletions(-)
 create mode 100644 Dockerfile.dev

diff --git a/Dockerfile.dev b/Dockerfile.dev
new file mode 100644
index 0000000..05bf312
--- /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 9a563ec..a08e546 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 193abec..53e6016 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
 	}
-- 
GitLab