firewall

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package firewall implements the `coolify firewall` command tree. It is a thin SSH-bounced client for the coold agent's REST API: `allow` / `revoke` / `list` POST/DELETE/GET against coold on the destination host, while `containers` stays SSH+podman because coold has no container surface. See CONTROL_PLANE.md §3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFirewallCommand

func NewFirewallCommand() *cobra.Command

NewFirewallCommand creates the parent `coolify firewall` command. The command tree is kept for tests and future v5 work but is not registered on the public root CLI. On bare invocation (no subcommand) it prints help.

Types

type Flags

type Flags struct {
	common.SSHMeshFlags

	// Namespace is the mesh namespace the command operates against. Derives
	// the podman network (common.PodmanNetworkFor) and is forwarded to coold
	// as part of every rule / list query.
	Namespace string

	// AllNamespaces, when true, makes namespace-aware subcommands operate
	// across every namespace the mesh carries. Each subcommand interprets it
	// contextually (list: union across namespaces; containers: discover every
	// coolify-<ns>-mesh network on each host).
	AllNamespaces bool

	// CooldToken is an optional bearer-token override for coold's REST API.
	// When unset (and COOLIFY_COOLD_TOKEN env is unset), the CLI SSHes into
	// each host and reads /etc/coolify/api-token instead — tokens are
	// generated per-host at install time and are not centrally shared.
	CooldToken string
	// CooldPort is the TCP port coold listens on (bound to the WG mgmt IP).
	// Must match COOLD_API_BIND emitted by internal/services/coold.go.
	CooldPort int
	// WGInterface is the WireGuard interface name used to discover coold's
	// bind IP on each host. Must match --wg-interface used at `coolify init`.
	WGInterface string
}

Flags is the shared flag set for every `coolify firewall` subcommand: SSH plumbing (via embed) + namespace selection + coold REST endpoint/token. The podman network name is derived from the namespace (coolify-<ns>-mesh) so the CLI and `coolify init` stay in sync.

func (*Flags) PodmanNetworkName

func (f *Flags) PodmanNetworkName() string

PodmanNetworkName returns the podman bridge that backs the selected namespace on every host. Used by container discovery.

func (*Flags) ResolveCooldToken

func (f *Flags) ResolveCooldToken() (string, error)

ResolveCooldToken returns the bearer-token override supplied via flag or env, or "" when neither is set. Callers treat an empty string as "no override — SSH-fetch the per-host token instead".

Jump to

Keyboard shortcuts

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