Documentation
¶
Index ¶
- func ContainerExec(container, user string, interactive bool, command ...string) error
- func CreateProxyNetwork()
- func CronExecute(projectName string, flag, manual bool)
- func Down(projectName string, withVolumes bool)
- func DownNginx(force bool)
- func GetContainerName(projectConf map[string]string, projectName, service string) string
- func IsTTYAvailable() bool
- func Kill(projectName string)
- func NotifyExecDone(container string, command []string, execErr error)
- func PrepareContainerExec(container, user string, interactive bool, command ...string) (*exec.Cmd, error)
- func ReloadNginx()
- func SetCommandInterceptor(i CommandInterceptor)
- func StopNginx(force bool)
- func StopSnapshot(projectName string)
- func UpNginx(projectName string)
- func UpNginxWithBuild(projectName string, force bool)
- func UpProjectWithBuild(projectName string, withChown bool)
- func UpSnapshot(projectName string)
- func UpWithBuild(projectName string, withChown bool)
- type CommandInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerExec ¶
ContainerExec runs a command inside a Docker container with standard I/O (os.Stdin/Stdout/Stderr).
func CreateProxyNetwork ¶
func CreateProxyNetwork()
CreateProxyNetwork creates the shared network for proxy and project services
func CronExecute ¶
CronExecute starts or stops cron service in the container
func GetContainerName ¶
GetContainerName returns the full container name for a service
func IsTTYAvailable ¶
func IsTTYAvailable() bool
IsTTYAvailable checks whether a TTY is available for docker exec. It respects the MADOCK_TTY_ENABLED env var (0=off, 1=on) and falls back to checking if stdin is a terminal.
func NotifyExecDone ¶
NotifyExecDone notifies the interceptor that a command has completed. Call after PrepareContainerExec + cmd.Run().
func PrepareContainerExec ¶
func PrepareContainerExec(container, user string, interactive bool, command ...string) (*exec.Cmd, error)
PrepareContainerExec creates a docker exec *exec.Cmd with interceptor support. Caller sets Stdin/Stdout/Stderr, calls cmd.Run(), then calls NotifyExecDone().
func SetCommandInterceptor ¶
func SetCommandInterceptor(i CommandInterceptor)
SetCommandInterceptor sets a custom interceptor for docker exec commands.
func UpNginxWithBuild ¶
UpNginxWithBuild starts the nginx proxy container with optional rebuild
func UpProjectWithBuild ¶
UpProjectWithBuild starts project containers with build
func UpWithBuild ¶
UpWithBuild starts both nginx proxy and project containers with build
Types ¶
type CommandInterceptor ¶
type CommandInterceptor interface {
BeforeExec(container string, command []string) ([]string, error)
AfterExec(container string, command []string, execErr error)
}
CommandInterceptor allows enterprise to intercept docker exec commands for auditing, sanitization, or blocking dangerous patterns.