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 ¶
const DefaultGroup = "smb"
DefaultGroup is used when a module's smb spec declares no group.
Variables ¶
This section is empty.
Functions ¶
func PostBootstrap ¶ added in v0.10.0
func PostBootstrap(ctx context.Context, runner Runner, modules []resolve.SmbModuleSpec, out io.Writer) error
PostBootstrap runs the post-mise-bootstrap actions that can't be expressed declaratively: the testparm validation gate and interactive smbpasswd for each declared user missing from pdbedit -L. Group/user/service convergence is handled by mise bootstrap (bootstrap.groups/users/services); this function only does the interactive/validator parts.
Types ¶
type ExecRunner ¶
type ExecRunner struct {
Verbose bool
// Out/Err are the Verbose streaming destinations; nil defaults to
// os.Stdout/os.Stderr.
Out io.Writer
Err io.Writer
}
ExecRunner is the real command runner. Verbose streams child stdout/stderr live to Out/Err while still capturing and echoes each command line set -x-style ("+ argv") to Err before it runs: Run callers parse (id -Gn, pdbedit -L) and append (testparm gate) the returned output, so streaming must never starve them.
func (ExecRunner) RunInteractive ¶
func (*ExecRunner) SetVerbose ¶ added in v0.5.0
func (r *ExecRunner) SetVerbose(v bool)
SetVerbose toggles live output streaming.
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 ¶
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.