Categorygithub.com/LukeWinikates/synology-go
module
0.0.14
Repository: https://github.com/lukewinikates/synology-go.git
Documentation: pkg.go.dev

# README

synoctl and synology-go

a CLI and go SDK for the Synology DSM API

Why make this?

Synology NAS devices are popular.

In a home setting, a Synology device is particularly handy as a small, always-on Linux device with abundant local storage.

Out of the box, you can interact with a Synology device through a web-based UI. The Web UI is great for trying new features, but managing containers or network drives from the UI can be slow and error-prone. A command-line utility better supports scripting and automation.

The synoctl command name follows the tradition of kubectl, journalctl, sysctl and other command-line utilities for managing things. Hopefully it is easy to type and easy to remember!

Getting Started with synoctl

You can download a precompiled synoctl binary from the releases tab in this repository.

Run the synoctl login and follow the prompts to authenticate with your Synology host

Commands for the Container Manager App

animated demo

synoctl supports these commands. To use docker commands, you will need to install the Container Manager app from Package Center first.

appresourcecommanddescription
--loginlogs the synoctl client into the target synology server
--curlcalls an arbitrary Synology API based on user input, and returns the response as pretty-printed JSON
dockermanagerlogsprints logs from the Container Manger app
dockercontainerslistlists all containers
restartrestarts container specified with --name flag
stopstops container specified with --name flag
startstarts container specified with --name flag
logsprints container logs from target container
dockerprojectsbuildbuilds the project specified with --id
createcreates a new project from a name, share path, and compose.yaml
getgets a project by id
deletedeletes a project by id
listlists all projects
startstarts the project specified with --id
stopstops the project specified with --id
updateupdates the compose.yaml contents for the project specified with --name
dockerimagesgetgets a single image by --name and --tag
listlists all images downloaded to the Container Manager instance
pullstarts a pull task for a --repository and --tag
upgradestarts an upgrade task for a --repository
follow-pullpolls the status of a previously started pull task
follow-upgradepolls the status of a previously started upgrade task

All commands provide a --help command explaining their use.

Thanks

Making a terminal animation with VHS was super fun

I came across many examples of folks analyzing and creating clients for the DSM API. Of those, these were particularly informative:

The Synology API has some interesting self-documenting behavior, but parameters for API calls are not documented. Watching live requests in the developer console while using the Synology UI is the best strategy - the UI is a web application, and it appears to rely on the same APIs that this client library calls.

# Packages

No description provided by the author
No description provided by the author