smb

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package smb implements the apply step that activates the Samba server: group and user membership, avahi, config validation, service enablement, and samba account passwords. It never writes config files — placement is mise's job (smb.conf and shares.conf are system dotfiles); this step only activates what is already placed.

Index

Constants

View Source
const DefaultGroup = "smb"

DefaultGroup is used when a module's smb spec declares no group.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecRunner

type ExecRunner struct{}

ExecRunner is the real command runner.

func (ExecRunner) Run

func (ExecRunner) Run(ctx context.Context, name string, args ...string) (string, error)

func (ExecRunner) RunInteractive

func (ExecRunner) RunInteractive(ctx context.Context, name string, args ...string) error

type Runner

type Runner interface {
	Run(ctx context.Context, name string, args ...string) (string, error)
	RunInteractive(ctx context.Context, name string, args ...string) error
}

Runner runs commands for the step. Run captures combined output (stdout and stderr merged, so validation errors like testparm's carry their diagnostics); cancelling ctx kills the child process. RunInteractive attaches the terminal so a command can prompt (smbpasswd password entry).

type Step

type Step struct {
	Runner Runner
	Plan   resolve.SmbStep
	Out    io.Writer
}

Step is the apply pipeline step for Samba server activation, consuming the resolved smb aggregate. Out receives intentional user-facing messages (the no-TTY smbpasswd skip warning); it defaults to os.Stdout.

func (*Step) Name

func (s *Step) Name() string

Name returns the step name.

func (*Step) Run

func (s *Step) Run(ctx context.Context) error

Run activates Samba in script order (mise-tasks/system/smb.sh): per module ensure the group, user membership, and avahi; then gate on testparm; then enable/restart the smb service; finally ensure each declared user has a samba password. An empty aggregate is a no-op.

Jump to

Keyboard shortcuts

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