proxycoexist

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package proxycoexist helps run the dashboard behind a reverse proxy that already owns ports 80 and 443 (Traefik, Caddy, nginx), which is the normal situation on a server migrating off another platform.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Holder

type Holder struct {
	Port      int    `json:"port"`
	Container string `json:"container"`
	Image     string `json:"image"`
	Kind      Kind   `json:"kind,omitempty"`
	// NetworkGateway is the host's address on the holder's first network,
	// reachable from inside that container.
	NetworkGateway string `json:"network_gateway,omitempty"`
}

Holder is a container publishing a host port the ingress would want.

type Kind

type Kind string

Kind is a reverse proxy family we can generate configuration for.

const (
	Traefik Kind = "traefik"
	Nginx   Kind = "nginx"
	Caddy   Kind = "caddy"
)

Supported proxy kinds.

func KindFromImage

func KindFromImage(image string) (Kind, bool)

KindFromImage guesses the proxy family from a container image name.

func ParseKind

func ParseKind(s string) (Kind, error)

ParseKind validates a --proxy value.

type Plan

type Plan struct {
	Domain      string   `json:"domain"`
	Proxy       Kind     `json:"proxy"`
	UpstreamURL string   `json:"upstream_url"`
	NeedsRebind bool     `json:"needs_rebind"`
	Rebind      string   `json:"rebind,omitempty"`
	Snippet     string   `json:"snippet"`
	SnippetPath string   `json:"snippet_path,omitempty"`
	Steps       []string `json:"steps"`
}

Plan is everything an operator needs to put the dashboard behind a proxy.

func Build

func Build(domain string, kind Kind, listenAddr, gateway string) (Plan, error)

Build returns the plan. listenAddr is the dashboard's current listen address (APP_HTTP_ADDR). gateway is the proxy container's host-side address, empty when the proxy runs on the host itself.

func BuildTarget

func BuildTarget(t Target) (Plan, error)

BuildTarget is Build for any listener, for example an app's domain to the ingress HTTP port.

type Target

type Target struct {
	Domain     string
	Kind       Kind
	ListenAddr string
	Gateway    string
	Name       string
	EnvVar     string
}

Target is what a plan routes: a domain to a listener, with the Traefik object name and the variable that moves the listener.

Jump to

Keyboard shortcuts

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