Documentation ¶
Index ¶
- Constants
- func DownloadLatestBinaryFromGithub() ([]byte, error)
- func InstallBinary(bytes []byte) error
- func LoginToGetOriginCertificate(outW, errW io.Writer) (certPemContent, certPemPath string, _ error)
- func RemoveCloudflaredDir(outW io.Writer) error
- type CreateTunnelParams
- type TunnelSensitiveData
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 InstallBinary ¶
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 ¶
Types ¶
type CreateTunnelParams ¶
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)
Click to show internal directories.
Click to hide internal directories.