Documentation
¶
Index ¶
- func ConfigPath() string
- func DataDir(name string) string
- func GeneratePrivateKey() (string, error)
- func ListApps() (map[string]AppConfig, error)
- func ListAppsFrom(path string) (map[string]AppConfig, error)
- func ListAppsSorted(apps map[string]AppConfig) []string
- func RemoveApp(name string) error
- func RemoveAppFrom(path, name string) error
- func ResolveVolumes(name string, volumes []string) []string
- func SaveApp(name string, app AppConfig) error
- func SaveAppTo(path, name string, app AppConfig) error
- func SaveMatchaConfig(cfg *MatchaConfig) error
- func SaveMatchaConfigTo(cfg *MatchaConfig, path string) error
- func Setup() error
- type AppConfig
- type BackupFile
- type Config
- type Matcha
- func (m *Matcha) AppContainerName() string
- func (m *Matcha) BackupDB() (string, error)
- func (m *Matcha) DataDir() string
- func (m *Matcha) Deploy() error
- func (m *Matcha) EnvPrefix() string
- func (m *Matcha) Exec(args ...string) error
- func (m *Matcha) GetConfig() Config
- func (m *Matcha) GetDomain() (string, error)
- func (m *Matcha) Install() error
- func (m *Matcha) Logs() error
- func (m *Matcha) Migrate() error
- func (m *Matcha) NetworkName() string
- func (m *Matcha) ProxyContainerName() string
- func (m *Matcha) Reload() error
- func (m *Matcha) RemoveFromProxy() error
- func (m *Matcha) RestoreDB() error
- func (m *Matcha) SaveImage() error
- func (m *Matcha) SelfUpdate() (bool, error)
- func (m *Matcha) SetImage(image string)
- func (m *Matcha) StartSpinner(name string) *Spinner
- func (m *Matcha) Status() error
- func (m *Matcha) StopApp() error
- func (m *Matcha) Update() error
- type MatchaConfig
- type Spinner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶ added in v0.12.0
func ConfigPath() string
ConfigPath returns the path to the matcha config file.
func GeneratePrivateKey ¶ added in v0.12.0
GeneratePrivateKey creates a secure random key.
func ListAppsFrom ¶ added in v0.12.0
ListAppsFrom returns all apps from a specific config path.
func ListAppsSorted ¶ added in v0.12.0
ListAppsSorted returns app names sorted alphabetically.
func RemoveAppFrom ¶ added in v0.12.0
RemoveAppFrom removes an app from a specific config file.
func ResolveVolumes ¶ added in v0.12.0
ResolveVolumes converts container paths to docker -v args using default data dir. "/app/storage" → "/var/matcha/{name}/storage:/app/storage" "/data" → "/var/matcha/{name}/data:/data" "/var/lib/plausible" → "/var/matcha/{name}/plausible:/var/lib/plausible"
func SaveApp ¶ added in v0.12.0
SaveApp updates a single app in the YAML config (read-modify-write).
func SaveMatchaConfig ¶ added in v0.12.0
func SaveMatchaConfig(cfg *MatchaConfig) error
SaveMatchaConfig writes the YAML config file.
func SaveMatchaConfigTo ¶ added in v0.12.0
func SaveMatchaConfigTo(cfg *MatchaConfig, path string) error
SaveMatchaConfigTo writes the YAML config to a specific path.
Types ¶
type AppConfig ¶ added in v0.12.0
type AppConfig struct {
Image string `yaml:"image"`
Domain string `yaml:"domain"`
Port int `yaml:"port,omitempty"`
HealthPath string `yaml:"health_path,omitempty"`
Volumes []string `yaml:"volumes,omitempty"`
Env map[string]string `yaml:"env,omitempty"`
}
AppConfig holds the configuration for a single deployed application.
func LoadAppFrom ¶ added in v0.12.0
LoadAppFrom loads a single app from a specific config path.
type BackupFile ¶
BackupFile represents a database backup file.
type Config ¶
type Config struct {
// Required
Name string // "fusionaly" → env prefix FUSIONALY_, container names, etc.
AppImage string // "karloscodes/fusionaly:latest"
// Optional with defaults
BinaryPath string // default: /usr/local/bin/{Name}
ProxyImage string // default: basecamp/kamal-proxy:latest
HealthPath string // default: /up
AppPort int // default: 8080
// Feature flags
CronUpdates bool // daily 3 AM auto-update cron job
Backups bool // SQLite backup with retention policy
// Custom configuration
Volumes []string // Container paths to mount (e.g., /app/storage)
// Self-update configuration (see selfupdate.go for conventions)
ManagerRepo string // GitHub repo for releases, e.g., "karloscodes/fusionaly"
ManagerVersion string // current version, e.g., "v1.4.37" (set via ldflags at build time)
// Internal: override paths (for testing)
ConfigPath string
DataDirBase string
}
Config defines how Matcha deploys your application.
type Matcha ¶
type Matcha struct {
// contains filtered or unexported fields
}
Matcha is the main orchestrator for deployments.
func (*Matcha) AppContainerName ¶
AppContainerName returns the app container name.
func (*Matcha) Migrate ¶ added in v0.12.0
Migrate moves from old layouts to new YAML config + /var/matcha/{name}/ data dir. Supports migration from:
- /opt/{name}/.env (legacy layout)
- /etc/matcha/apps/{name}/app.json + .env (previous multi-app layout)
func (*Matcha) NetworkName ¶
NetworkName returns the Docker network name.
func (*Matcha) ProxyContainerName ¶ added in v0.11.0
ProxyContainerName returns the proxy container name.
func (*Matcha) RemoveFromProxy ¶ added in v0.12.0
RemoveFromProxy removes the service from kamal-proxy.
func (*Matcha) SelfUpdate ¶
SelfUpdate checks for a newer manager version and updates if available. Returns true if an update was performed.
func (*Matcha) StartSpinner ¶
StartSpinner creates and starts an animated spinner for a step.
type MatchaConfig ¶ added in v0.12.0
MatchaConfig is the top-level structure of /etc/matcha/config.yml.
func LoadMatchaConfig ¶ added in v0.12.0
func LoadMatchaConfig() (*MatchaConfig, error)
LoadMatchaConfig reads the YAML config file.
func LoadMatchaConfigFrom ¶ added in v0.12.0
func LoadMatchaConfigFrom(path string) (*MatchaConfig, error)
LoadMatchaConfigFrom reads a YAML config from a specific path.