synology

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceName is the Container Manager service name in DSM 7.2+
	ServiceName = "pkg-ContainerManager-dockerd"
	// ConfigPath is the path to Container Manager configuration
	ConfigPath = "/var/packages/ContainerManager/etc/dockerd.json"
	// DockerBinary is the full path to the Docker binary
	DockerBinary = "/usr/local/bin/docker"
	// SocketPath is the path to the Docker socket
	SocketPath = "/var/run/docker.sock"
	// RestartCommand is the command to restart Container Manager
	RestartCommand = "sudo systemctl restart pkg-ContainerManager-dockerd"
	// DefaultVolume is the default volume path
	DefaultVolume = "/volume1/docker"

	// DefaultSSHPort is the default SSH port for Synology
	DefaultSSHPort = 22
	// DefaultSSHUser is the default SSH username
	DefaultSSHUser = "admin"

	// DefaultRestartPolicy is the default container restart policy
	DefaultRestartPolicy = "unless-stopped"
	// DefaultNetwork is the default Docker network mode
	DefaultNetwork = "bridge"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

Connection represents a connection to a Synology NAS

func NewConnection

func NewConnection(cfg *config.Config) *Connection

NewConnection creates a new connection with the given configuration

func (*Connection) Close

func (c *Connection) Close() error

Close closes the connection and cleans up resources

func (*Connection) Connect

func (c *Connection) Connect() error

Connect establishes the SSH connection to the Synology NAS

func (*Connection) ExecuteCommand

func (c *Connection) ExecuteCommand(cmd string) (string, error)

ExecuteCommand executes a command over SSH and returns the output

func (*Connection) ExecuteDockerCommand

func (c *Connection) ExecuteDockerCommand(args []string) (string, error)

ExecuteDockerCommand executes a Docker command with full path

func (*Connection) GetDockerClient

func (c *Connection) GetDockerClient() *client.Client

GetDockerClient returns the Docker client (nil in v0.1.x)

func (*Connection) StreamCommand

func (c *Connection) StreamCommand(cmd string, stdout, stderr io.Writer) error

StreamCommand executes a command and streams output to writers

func (*Connection) TestConnection

func (c *Connection) TestConnection() error

TestConnection tests SSH and Docker connectivity

Jump to

Keyboard shortcuts

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