summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2022-05-25 18:13:33 -0400
committerGalen Guyer <galen@galenguyer.com>2022-05-25 18:13:33 -0400
commit678ce8e205dedb4c4cd14f5ff7df739aea1da0c8 (patch)
tree891f678b87c15157c6d9c81a3b64b3fb17c5d509
parentc76d607abc6487be8b7adc0e97ed18b6c0b46c13 (diff)
update installation script
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--Dockerfile6
-rwxr-xr-xpkg/DEBIAN/postinst2
-rw-r--r--src/routes/v1/repsonse.rs7
5 files changed, 5 insertions, 14 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 629c657..634cc03 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -332,7 +332,7 @@ checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71"
[[package]]
name = "fdns-api"
-version = "0.1.0"
+version = "0.1.1"
dependencies = [
"addr",
"anyhow",
diff --git a/Cargo.toml b/Cargo.toml
index e70b26c..8007708 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "fdns-api"
-version = "0.1.0"
+version = "0.1.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/Dockerfile b/Dockerfile
index 3db9a4a..a01f4b7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,9 +1,5 @@
FROM rust:1.61-bullseye AS builder
WORKDIR /src/
-RUN cargo init --bin
-COPY Cargo.toml Cargo.lock /src/
-RUN cargo build --release
-
COPY . /src/
RUN cargo build --release
@@ -23,4 +19,4 @@ RUN dpkg -b pkg fdns-api_"$(pkg/usr/bin/fdns-api --version)"_amd64.deb
FROM scratch AS deb
ARG VERSION
-COPY --from=deb-builder /root/fdns-api_*_amd64.deb / \ No newline at end of file
+COPY --from=deb-builder /root/fdns-api_*_amd64.deb /
diff --git a/pkg/DEBIAN/postinst b/pkg/DEBIAN/postinst
index 226526e..2a2cc23 100755
--- a/pkg/DEBIAN/postinst
+++ b/pkg/DEBIAN/postinst
@@ -4,3 +4,5 @@ if [ ! -f /etc/fdns.env ]; then
echo "DATABASE_URL=" >> /etc/fdns.env
echo "JWT_SECRET=" >> /etc/fdns.env
fi
+
+systemctl is-active --quiet fdns-api && systemctl restart fdns-api || true
diff --git a/src/routes/v1/repsonse.rs b/src/routes/v1/repsonse.rs
deleted file mode 100644
index cb35a41..0000000
--- a/src/routes/v1/repsonse.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-use serde::{Deserialize, Serialize};
-
-#[derive(Serialize, Deserialize, Debug)]
-pub struct ErrorMessage {
- pub error: String,
- pub reason: Option<String>,
-}