spotsnel / cockpit-cloudflared Goto Github PK
View Code? Open in Web Editor NEWBasic Cockpit application for use with Cloudflared tunnel registration
License: GNU Lesser General Public License v2.1
Basic Cockpit application for use with Cloudflared tunnel registration
License: GNU Lesser General Public License v2.1
Title ^
$ curl -L --output /tmp/cloudflared.deb \
https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb \
&& sudo dpkg -i /tmp/cloudflared.deb \
&& rm -f /tmp/cloudflared.deb
$ curl -L --output /tmp/cloudflared.rpm \
https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-x86_64.rpm \
&& sudo yum localinstall -y /tmp/cloudflared.rpm \
&& rm -f /tmp/cloudflared.rpm
Ref: spotsnel/cloudflared-systemd
$ podman run -d --name=cloudflared \
--hostname $HOSTNAME-cloudflared \
--network=host --systemd=always \
ghcr.io/spotsnel/cloudflared-systemd:latest
If the following happens
$ cloudflared tunnel list # this returns a error code 1
2023-07-12T14:19:20Z ERR Cannot determine default origin certificate path. No file cert.pem in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]. You need to specify the origin certificate path by specifying the origincert option in the configuration file, or set TUNNEL_ORIGIN_CERT environment variable originCertPath=
Error locating origin cert: client didn't specify origincert path
This means the client has not logged in, and #4 is needed.
$ cloudflared tunnel info [name]
NAME: test
ID: aa11a120-....-....-....-23924f893735
CREATED: 2023-07-07 04:24:42.750148 +0000 UTC
CONNECTOR ID CREATED ARCHITECTURE VERSION ORIGIN IP EDGE
06493c9e-....-....-....-aa7e852a996c 2023-07-07T04:25:38Z linux_amd64 2023.6.1 208.113.135.47 2xIAD, 2xORD
No JSON option ?
$ cloudflared service install eyJhIjoiZWU5YTFlOTBlNDY3YmI1NmM2NDdiZWI2OTY3ZDM4YWEiLCJ0IjoiYWEx.....................................................................................bGhaVGt6T0RJeiJ9
2023-07-07T04:25:36Z INF Using Systemd
2023-07-07T04:25:38Z INF Linux service for cloudflared installed successfully
Only after #4 this is possible:
$ cloudflared tunnel list -o json
[
{
"id": "aa11a120-....-....-....-23924f893735",
"name": "test",
"created_at": "2023-07-07T04:24:42.750148Z",
"deleted_at": "0001-01-01T00:00:00Z",
"connections": [
{
"colo_name": "ORD",
"id": "2af70d62-....-....-....-895206978500",
"is_pending_reconnect": false,
"origin_ip": "208.113.135.47",
"opened_at": "2023-07-07T04:25:38.579809Z"
},
{
"colo_name": "IAD",
"id": "34c3e28b-....-....-....-86a8a2575bd5",
"is_pending_reconnect": false,
"origin_ip": "208.113.135.47",
"opened_at": "2023-07-07T04:25:38.981465Z"
},
{
"colo_name": "IAD",
"id": "767989f6-....-....-....-827cf13aeb3a",
"is_pending_reconnect": false,
"origin_ip": "208.113.135.47",
"opened_at": "2023-07-07T04:25:39.719102Z"
},
{
"colo_name": "ORD",
"id": "8b6d4f39-....-....-....-de90400b8fe7",
"is_pending_reconnect": false,
"origin_ip": "208.113.135.47",
"opened_at": "2023-07-07T04:25:40.948759Z"
}
]
}
]
without connectivity:
[
{
"id": "cc3913ee-....-....-....-308f4cc86316",
"name": "test",
"created_at": "2023-07-06T15:50:06.239025Z",
"deleted_at": "0001-01-01T00:00:00Z",
"connections": []
}
]
export interface Tunnels{
id: string;
name: string;
created_at: Date;
deleted_at: Date;
connections: Connection[];
}
export interface Connection {
colo_name: ColoName;
id: string;
is_pending_reconnect: boolean;
origin_ip: string;
opened_at: Date;
}
export enum ColoName {
Ams = "AMS",
Bru = "BRU",
Iad = "IAD",
Lax = "LAX",
Ord = "ORD",
Sjc = "SJC",
}
$ cloudflared tunnel login
Please open the following URL and log in with your Cloudflare account:
https://dash.cloudflare.com/argotunnel?aud=&callback=https%3A%2F%2Flogin.cloudflareaccess.org%2F8AP1AKsG4lzjZ_QjTZcZ8Kl0.......................A%3D
Leave cloudflared running to download the cert automatically.
You have successfully logged in.
If you wish to copy your credentials to a server, they have been saved to:
/root/.cloudflared/cert.pem
this needs to be run in the background as it waits for the confirmation and downloads the certificate
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.