summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2022-07-23 20:28:14 -0400
committerGalen Guyer <galen@galenguyer.com>2022-07-23 20:28:14 -0400
commitc4a4f360dbf1f2742c33e551a42de8a70e07d506 (patch)
tree245de5424026b1569e8dffc5998ed80d42a98795
parent80f0f3b7d98d2b5ee3c6d845050874345b81422e (diff)
rename from fdns to hdt
-rw-r--r--Cargo.lock338
-rw-r--r--Cargo.toml4
-rw-r--r--Dockerfile19
-rw-r--r--docker-compose.yaml4
-rw-r--r--pkg/DEBIAN/control2
-rwxr-xr-xpkg/DEBIAN/postinst8
-rw-r--r--pkg/usr/lib/systemd/system/hdt-api.service (renamed from pkg/usr/lib/systemd/system/fdns-api.service)6
-rw-r--r--src/extractors.rs4
-rw-r--r--src/main.rs2
-rw-r--r--src/routes/v1/users.rs2
-rw-r--r--src/routes/v1/zones.rs8
11 files changed, 271 insertions, 126 deletions
diff --git a/Cargo.lock b/Cargo.lock
index d8ac00a..c6acc8a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -219,6 +219,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e31aa570361918e61453e3b5377976b23e4599e8bb5b840380ecd3a20e691d2"
[[package]]
+name = "core-foundation"
+version = "0.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "core-foundation-sys"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
+
+[[package]]
name = "cpufeatures"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -331,32 +347,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71"
[[package]]
-name = "fdns-api"
-version = "0.1.3"
+name = "fastrand"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf"
dependencies = [
- "addr",
- "anyhow",
- "axum",
- "bcrypt",
- "chrono",
- "dotenvy",
- "hex",
- "hmac",
- "jwt",
- "lazy_static",
- "log",
- "mime",
- "rand",
- "serde",
- "serde_json",
- "sha2",
- "sqlx",
- "tokio",
- "totp-rs",
- "tower",
- "tower-http",
- "tracing-subscriber",
- "uuid",
+ "instant",
]
[[package]]
@@ -366,6 +362,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
+name = "foreign-types"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
+dependencies = [
+ "foreign-types-shared",
+]
+
+[[package]]
+name = "foreign-types-shared"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
+
+[[package]]
name = "form_urlencoded"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -467,6 +478,35 @@ dependencies = [
]
[[package]]
+name = "hdt-api"
+version = "0.1.3"
+dependencies = [
+ "addr",
+ "anyhow",
+ "axum",
+ "bcrypt",
+ "chrono",
+ "dotenvy",
+ "hex",
+ "hmac",
+ "jwt",
+ "lazy_static",
+ "log",
+ "mime",
+ "rand",
+ "serde",
+ "serde_json",
+ "sha2",
+ "sqlx",
+ "tokio",
+ "totp-rs",
+ "tower",
+ "tower-http",
+ "tracing-subscriber",
+ "uuid",
+]
+
+[[package]]
name = "heck"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -743,6 +783,24 @@ dependencies = [
]
[[package]]
+name = "native-tls"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9"
+dependencies = [
+ "lazy_static",
+ "libc",
+ "log",
+ "openssl",
+ "openssl-probe",
+ "openssl-sys",
+ "schannel",
+ "security-framework",
+ "security-framework-sys",
+ "tempfile",
+]
+
+[[package]]
name = "nom"
version = "7.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -797,6 +855,51 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
[[package]]
+name = "openssl"
+version = "0.10.41"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0"
+dependencies = [
+ "bitflags",
+ "cfg-if",
+ "foreign-types",
+ "libc",
+ "once_cell",
+ "openssl-macros",
+ "openssl-sys",
+]
+
+[[package]]
+name = "openssl-macros"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "openssl-probe"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
+
+[[package]]
+name = "openssl-sys"
+version = "0.9.75"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f"
+dependencies = [
+ "autocfg",
+ "cc",
+ "libc",
+ "pkg-config",
+ "vcpkg",
+]
+
+[[package]]
name = "parking_lot"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -841,7 +944,7 @@ dependencies = [
"libc",
"redox_syscall",
"smallvec",
- "windows-sys",
+ "windows-sys 0.34.0",
]
[[package]]
@@ -889,6 +992,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
+name = "pkg-config"
+version = "0.3.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
+
+[[package]]
name = "ppv-lite86"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -978,53 +1087,57 @@ dependencies = [
]
[[package]]
-name = "ring"
-version = "0.16.20"
+name = "remove_dir_all"
+version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
+checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [
- "cc",
- "libc",
- "once_cell",
- "spin",
- "untrusted",
- "web-sys",
"winapi",
]
[[package]]
-name = "rustls"
-version = "0.19.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7"
-dependencies = [
- "base64",
- "log",
- "ring",
- "sct",
- "webpki",
-]
-
-[[package]]
name = "ryu"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
[[package]]
+name = "schannel"
+version = "0.1.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"
+dependencies = [
+ "lazy_static",
+ "windows-sys 0.36.1",
+]
+
+[[package]]
name = "scopeguard"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
-name = "sct"
-version = "0.6.1"
+name = "security-framework"
+version = "2.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc"
+dependencies = [
+ "bitflags",
+ "core-foundation",
+ "core-foundation-sys",
+ "libc",
+ "security-framework-sys",
+]
+
+[[package]]
+name = "security-framework-sys"
+version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce"
+checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556"
dependencies = [
- "ring",
- "untrusted",
+ "core-foundation-sys",
+ "libc",
]
[[package]]
@@ -1127,12 +1240,6 @@ dependencies = [
]
[[package]]
-name = "spin"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
-
-[[package]]
name = "sqlformat"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1189,7 +1296,6 @@ dependencies = [
"paste",
"percent-encoding",
"rand",
- "rustls",
"serde",
"serde_json",
"sha-1",
@@ -1202,8 +1308,6 @@ dependencies = [
"tokio-stream",
"url",
"uuid",
- "webpki",
- "webpki-roots",
"whoami",
]
@@ -1232,9 +1336,10 @@ version = "0.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4db708cd3e459078f85f39f96a00960bd841f66ee2a669e90bf36907f5a79aae"
dependencies = [
+ "native-tls",
"once_cell",
"tokio",
- "tokio-rustls",
+ "tokio-native-tls",
]
[[package]]
@@ -1271,6 +1376,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8"
[[package]]
+name = "tempfile"
+version = "3.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
+dependencies = [
+ "cfg-if",
+ "fastrand",
+ "libc",
+ "redox_syscall",
+ "remove_dir_all",
+ "winapi",
+]
+
+[[package]]
name = "thiserror"
version = "1.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1356,14 +1475,13 @@ dependencies = [
]
[[package]]
-name = "tokio-rustls"
-version = "0.22.0"
+name = "tokio-native-tls"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6"
+checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
dependencies = [
- "rustls",
+ "native-tls",
"tokio",
- "webpki",
]
[[package]]
@@ -1545,12 +1663,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e"
[[package]]
-name = "untrusted"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
-
-[[package]]
name = "url"
version = "2.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1579,6 +1691,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
+name = "vcpkg"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+
+[[package]]
name = "version_check"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1671,25 +1789,6 @@ dependencies = [
]
[[package]]
-name = "webpki"
-version = "0.21.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "webpki-roots"
-version = "0.21.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940"
-dependencies = [
- "webpki",
-]
-
-[[package]]
name = "whoami"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1727,11 +1826,24 @@ version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825"
dependencies = [
- "windows_aarch64_msvc",
- "windows_i686_gnu",
- "windows_i686_msvc",
- "windows_x86_64_gnu",
- "windows_x86_64_msvc",
+ "windows_aarch64_msvc 0.34.0",
+ "windows_i686_gnu 0.34.0",
+ "windows_i686_msvc 0.34.0",
+ "windows_x86_64_gnu 0.34.0",
+ "windows_x86_64_msvc 0.34.0",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
+dependencies = [
+ "windows_aarch64_msvc 0.36.1",
+ "windows_i686_gnu 0.36.1",
+ "windows_i686_msvc 0.36.1",
+ "windows_x86_64_gnu 0.36.1",
+ "windows_x86_64_msvc 0.36.1",
]
[[package]]
@@ -1741,30 +1853,60 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d"
[[package]]
+name = "windows_aarch64_msvc"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
+
+[[package]]
name = "windows_i686_gnu"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed"
[[package]]
+name = "windows_i686_gnu"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
+
+[[package]]
name = "windows_i686_msvc"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956"
[[package]]
+name = "windows_i686_msvc"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
+
+[[package]]
name = "windows_x86_64_gnu"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4"
[[package]]
+name = "windows_x86_64_gnu"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
+
+[[package]]
name = "windows_x86_64_msvc"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9"
[[package]]
+name = "windows_x86_64_msvc"
+version = "0.36.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
+
+[[package]]
name = "zeroize"
version = "1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index da67d51..410b520 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "fdns-api"
+name = "hdt-api"
version = "0.1.3"
edition = "2021"
@@ -22,7 +22,7 @@ rand = "0.8.5"
serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.81"
sha2 = "0.10.2"
-sqlx = { version = "0.5.13", features = ["postgres", "runtime-tokio-rustls", "chrono", "uuid"] }
+sqlx = { version = "0.5.13", features = ["postgres", "runtime-tokio-native-tls", "chrono", "uuid"] }
tokio = { version = "1.18.2", features = ["full"] }
totp-rs = "2.0.0"
tower = "0.4.12"
diff --git a/Dockerfile b/Dockerfile
index a01f4b7..b71d809 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,22 +1,25 @@
-FROM rust:1.61-bullseye AS builder
+FROM rust:1.62-bullseye AS builder
WORKDIR /src/
-COPY . /src/
+RUN cargo init --bin
+COPY Cargo.toml Cargo.lock ./
RUN cargo build --release
+COPY . /src/
+RUN touch src/main.rs && cargo build --release
FROM scratch AS bin
-COPY --from=builder /src/target/release/fdns-api /fdns-api
+COPY --from=builder /src/target/release/hdt-api /hdt-api
-FROM debian:buster AS deb-builder
+FROM debian:bullseye AS deb-builder
ARG VERSION
WORKDIR /root/
COPY pkg/ /root/pkg/
-COPY --from=bin /fdns-api pkg/usr/bin/fdns-api
-RUN sed -i "s/[{][{] VERSION [}][}]/$(pkg/usr/bin/fdns-api --version)/g" ./pkg/DEBIAN/control
-RUN dpkg -b pkg fdns-api_"$(pkg/usr/bin/fdns-api --version)"_amd64.deb
+COPY --from=bin /hdt-api pkg/usr/bin/hdt-api
+RUN sed -i "s/[{][{] VERSION [}][}]/$(pkg/usr/bin/hdt-api --version)/g" ./pkg/DEBIAN/control
+RUN dpkg -b pkg hdt-api_"$(pkg/usr/bin/hdt-api --version)"_amd64.deb
FROM scratch AS deb
ARG VERSION
-COPY --from=deb-builder /root/fdns-api_*_amd64.deb /
+COPY --from=deb-builder /root/hdt-api_*_amd64.deb /
diff --git a/docker-compose.yaml b/docker-compose.yaml
index eb681ac..b326de8 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -2,9 +2,9 @@ services:
postgres:
image: docker.io/library/postgres:14-bullseye
environment:
- - "POSTGRES_USER=fdns"
+ - "POSTGRES_USER=hostsdottxt"
- "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}"
- - "POSTGRES_DB=fdns"
+ - "POSTGRES_DB=hostsdottxt"
- "PGDATA=/var/lib/postgresql/data/pgdata"
ports:
- 127.0.0.1:5432:5432
diff --git a/pkg/DEBIAN/control b/pkg/DEBIAN/control
index 3cb16c0..5434df0 100644
--- a/pkg/DEBIAN/control
+++ b/pkg/DEBIAN/control
@@ -1,4 +1,4 @@
-Package: fdns-api
+Package: hdt-api
Version: {{ VERSION }}
Architecture: amd64
Essential: no
diff --git a/pkg/DEBIAN/postinst b/pkg/DEBIAN/postinst
index 2a2cc23..7f658fb 100755
--- a/pkg/DEBIAN/postinst
+++ b/pkg/DEBIAN/postinst
@@ -1,8 +1,8 @@
#!/bin/sh
-if [ ! -f /etc/fdns.env ]; then
- echo "DATABASE_URL=" >> /etc/fdns.env
- echo "JWT_SECRET=" >> /etc/fdns.env
+if [ ! -f /etc/hostsdottxt.env ]; then
+ echo "DATABASE_URL=" >> /etc/hostsdottxt.env
+ echo "JWT_SECRET=" >> /etc/hostsdottxt.env
fi
-systemctl is-active --quiet fdns-api && systemctl restart fdns-api || true
+systemctl is-active --quiet hdt-api && systemctl restart hdt-api || true
diff --git a/pkg/usr/lib/systemd/system/fdns-api.service b/pkg/usr/lib/systemd/system/hdt-api.service
index 502d5f8..ae65e44 100644
--- a/pkg/usr/lib/systemd/system/fdns-api.service
+++ b/pkg/usr/lib/systemd/system/hdt-api.service
@@ -1,5 +1,5 @@
[Unit]
-Description=FDNS API
+Description=HOSTSdotTXT API
After=network.target
After=systemd-user-sessions.service
After=network-online.target
@@ -7,8 +7,8 @@ After=network-online.target
[Service]
Type=simple
Restart=always
-EnvironmentFile=/etc/fdns.env
-ExecStart=/usr/bin/fdns-api
+EnvironmentFile=/etc/hostsdottxt.env
+ExecStart=/usr/bin/hdt-api
[Install]
WantedBy=multi-user.target
diff --git a/src/extractors.rs b/src/extractors.rs
index 805b5c5..23a0d6c 100644
--- a/src/extractors.rs
+++ b/src/extractors.rs
@@ -63,7 +63,7 @@ where
Some(header) => {
let key: Hmac<Sha256> = Hmac::new_from_slice((*JWT_SECRET).as_bytes()).unwrap();
let token = header.replace("Bearer ", "");
- if token.starts_with("fdns_") {
+ if token.starts_with("hdt_") {
let mut hasher = Sha256::new();
hasher.update(token.as_bytes());
let digest = hasher.finalize();
@@ -81,7 +81,7 @@ where
}
};
let token = Token {
- iss: "fdns".to_owned(),
+ iss: "hostsdottxt".to_owned(),
sub: user.id,
iat: 0,
exp: 0,
diff --git a/src/main.rs b/src/main.rs
index c2f8b62..3190db3 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -35,7 +35,7 @@ async fn main() {
// Set logging levels if not already set
if env::var_os("RUST_LOG").is_none() {
- env::set_var("RUST_LOG", "fdns_api=debug,tower_http=debug");
+ env::set_var("RUST_LOG", "hdt_api=debug,tower_http=debug");
}
// Initialize tracing with previously set logging levels
diff --git a/src/routes/v1/users.rs b/src/routes/v1/users.rs
index 36206c7..fe932cf 100644
--- a/src/routes/v1/users.rs
+++ b/src/routes/v1/users.rs
@@ -159,7 +159,7 @@ fn issue_jwt(user: User) -> String {
let sub = user.id.to_string();
// https://www.iana.org/assignments/jwt/jwt.xhtml
- claims.insert("iss", "fdns");
+ claims.insert("iss", "hostsdottxt");
claims.insert("sub", &sub);
claims.insert("iat", &iat);
claims.insert("exp", &exp);
diff --git a/src/routes/v1/zones.rs b/src/routes/v1/zones.rs
index d863948..5336d28 100644
--- a/src/routes/v1/zones.rs
+++ b/src/routes/v1/zones.rs
@@ -14,10 +14,10 @@ use std::sync::Arc;
lazy_static! {
static ref NAMESERVERS: Vec<String> = Vec::from([
- String::from("ns1.fdns.dev."),
- String::from("ns2.fdns.dev."),
- String::from("ns3.fdns.dev."),
- String::from("ns4.fdns.dev.")
+ String::from("ns1.hostsdottxt.net."),
+ String::from("ns2.hostsdottxt.net."),
+ String::from("ns3.hostsdottxt.net."),
+ String::from("ns4.hostsdottxt.net.")
]);
}