app

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 51 Imported by: 0

Documentation

Overview

Kubernetes deploy steps.

The VM path installs a runtime on a box: Docker, a database, a systemd unit, Caddy, an agent, ufw. This path installs nothing. The generated repo already carries a Helm chart and a CI workflow, so a deploy is: stamp the chart version, commit, let CI build the image, then run `helm upgrade --install` on a machine that can reach the cluster.

Everything reaches the cluster over SSH, through the same RemoteRunner the VM path uses — helm and kubectl run ON the host (microk8s ships both), so no kubeconfig is needed locally and the API server never has to be exposed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeployConfig added in v1.2.3

type DeployConfig struct {
	Provider   *string `json:"provider,omitempty"`
	Host       *string `json:"host,omitempty"`
	Region     *string `json:"region,omitempty"`
	Size       *string `json:"size,omitempty"`
	Image      *string `json:"image,omitempty"`
	SSHKeyName *string `json:"ssh_key_name,omitempty"`
	User       *string `json:"user,omitempty"`
	SSHKey     *string `json:"ssh_key,omitempty"`
	Port       *int    `json:"port,omitempty"`
	Domain     *string `json:"domain,omitempty"`

	Project    *string `json:"project,omitempty"`
	Version    *string `json:"version,omitempty"`
	Identifier *string `json:"identifier,omitempty"`

	DBOnly           *bool   `json:"db_only,omitempty"`
	DB               *string `json:"db,omitempty"`
	DBSchema         *string `json:"db_schema,omitempty"`
	DBDSN            *string `json:"db_dsn,omitempty"`
	Connection       *string `json:"connection,omitempty"`
	SaveConnection   *bool   `json:"save_connection,omitempty"`
	NoSaveConnection *bool   `json:"no_save_connection,omitempty"`

	// StorageEnabled turns on the generated /upload and /sign endpoints (the S3
	// storage zone) independently of where credentials come from. A web-authored
	// config sets this alongside Storage; the manual --s3-* flags also imply it.
	StorageEnabled *bool `json:"storage_enabled,omitempty"`
	// Storage is the team ObjectStore (S3) UUID whose credentials are resolved
	// server-side at deploy time and written into the app's `aws:` config, so the
	// generated /upload and /sign endpoints can reach the bucket. Like Connection,
	// a web-authored config carries only the UUID, never the plaintext secret.
	// Raw S3 credentials are provided instead via the CLI-only --s3-* flags
	// (mirroring how db_dsn is CLI-only), never in a web-authored config.
	Storage *string `json:"storage,omitempty"`

	API    *string `json:"api,omitempty"`
	Auth   *string `json:"auth,omitempty"`
	Custom *bool   `json:"custom,omitempty"`

	SourceDir     *string `json:"source_dir,omitempty"`
	CLIInstallCmd *string `json:"cli_install_cmd,omitempty"`
	Sudo          *bool   `json:"sudo,omitempty"`
	WebURL        *string `json:"web_url,omitempty"`

	// Kubernetes (--provider k8s). These describe WHERE the release goes, so
	// they belong in a committed config. The run-shaping flags (--no-commit,
	// --no-wait, --release-only, --pin-digest) deliberately do not: they say
	// what to skip THIS run.
	Namespace   *string `json:"namespace,omitempty"`
	Release     *string `json:"release,omitempty"`
	HelmCmd     *string `json:"helm_cmd,omitempty"`
	KubectlCmd  *string `json:"kubectl_cmd,omitempty"`
	ImageRepo   *string `json:"image_repo,omitempty"`
	ImageTag    *string `json:"image_tag,omitempty"`
	AuthDomain  *string `json:"auth_domain,omitempty"`
	GRPCDomain  *string `json:"grpc_domain,omitempty"`
	ChartValues *string `json:"chart_values,omitempty"`

	Codegen map[string]interface{} `json:"codegen,omitempty"`
}

DeployConfig is the JSON schema for a whole-deploy spec file passed via --deploy-config. Its top-level keys mirror the deploy flags 1:1, and the generator (go-code-gen) config is nested under `codegen` (the content that used to be passed via --gen-config / the old --config-file). Every field is a pointer so "absent in the file" is distinguishable from "present but zero" — the resolver only falls back to a file value when the flag wasn't set.

A web-authored config never contains db_dsn (a raw secret): external databases are expressed as a `connection` (team-connection UUID resolved server-side at deploy time). The CLI still accepts db_dsn in a locally-authored file.

type Implementation

type Implementation struct {
	// contains filtered or unexported fields
}

func New

func New() (*Implementation, error)

func (*Implementation) AgentCommand added in v0.0.50

func (i *Implementation) AgentCommand() cli.Command

func (*Implementation) AgentConnectionAddCommand added in v0.0.50

func (i *Implementation) AgentConnectionAddCommand() cli.Command

func (*Implementation) AgentConnectionCommand added in v0.0.50

func (i *Implementation) AgentConnectionCommand() cli.Command

AgentConnectionCommand adds the `nuzur-cli agent connection ...` subcommand tree. Each subcommand keeps the local registry and the cloud-side catalog in sync: cloud sees only metadata (name, db_type, default_schema), never the DSN.

func (*Implementation) AgentConnectionListCommand added in v0.0.50

func (i *Implementation) AgentConnectionListCommand() cli.Command

func (*Implementation) AgentConnectionRemoveCommand added in v0.0.50

func (i *Implementation) AgentConnectionRemoveCommand() cli.Command

func (*Implementation) AgentInstallCommand added in v0.0.50

func (i *Implementation) AgentInstallCommand() cli.Command

func (*Implementation) AgentListCommand added in v0.0.50

func (i *Implementation) AgentListCommand() cli.Command

func (*Implementation) AgentPairCommand added in v0.0.50

func (i *Implementation) AgentPairCommand() cli.Command

func (*Implementation) AgentRevokeCommand added in v0.0.50

func (i *Implementation) AgentRevokeCommand() cli.Command

func (*Implementation) AgentSelfTestCommand added in v0.0.50

func (i *Implementation) AgentSelfTestCommand() cli.Command

AgentSelfTestCommand calls connection-manager.TestConnection with type=LOCAL pointed at this machine's paired agent. End-to-end check that:

web/CLI  →  connection-manager  →  LocalAgentChannel  →  agent  →  local DB

Requires `nuzur-cli agent start` to be running in another shell.

func (*Implementation) AgentStartCommand added in v0.0.50

func (i *Implementation) AgentStartCommand() cli.Command

func (*Implementation) AgentStatusCommand added in v0.0.50

func (i *Implementation) AgentStatusCommand() cli.Command

AgentStatusCommand prints local pairing + service-install state. Doesn't hit the cloud — it's a cheap local-state check intended for "is my daemon configured correctly?" troubleshooting.

func (*Implementation) AgentUninstallCommand added in v0.0.50

func (i *Implementation) AgentUninstallCommand() cli.Command

func (*Implementation) AgentUnpairCommand added in v0.0.50

func (i *Implementation) AgentUnpairCommand() cli.Command

AgentUnpairCommand revokes the local agent registered to this machine on the cloud and wipes the local credentials. After this, `nuzur-cli agent pair` can run cleanly again.

func (*Implementation) BuildConfigValues added in v0.0.28

func (i *Implementation) BuildConfigValues(
	er extensionRunner,
	project *nemgen.Project,
	projectVersionUUID string,
	configEntity *extensiongen.ExtensionConfigurationEntity,
	lastConfig map[string]interface{},
	reuseConfig bool,
) (map[string]interface{}, error)

func (*Implementation) Commands

func (i *Implementation) Commands() []cli.Command

func (*Implementation) ConnectCommand added in v1.3.2

func (i *Implementation) ConnectCommand() cli.Command

ConnectCommand walks a user through attaching a database on this machine to nuzur: pair the machine, register the database, publish it, and leave an agent running to serve it.

It exists because the individual steps assume a browser. On a server reached over SSH there is none, so pairing falls back to a token the user copies from the web app, and the publish is signed with the agent's own credentials — nothing here ever needs a user session on this machine.

func (*Implementation) DeployCommand added in v1.1.0

func (i *Implementation) DeployCommand() cli.Command

func (*Implementation) DeployListCommand added in v1.1.0

func (i *Implementation) DeployListCommand() cli.Command

func (*Implementation) DestroyCommand added in v1.1.0

func (i *Implementation) DestroyCommand() cli.Command

func (*Implementation) ExtensionCheckLimitCommand added in v0.0.53

func (i *Implementation) ExtensionCheckLimitCommand() cli.Command

func (*Implementation) ExtensionRunCommand added in v0.0.28

func (i *Implementation) ExtensionRunCommand() cli.Command

func (*Implementation) ExtensionScaffoldCommand

func (i *Implementation) ExtensionScaffoldCommand() cli.Command

func (*Implementation) ExtensionUpdateConfigCommand added in v0.0.14

func (i *Implementation) ExtensionUpdateConfigCommand() cli.Command

func (*Implementation) FindGeneratorExtension added in v0.0.59

func (i *Implementation) FindGeneratorExtension(er extensionRunner, identifier string) (*nemgen.Extension, error)

FindGeneratorExtension resolves a published generator extension by its identifier, used by shortcut commands (e.g. `nuzur-cli go-code-gen`) that skip interactive selection.

func (*Implementation) GoCodeGenCommand added in v0.0.59

func (i *Implementation) GoCodeGenCommand() cli.Command

GoCodeGenCommand is a shortcut for `run-extension` that pre-selects the go-code-gen generator, skipping the interactive extension-selection step.

func (*Implementation) Login

func (i *Implementation) Login() error

func (*Implementation) LoginCommand

func (i *Implementation) LoginCommand() cli.Command

func (*Implementation) LogoutCommand

func (i *Implementation) LogoutCommand() cli.Command

func (*Implementation) Run

func (i *Implementation) Run() error

func (*Implementation) SelectExtensionVersion

func (i *Implementation) SelectExtensionVersion(extensionUUID string) (*nemgen.ExtensionVersion, error)

func (*Implementation) SelectProject added in v0.0.28

func (i *Implementation) SelectProject(er extensionRunner) (*nemgen.Project, error)

func (*Implementation) SelectProjectVersion added in v0.0.28

func (i *Implementation) SelectProjectVersion(er extensionRunner, projectUUID string) (*nemgen.ProjectVersion, error)

func (*Implementation) SelectPublicExtension added in v0.0.28

func (i *Implementation) SelectPublicExtension(er extensionRunner) (*nemgen.Extension, error)

func (*Implementation) SelectUserExtension added in v0.0.28

func (i *Implementation) SelectUserExtension(es *extensionscaffold.Implementation) (*nemgen.Extension, error)

func (*Implementation) VersionCommand added in v1.5.2

func (i *Implementation) VersionCommand() cli.Command

VersionCommand mirrors the built-in --version flag as a subcommand, because `nuzur-cli version` is what people (and agents) type first.

Jump to

Keyboard shortcuts

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