feat: Update install instructions
All checks were successful
Build Docker / Build_Docker (push) Successful in 1m6s

This commit is contained in:
Nathan Woodburn 2024-06-20 13:58:44 +10:00
parent 03da062387
commit de7dd7fe9a
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
9 changed files with 137 additions and 33 deletions

4
Caddyfile Normal file
View File

@ -0,0 +1,4 @@
hnsdoh.com {
reverse_proxy h2c://127.0.0.1:8053
tls /etc/letsencrypt/live/hnsdoh.com/fullchain.pem /etc/letsencrypt/live/hnsdoh.com/privkey.pem
}

View File

@ -1,29 +1,14 @@
newServer({address="194.50.5.26", name="Nathan.Woodburn/ 1"})
newServer({address="194.50.5.27", name="Nathan.Woodburn/ 2"})
newServer({address="194.50.5.28", name="Nathan.Woodburn/ 3"})
newServer({address="139.144.68.241", name="HNSDNS 1"})
newServer({address="139.144.68.242", name="HNSDNS 2"})
newServer({address="127.0.0.1:5353", name="HSD"})
-- These might not work correctly
newServer({address="192.198.87.44:443", tls="openssl", subjectName="hnsns.net", dohPath="/dns-query", validateCertificates=true, name="HNSNS"})
newServer({address="178.128.128.181:443", tls="openssl", subjectName="hs.dnssec.dev", dohPath="/dns-query", validateCertificates=true, name="Impervious"})
-- Uncomment to add IPv6 servers
-- newServer({address="2a01:7e01:e002:c300::", name="HNSDNS 3"})
-- newServer({address="2a01:7e01:e002:c300::", name="HNSDNS 4"})
addDOHLocal('0.0.0.0', '/etc/letsencrypt/live/hnsdoh.com/fullchain.pem', '/etc/letsencrypt/live/hnsdoh.com/privkey.pem', {"/", "/dns-query"}, { reusePort=true })
addTLSLocal('0.0.0.0', '/etc/letsencrypt/live/hnsdoh.com/fullchain.pem', '/etc/letsencrypt/live/hnsdoh.com/privkey.pem')
setLocal('0.0.0.0:53')
addLocal('0.0.0.0:53', {reusePort=true})
addDOHLocal("127.0.0.1:8053", nil, nil, {"/", "/dns-query"}, { reusePort=true })
addTLSLocal('0.0.0.0', '/etc/letsencrypt/live/hnsdoh.com/fullchain.pem', '/etc/letsencrypt/live/hnsdoh.com/privkey.pem', { reusePort=true })
addACL('0.0.0.0/0')
map = { newDOHResponseMapEntry("^/$", 307, "https://welcome.hnsdoh.com") }
dohFE = getDOHFrontend(0)
dohFE:setResponsesMap(map)
-- Feel free to change the control socket key
setKey("csl2icaGACsP3+M9tx55c8+dBxVCnlnqAHEC92P55eo=")
controlSocket('127.0.0.1:5199')

22
hsd.service Normal file
View File

@ -0,0 +1,22 @@
[Unit]
Description=hsd
After=network.target
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
Environment=HSD_PREFIX=/root/.hsd
ExecStart=/root/.nvm/versions/node/v20.14.0/bin/node /root/hsd/bin/hsd \
--spv \
--api-key=8xJc4QC1j1xJYbo3 \
--rs-host=0.0.0.0 \
--agent=HNSDoH \
--http-host=0.0.0.0 \
--wallet-http-host=0.0.0.0 \
--rs-port=5353 \
--log-level=warning
[Install]
WantedBy=multi-user.target

View File

@ -18,12 +18,43 @@ sudo systemctl restart systemd-resolved
# Move the conf file to the correct location
sudo cp ./dnsdist.conf /etc/dnsdist/dnsdist.conf
# Replace the user and group in the dnsdist.service file to root
# Like this
# User=root
# Group=root
sudo cp ./dnsdist.service /lib/systemd/system/dnsdist.service
sudo systemctl daemon-reload
# Restart dnsdist
sudo systemctl restart dnsdist
# Install caddy
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy -y
# Move the Caddyfile to the correct location
sudo cp ./Caddyfile /etc/caddy/Caddyfile
# Restart caddy
sudo systemctl restart caddy
# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
cd /root # Double check this path
# Install Node.js
nvm install 20.14.0
npm install -g node-gyp
# Install HSD
git clone --depth 1 --branch latest https://github.com/handshake-org/hsd.git
cd hsd
npm install --omit=dev
sudo cp ./hsd.service /lib/systemd/system/hsd.service
sudo systemctl daemon-reload
sudo systemctl enable hsd
sudo systemctl start hsd

28
test.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# Get Node IPs
RESOLVED_IPS=$(dig +short hnsdoh.com)
NODE_IPS=($RESOLVED_IPS)
if [ ${#NODE_IPS[@]} -eq 0 ]; then
echo "No IP addresses resolved for hnsdoh.com. Exiting."
exit 1
fi
# Define the domain and host for kdig commands
TLS_HOST="hnsdoh.com"
DOH_URL="https://hnsdoh.com/dns-query"
# Loop over each IP and run the kdig commands
for NODE_IP in "${NODE_IPS[@]}"
do
echo "Running kdig commands for NODE_IP=$NODE_IP"
# Run the kdig commands
kdig +tls +tls-host=$TLS_HOST @$NODE_IP 1.wdbrn TXT +short
kdig +tls-ca +https=@$DOH_URL @$NODE_IP 2.wdbrn TXT +short
kdig @$NODE_IP 3.wdbrn TXT +short
echo "Completed kdig commands for NODE_IP=$NODE_IP"
echo "--------------------------------------------"
done

33
test_inf.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
# Get Node IPs
RESOLVED_IPS=$(dig +short hnsdoh.com)
NODE_IPS=($RESOLVED_IPS)
if [ ${#NODE_IPS[@]} -eq 0 ]; then
echo "No IP addresses resolved for hnsdoh.com. Exiting."
exit 1
fi
# Define the domain and host for kdig commands
TLS_HOST="hnsdoh.com"
DOH_URL="https://hnsdoh.com/dns-query"
while true; do
# Loop over each IP and run the kdig commands
for NODE_IP in "${NODE_IPS[@]}"
do
echo "Running kdig commands for NODE_IP=$NODE_IP"
# Run the kdig commands
kdig +tls +tls-host=$TLS_HOST @$NODE_IP 1.wdbrn TXT +short
kdig +tls-ca +https=@$DOH_URL @$NODE_IP 2.wdbrn TXT +short
kdig @$NODE_IP 3.wdbrn TXT +short
echo "Completed kdig commands for NODE_IP=$NODE_IP"
echo "--------------------------------------------"
done
done

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -200,12 +200,12 @@
<td>139.177.195.185</td>
</tr>
<tr>
<td><a href="https://ezdomains.io/" style="color: rgb(255,255,255);" target="_blank">EZ Domains</a></td>
<td><a data-bs-toggle="tooltip" data-bss-tooltip="" href="https://ezdomains.io/" style="color: rgb(255,255,255);" target="_blank" title="This node is managed by Nathan.Woodburn/">EZ Domains*</a></td>
<td>Netherlands</td>
<td>172.233.46.92</td>
</tr>
<tr>
<td><a href="https://ezdomains.io/" style="color: rgb(255,255,255);" target="_blank">EZ Domains</a></td>
<td><a data-bs-toggle="tooltip" data-bss-tooltip="" href="https://ezdomains.io/" style="color: rgb(255,255,255);" target="_blank" title="This node is managed by Nathan.Woodburn/">EZ Domains*</a></td>
<td>Singapore</td>
<td>172.105.120.203</td>
</tr>
@ -223,6 +223,7 @@
</div>
</footer>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/bs-init.js"></script>
</body>
</html>