Code Monkey home page Code Monkey logo

cockpit-cloudflared's People

Contributors

gbraad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cockpit-cloudflared's Issues

Install

Debian

$ 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

Fedora/EL

$ 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

Container

Ref: spotsnel/cloudflared-systemd

$ podman run -d --name=cloudflared \
        --hostname $HOSTNAME-cloudflared \
        --network=host --systemd=always \
        ghcr.io/spotsnel/cloudflared-systemd:latest

If `tunnel list` errors

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.

Tunnel status

$ 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 ?

Tunnel register

$ 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

Tunnel list

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": []
  }
]

Type for `cloudflared tunnels list -o json`

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",
}

Tunnel login

$ 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.