diff options
3 files changed, 53 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/cloudflared/cloudflared_2026.3.0.bb b/meta-networking/recipes-connectivity/cloudflared/cloudflared_2026.3.0.bb new file mode 100644 index 0000000000..f0b8530a69 --- /dev/null +++ b/meta-networking/recipes-connectivity/cloudflared/cloudflared_2026.3.0.bb | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | SUMMARY = "Cloudflare Tunnel client" | ||
| 2 | DESCRIPTION = "cloudflared is the command-line client for Cloudflare Tunnel, \ | ||
| 3 | a tunneling daemon that proxies traffic from the Cloudflare network to your origins." | ||
| 4 | HOMEPAGE = "https://github.com/cloudflare/cloudflared" | ||
| 5 | SECTION = "networking" | ||
| 6 | |||
| 7 | LICENSE = "Apache-2.0" | ||
| 8 | LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=175792518e4ac015ab6696d16c4f607e" | ||
| 9 | |||
| 10 | SRC_URI = "git://github.com/cloudflare/cloudflared.git;protocol=https;branch=master;destsuffix=${GO_SRCURI_DESTSUFFIX} \ | ||
| 11 | file://cloudflared.service \ | ||
| 12 | file://default \ | ||
| 13 | " | ||
| 14 | SRCREV = "d2a87e9b93456ad7f82417400f4209d513668487" | ||
| 15 | |||
| 16 | GO_IMPORT = "github.com/cloudflare/cloudflared" | ||
| 17 | GO_INSTALL = "${GO_IMPORT}/cmd/cloudflared" | ||
| 18 | GO_LINKSHARED = "" | ||
| 19 | SRCREV_SHORT = "${@d.getVar('SRCREV')[:8]}" | ||
| 20 | GO_EXTRA_LDFLAGS = "-X main.Version=${PV}-${SRCREV_SHORT}" | ||
| 21 | |||
| 22 | inherit go-mod systemd | ||
| 23 | |||
| 24 | SYSTEMD_SERVICE:${PN} = "cloudflared.service" | ||
| 25 | |||
| 26 | do_install:append() { | ||
| 27 | install -d ${D}${systemd_system_unitdir} | ||
| 28 | install -m 0644 ${UNPACKDIR}/cloudflared.service ${D}${systemd_system_unitdir}/cloudflared.service | ||
| 29 | install -d ${D}${sysconfdir}/default | ||
| 30 | install -m 0644 ${UNPACKDIR}/default ${D}${sysconfdir}/default/cloudflared | ||
| 31 | } | ||
| 32 | |||
| 33 | FILES:${PN}-src += "${libdir}/go/src" | ||
| 34 | |||
| 35 | # Fix shebang and QA Issue with scripts with /bin/bash and /usr/bin/python3 | ||
| 36 | INSANE_SKIP:${PN}-dev = "file-rdeps" | ||
diff --git a/meta-networking/recipes-connectivity/cloudflared/files/cloudflared.service b/meta-networking/recipes-connectivity/cloudflared/files/cloudflared.service new file mode 100644 index 0000000000..decaf0e329 --- /dev/null +++ b/meta-networking/recipes-connectivity/cloudflared/files/cloudflared.service | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=cloudflared | ||
| 3 | After=network-online.target | ||
| 4 | Wants=network-online.target | ||
| 5 | |||
| 6 | [Service] | ||
| 7 | Type=notify | ||
| 8 | DynamicUser=yes | ||
| 9 | EnvironmentFile=/etc/default/cloudflared | ||
| 10 | ExecStart=/usr/bin/cloudflared --no-autoupdate tunnel run --token ${TUNNEL_TOKEN} | ||
| 11 | Restart=on-failure | ||
| 12 | RestartSec=5s | ||
| 13 | |||
| 14 | [Install] | ||
| 15 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-connectivity/cloudflared/files/default b/meta-networking/recipes-connectivity/cloudflared/files/default new file mode 100644 index 0000000000..1e00173af6 --- /dev/null +++ b/meta-networking/recipes-connectivity/cloudflared/files/default | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | # Cloudflare Tunnel token from the dashboard | ||
| 2 | TUNNEL_TOKEN= | ||
