Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instuctions for updating cloudflared binary. #215

Merged
merged 5 commits into from
Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions docs/guides/dns-over-https.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Along with releasing their DNS service [1.1.1.1](https://blog.cloudflare.com/ann

In the following sections, we will be covering how to install and configure this tool on `Pi-hole`.

**Note:** The `cloudflared` binary will work with other DoH providers (for example, you could use `https://8.8.8.8/dns-query` for Google's DNS-Over-HTTPS service).

### Installing `cloudflared`

The installation is fairly straightforward, however, be aware of what architecture you are installing on (`amd64` or `arm`).
Expand Down Expand Up @@ -60,7 +62,7 @@ sudo useradd -s /usr/sbin/nologin -r -M cloudflared
Proceed to create a configuration file for `cloudflared` by copying the following in to `/etc/default/cloudflared`. This file contains the command-line options that get passed to cloudflared on startup:

```bash
# Commandline args for cloudflared
# Commandline args for cloudflared, using Cloudflare DNS
CLOUDFLARED_OPTS=--port 5053 --upstream https://1.1.1.1/dns-query --upstream https://1.0.0.1/dns-query
```

Expand Down Expand Up @@ -177,7 +179,13 @@ Finally, configure Pi-hole to use the local `cloudflared` service as the upstrea

### Updating `cloudflared`

#### Manual way
The `cloudflared` tool will not receive updates through the package manager. However, you should keep the program update to date. You can either do this manually, or via a cron script.

The procedure for updating depends on how you configured the `cloudflared` binary.

#### If you configured cloudflared with your own service files

If you configured `cloudflared` manually (by writing a systemd unit yourself), to update the binary you'll simply redownload the binary from the same link, and repeat the install procedure.

```bash
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
Expand All @@ -190,13 +198,27 @@ cloudflared -v
sudo systemctl status cloudflared
```

#### Automatic way
#### If you configued cloudflared via `service install`

If you configured `cloudflared` using their `service install` command, then you can use the built in update command.

```bash
sudo cloudflared update
sudo systemctl restart cloudflared
```

#### Automating Cloudflared Updates

If you want to have the system update `cloudflared` automatically, simply place the update commands for your configuration method in the
file `/etc/cron.weekly/cloudflared-updater.sh`, and adjust permissions:

```bash
sudo chmod +x /etc/cron.weekly/cloudflared-updater.sh
sudo chown root:root /etc/cron.weekly/cloudflared-updater.sh
```

The system will now attempt to update the cloudflared binary automatically, once per week.

### Uninstalling `cloudflared`

#### If installed the manual way
Expand Down