Skip to content

Commit f6cc26a

Browse files
authored
Update cloudflared-install.sh (#264)
Added the option to configure cloudflared as a DNS-over-HTTPS (DoH) proxy
1 parent a29ed78 commit f6cc26a

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

install/cloudflared-install.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,41 @@ $STD apt-get update
2828
$STD apt-get install -y cloudflared
2929
msg_ok "Installed Cloudflared"
3030

31+
read -r -p "Would you like to configure cloudflared as a DNS-over-HTTPS (DoH) proxy? <y/N> " prompt
32+
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
33+
msg_info "Creating Service"
34+
cat <<EOF >/usr/local/etc/cloudflared/config.yml
35+
proxy-dns: true
36+
proxy-dns-address: 0.0.0.0
37+
proxy-dns-port: 53
38+
proxy-dns-max-upstream-conns: 5
39+
proxy-dns-upstream:
40+
- https://1.1.1.1/dns-query
41+
- https://1.0.0.1/dns-query
42+
#- https://8.8.8.8/dns-query
43+
#- https://8.8.4.4/dns-query
44+
#- https://9.9.9.9/dns-query
45+
#- https://149.112.112.112/dns-query
46+
EOF
47+
cat <<EOF >/etc/systemd/system/cloudflared.service
48+
[Unit]
49+
Description=cloudflared DNS-over-HTTPS (DoH) proxy
50+
After=syslog.target network-online.target
51+
52+
[Service]
53+
Type=simple
54+
ExecStart=/usr/local/bin/cloudflared --config /usr/local/etc/cloudflared/config.yml
55+
Restart=on-failure
56+
RestartSec=10
57+
KillMode=process
58+
59+
[Install]
60+
WantedBy=multi-user.target
61+
EOF
62+
systemctl enable -q --now cloudflared.service
63+
msg_ok "Created Service"
64+
fi
65+
3166
motd_ssh
3267
customize
3368

json/cloudflared.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"updateable": false,
1010
"privileged": false,
1111
"interface_port": null,
12-
"documentation": null,
12+
"documentation": "https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/",
1313
"website": "https://www.cloudflare.com/",
1414
"logo": "https://raw.githubusercontent.com/loganmarchione/homelab-svg-assets/main/assets/cloudflare.svg",
1515
"description": "Cloudflared is a command-line tool that allows you to securely access resources on the Cloudflare network, such as websites and APIs, from your local computer. It works by creating a secure tunnel between your computer and the Cloudflare network, allowing you to access resources as if they were on your local network.",
@@ -30,5 +30,10 @@
3030
"username": null,
3131
"password": null
3232
},
33-
"notes": []
34-
}
33+
"notes": [
34+
{
35+
"text": "With an option to configure cloudflared as a DNS-over-HTTPS (DoH) proxy"
36+
"type": "info"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)