cloudflared

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROOT_CLOUDFLARED_DIR = "/root/.cloudflared"
	CERT_PEM_LOCATION    = ROOT_CLOUDFLARED_DIR + "/cert.pem"
)
View Source
const (
	LINUX_ADM64_BINARY_URL    = "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64"
	CLOUDFLARED_BINARY_FPERMS = fs.FileMode(0555)

	DEFAULT_CLOUDFLARED_BINARY_NAME = "cloudflared"
	DEFAULT_CLOUDFLARED_BINARY_PATH = "/usr/local/bin/" + DEFAULT_CLOUDFLARED_BINARY_NAME
)

Variables

This section is empty.

Functions

func DownloadLatestBinaryFromGithub

func DownloadLatestBinaryFromGithub() ([]byte, error)

func InstallBinary

func InstallBinary(bytes []byte) error

func LoginToGetOriginCertificate

func LoginToGetOriginCertificate(outW, errW io.Writer) (certPemContent, certPemPath string, _ error)

LoginToGetOriginCertificate executes the cloudlfared login command that shows a link leading to the Cloudflare dashboard to allow the installation of a certificate. The created cert.pem file is read and its content is returned.

func RemoveCloudflaredDir

func RemoveCloudflaredDir(outW io.Writer) error

Types

type CreateTunnelParams

type CreateTunnelParams struct {
	UniqueName            string
	OriginCertificatePath string

	OutW, ErrW io.Writer
}

type TunnelSensitiveData

type TunnelSensitiveData struct {
	Id           string          `json:"id"`
	CurrentToken string          `json:"token"`
	CredsContent json.RawMessage `json:"creds"`
}

func CreateTunnel

func CreateTunnel(args CreateTunnelParams) (data TunnelSensitiveData, finalErr error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL