-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeno-dns-over-https-server.sh
More file actions
44 lines (32 loc) · 1.51 KB
/
deno-dns-over-https-server.sh
File metadata and controls
44 lines (32 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
if [ -z "$APP_DOH" ]; then
export APP_DOH="https://dns.alidns.com/dns-query"
fi
echo "APP_DOH:$APP_DOH"
if [ -z "$APP_TOKEN" ]; then
export APP_TOKEN="************************************"
fi
echo "APP_TOKEN:$APP_TOKEN"
if [ -z "$APP_SERVE_PORT" ]; then
export APP_SERVE_PORT="48000"
fi
echo "APP_SERVE_PORT:$APP_SERVE_PORT"
if [ -z "$mongodb_url" ]; then
export mongodb_url="mongodb+srv://deno-dns-over-https-server:****************@****************************/?authMechanism=SCRAM-SHA-1&tls=true"
fi
if [ -z "$mongodb_collection" ]; then
export mongodb_collection="deno-dns-over-https-server"
fi
if [ -z "$mongodb_db" ]; then
export mongodb_db="deno-dns-over-https-server"
fi
echo "mongodb_url:$mongodb_url"
echo "mongodb_collection:$mongodb_collection"
echo "mongodb_db:$mongodb_db"
cd /root/deno-dns-over-https-server-main
rm deno.lock
while true
do
npx -y cross-env "doh=$APP_DOH" ttl=300 "token=$APP_TOKEN" "mongodb_url=$mongodb_url" "mongodb_collection=$mongodb_collection" "mongodb_db=$mongodb_db" deno run --unstable-kv --unstable-net -A main.tsx "--port=$APP_SERVE_PORT"
done
# npx -y cross-env "doh=https://dns.alidns.com/dns-query" ttl=300 "token=************************************" "mongodb_url=mongodb+srv://deno-dns-over-https-server:****************@****************************/?authMechanism=SCRAM-SHA-1&tls=true" mongodb_collection=deno-dns-over-https-server mongodb_db=deno-dns-over-https-server deno run --unstable-kv -A main.tsx --port=48000