diff --git a/Makefile b/Makefile index 60d164f..6382646 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,9 @@ watch: lint: golangci-lint run --enable-all +tooling: + go get github.com/krishicks/yaml-patch/cmd/yaml-patch + clean: rm -rf release rm -rf data diff --git a/misc/release/config-patch.yml b/misc/release/config-patch.yml new file mode 100644 index 0000000..cf62cd6 --- /dev/null +++ b/misc/release/config-patch.yml @@ -0,0 +1,10 @@ +--- +- op: replace + path: /data/path + value: /var/lib/fake-smtp/data.db +- op: replace + path: /smtp/address + value: 127.0.0.1:2525 +- op: replace + path: /smtp/debug + value: false \ No newline at end of file diff --git a/misc/script/release.sh b/misc/script/release.sh index f88257e..1f1fbba 100755 --- a/misc/script/release.sh +++ b/misc/script/release.sh @@ -75,10 +75,12 @@ function dump_default_conf { local os=$2 local arch=$3 local tmp_conf=$(mktemp) + local patched_conf=$(mktemp) go run "$PROJECT_DIR/cmd/$command" -dump-config > "$tmp_conf" - copy "$command" $os $arch "$tmp_conf" "$command.yml" - rm -f "$tmp_conf" + cat "$tmp_conf" | yaml-patch -o misc/release/config-patch.yml > "$patched_conf" + copy "$command" $os $arch "$patched_conf" "config.yml" + rm -f "$tmp_conf" "$patched_conf" } function compress { diff --git a/misc/systemd/server.service b/misc/systemd/server.service deleted file mode 100644 index 4ea59b9..0000000 --- a/misc/systemd/server.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=fake-smtp -After=network-online.target - -[Service] -Type=simple -ExecStart=/usr/local/bin/fake-smtp -workdir /usr/local/share/fake-smtp -config /etc/fake-smtp/config.yml -Restart=on-failure - -[Install] -WantedBy=multi-user.target \ No newline at end of file