-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwrangler.toml
More file actions
145 lines (125 loc) · 5.12 KB
/
wrangler.toml
File metadata and controls
145 lines (125 loc) · 5.12 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# #
# Cloudflare Worker > DoH (DNS over HTTPS)
#
# @usage Setup
# git clone https://github.com/Aetherinox/dns-over-https-worker .
# npm config --global set cache "X:\NodeJS\cache"
# npm config --global set prefix "X:\NodeJS\npm"
# npm uninstall wrangler --save-dev
# npm install wrangler --save-dev
# wrangler login
# wrangler whoami
#
# Production
# wrangler dev -e production
# wrangler deploy --minify -e production
#
# Dev
# wrangler dev -e dev
# wrangler deploy -e dev
#
# @tests curl https://github.com/status --doh-url https://doh.username.workers.dev/dns-query
# curl -v https://github.com/status --doh-url https://doh.username.workers.dev/dns-query
# curl -vH "accept: application/dns-json" "https://doh.username.workers.dev/dns-query?name=github.com/status&type=A"
# curl -vkH "accept: application/dns-json" "https://127.0.0.1/dns-query?name=github.com/status&type=A"
#
# @browser To utilize this worker in your browser for DoH; utilize one of the following URLs:
# (Local) https://127.0.0.1:8080/dns-query
# (Cloudflare) https://doh.username.workers.dev/dns-query
#
# @worker https://deploy.workers.cloudflare.com/?url=https://github.com/aetherinox/dns-over-https-worker
# @URLs https://127.0.0.1:8080/dns-query?name=github.com/status&type=A
# https://doh.username.workers.dev/dns-query?name=github.com/status&type=A
# #
name = "doh"
main = "src/index.js"
workers_dev = true
compatibility_flags = [ "nodejs_compat" ]
compatibility_date = "2024-11-11"
# #
# Smart Placement
#
# Once enabled, Smart Placement analyzes the request duration of the Worker in different Cloudflare locations around the
# world on a regular basis. Smart Placement decides where to run the Worker by comparing the estimated request duration
# in the location closest to where the request was received (the default location where the Worker would run) to a set of
# candidate locations around the world. For each candidate location, Smart Placement considers the performance of the Worker
# in that location as well as the network latency added by forwarding the request to that location. If the estimated request
# uration in the best candidate location is significantly faster than the location where the request was received, the
# request will be forwarded to that candidate location. Otherwise, the Worker will run in the default location closest to
# where the request was received.
# #
[placement]
mode = "smart"
# #
# The rate limiting API is in open beta.
# https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
# #
[[unsafe.bindings]]
name = "doh"
type = "ratelimit"
namespace_id = "1001"
simple = { limit = 60, period = 60 }
# #
# [ Environment ] Production
# For production environment, use '-e production'
# #
[env.production]
name = "doh"
workers_dev = true
# #
# [ Environment ] Production - Vars
# #
[env.production.vars]
ENVIRONMENT = "production"
URL_SERVICE_DOH = "https://doh.sb"
URL_SERVICE_JSON = "https://doh.sb"
URL_SERVICE_SUBDOMAIN = "dns-query"
THROTTLE_DAILY_LIMIT = 2000
# #
# The rate limiting API is in open beta.
# https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
# #
[[env.production.unsafe.bindings]]
name = "doh"
type = "ratelimit"
namespace_id = "1001"
simple = { limit = 60, period = 60 }
# #
# [ Environment ] Development
# For dev environment, use '-e dev'
# #
[dev]
port = 8080
local_protocol = "https"
[env.dev]
name = "doh"
workers_dev = true
# #
# [ Environment ] Development - Vars
# #
[env.dev.vars]
ENVIRONMENT = "dev"
URL_SERVICE_DOH = "https://doh.sb"
URL_SERVICE_JSON = "https://doh.sb"
URL_SERVICE_SUBDOMAIN = "dns-query"
THROTTLE_DAILY_LIMIT = 2000
# #
# The rate limiting API is in open beta.
# https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
# #
[[env.dev.unsafe.bindings]]
name = "doh"
type = "ratelimit"
namespace_id = "1001"
simple = { limit = 60, period = 60 }
# #
# Logs
# https://developers.cloudflare.com/workers/observability/logs/
#
# head_sampling_rate between 0 and 1
# 1 100% of logs sampled
# 0.5 50% of logs sampled
# #
[observability]
enabled = true
head_sampling_rate = 1