This commit is contained in:
Maxim Devaev 2023-04-22 21:37:14 +03:00
parent f73327b301
commit 9cb12a4d75
1 changed files with 29 additions and 29 deletions

View File

@ -43,45 +43,45 @@ Unfortunately Cloudflare does not provide binaries for ARM so we need to compile
2. Create the service configuration file 2. Create the service configuration file
``` ```
# systemctl edit --full cloudflared.service # systemctl edit --full cloudflared.service
``` ```
3. Insert the following configuration replacing TOKEN VALUE with your token from the Cloudflare tunnel step. 3. Insert the following configuration replacing TOKEN VALUE with your token from the Cloudflare tunnel step.
```ini ```ini
[Unit] [Unit]
Description=Cloudflare Tunnel Description=Cloudflare Tunnel
After=network.target After=network.target
[Service] [Service]
TimeoutStartSec=0 TimeoutStartSec=0
Type=notify Type=notify
ExecStart=/usr/bin/cloudflared --protocol quic tunnel run --token <TOKEN VALUE> ExecStart=/usr/bin/cloudflared --protocol quic tunnel run --token <TOKEN VALUE>
Restart=on-failure Restart=on-failure
RestartSec=5s RestartSec=5s
``` ```
4. Afterwards verify service is started and stays running 4. Afterwards verify service is started and stays running
``` ```
# systemctl enable --now cloudflared # systemctl enable --now cloudflared
# systemctl status cloudflared # systemctl status cloudflared
``` ```
5. Open a web browser and attempt 5. Open a web browser and attempt
## Updating cloudflared ## Updating cloudflared
1. Use these commands to update the ```cloudflared``` daemon: Use these commands to update the ```cloudflared``` daemon:
``` ```
# rw # rw
# rm -rf cloudflared/ # rm -rf cloudflared/
# curl -s https://api.github.com/repos/cloudflare/cloudflared/releases/latest | grep "tarball_url" | cut -d '"' -f 4 | xargs curl -LJo cloudflared-latest.tar.gz # curl -s https://api.github.com/repos/cloudflare/cloudflared/releases/latest | grep "tarball_url" | cut -d '"' -f 4 | xargs curl -LJo cloudflared-latest.tar.gz
# tar -xzvf cloudflared-latest.tar.gz --transform 's|[^/]*/|cloudflared/|' # tar -xzvf cloudflared-latest.tar.gz --transform 's|[^/]*/|cloudflared/|'
# cd cloudflared/cmd/cloudflared/ # cd cloudflared/cmd/cloudflared/
# go build && mv cloudflared /usr/bin/cloudflared # go build && mv cloudflared /usr/bin/cloudflared
# systemctl restart cloudflared # systemctl restart cloudflared
``` ```