### Development Setup with uv and Flask (spkrepo) Source: https://docs.synocommunity.com/developer-guide/publishing/package-server Sets up a development instance: starts the Postgres database, installs dependencies with uv, initializes the database, creates an admin user with the spkrepo create_admin command, and runs the development server. ```bash # Clone spkrepo git clone https://github.com/SynoCommunity/spkrepo.git cd spkrepo # Start postgres database docker compose up db # Install dependencies with uv uv sync # Initialize database uv run flask db upgrade # Create admin user uv run flask spkrepo create_admin -u admin -e admin@example.com -p yourpassword # Run development server uv run flask run ``` -------------------------------- ### PLIST Example with bin, lib, rsc entries Source: https://docs.synocommunity.com/developer-guide/packaging/plist Shows how to specify executable, library, and resource files. The destination paths are relative to the package installation directory, as described in the following section. ```text bin:bin/myapp lib:lib/libfoo.so.1 rsc:share/myapp/data.txt rsc:etc/myapp.conf ``` -------------------------------- ### Run initial setup Source: https://docs.synocommunity.com/developer-guide/setup/docker Execute the setup command inside the container to generate the local.mk configuration file. ```bash make setup ``` -------------------------------- ### Start gdb on NAS (attach or run) Source: https://docs.synocommunity.com/developer-guide/advanced/debugging Start gdb on the NAS. The first attaches to a running service by PID, the second runs the binary directly with arguments. Requires synocli-devel installed. ```bash # Attach to a running service sudo gdb -p $(pgrep -f /var/packages//target/bin/) # …or run it directly gdb --args /var/packages//target/bin/ ``` -------------------------------- ### Configure Meson Build System Source: https://docs.synocommunity.com/developer-guide/packaging/makefile-variables Example of configuring a Meson-based package where CONFIGURE_ARGS are forwarded to meson setup. ```makefile # Meson (CONFIGURE_ARGS is forwarded to `meson setup`) CONFIGURE_ARGS = -Dtests=disabled include ../../mk/spksrc.cross-meson.mk ``` -------------------------------- ### Service setup script (service-setup.sh) Source: https://docs.synocommunity.com/developer-guide/basics/package-anatomy Defines the service command, background settings, and optional lifecycle hooks for a Synology package daemon. Set SERVICE_COMMAND to the daemon binary path, SVC_BACKGROUND and SVC_WRITE_PID to enable background and PID file handling. Implement service_postinst and service_prestart to run custom actions after installation and before service start. ```bash # Service command to run SERVICE_COMMAND="${SYNOPKG_PKGDEST}/bin/transmission-daemon" # Background service settings SVC_BACKGROUND=y SVC_WRITE_PID=y # Optional lifecycle hooks service_postinst() { # Run after installation } service_prestart() { # Run before service starts } ``` -------------------------------- ### Clone and Setup Source: https://docs.synocommunity.com/developer-guide/setup/lxc Clones the spksrc repository and runs the setup command inside the container. ```bash git clone https://github.com/YOUR-USERNAME/spksrc cd spksrc make setup ``` -------------------------------- ### Test Your Setup Source: https://docs.synocommunity.com/developer-guide/setup/lxc Builds the transmission package for x64 architecture and DSM 7.2 to verify the setup. ```bash make -C spk/transmission ARCH=x64 TCVERSION=7.2 ``` -------------------------------- ### Example Translation File (install_uifile_fre.yml) Source: https://docs.synocommunity.com/developer-guide/packaging/wizards Example French translation file (install_uifile_fre.yml) with localized strings for configuration and share name fields. ```yaml CONFIGURATION_TITLE: "Configuration" SHARE_NAME_DESC: "Entrez le nom du dossier partagé à utiliser." SHARE_NAME_LABEL: "Nom du dossier partagé" SHARE_NAME_INVALID: "Nom de dossier invalide." ``` -------------------------------- ### Quick Start with Docker Compose (spkrepo) Source: https://docs.synocommunity.com/developer-guide/publishing/package-server Clones spkrepo and starts the server with docker compose. After running, access the website at http://localhost:5000, admin at http://localhost:5000/admin, and NAS API at http://localhost:5000/nas. ```bash # Clone spkrepo git clone https://github.com/SynoCommunity/spkrepo.git cd spkrepo # Run with docker-compose docker compose up ``` -------------------------------- ### Install ccache Source: https://docs.synocommunity.com/developer-guide/setup/vm Install and configure ccache to speed up repeated builds. ```bash sudo apt install ccache echo 'export PATH="/usr/lib/ccache:$PATH"' >> ~/.bashrc ``` -------------------------------- ### PLIST file example Source: https://docs.synocommunity.com/developer-guide/basics/package-anatomy Example PLIST file listing files to include in the package. Each line uses the format :, where destination is one of bin, lib, share, or etc. ```text bin:bin/transmission-daemon bin:bin/transmission-remote lib:lib/libtransmission.so ``` -------------------------------- ### Example help page HTML Source: https://docs.synocommunity.com/developer-guide/packaging/help-pages Example HTML help page. Use the same markup as the debian-chroot help files; Synology applies the standard help.css stylesheet so the page matches DSM's look and feel. ```html Package Name

Package Name

Installation

Once installed via Package Center, ...

Usage

Connect via SSH (root) and run: /var/packages/package/scripts/start-stop-status.

``` -------------------------------- ### Service setup with install_python_virtualenv Source: https://docs.synocommunity.com/developer-guide/package-types/python Service setup for a Python SPK. Points PATH at the bundled Python and calls install_python_virtualenv in service_postinst to create the runtime virtualenv from the wheelhouse. ```bash PYTHON_DIR="/var/packages/python314/target/bin" PATH="${SYNOPKG_PKGDEST}/env/bin:${PYTHON_DIR}:${PATH}" service_postinst() { # Framework helper: creates the virtualenv and installs the bundled wheels install_python_virtualenv } ``` -------------------------------- ### Generate API key setup automatically Source: https://docs.synocommunity.com/developer-guide/publishing/manual-publishing Run this make target to automatically generate the API key setup in local.mk. ```makefile make setup-synocommunity ``` -------------------------------- ### Basic Web Application Setup (Makefile) Source: https://docs.synocommunity.com/developer-guide/package-types/web Sets the ADMIN_URL variable to the web application's URL path and includes the spksrc build system's main makefile. This is the minimal setup for a web application package. ```makefile ADMIN_URL = /mywebapp/ include ../../mk/spksrc.spk.mk ``` -------------------------------- ### local.mk configuration example Source: https://docs.synocommunity.com/reference/makefile-reference Example local.mk file for the repository root. Sets default toolchains (DEFAULT_TC = 7.1 6.2.4), parallel build mode (PARALLEL_MAKE = max), per-compile timing statistics (PSTAT = 1), disables GitHub maintainer API lookups (DISABLE_GITHUB_MAINTAINER = 1), and exports proxy settings for wget. ```makefile # Default toolchains to build DEFAULT_TC = 7.1 6.2.4 # Parallel build configuration PARALLEL_MAKE = max # Per-compile timing statistics PSTAT = 1 # Skip GitHub maintainer API lookups (e.g. offline builds) DISABLE_GITHUB_MAINTAINER = 1 # Proxy settings (the downloader uses wget, which honours these standard # environment variables) export http_proxy = http://proxy:3128 export https_proxy = http://proxy:3128 ``` -------------------------------- ### Install Mosh client on Linux (apt and dnf) Source: https://docs.synocommunity.com/packages/mosh Installs the Mosh client on Debian/Ubuntu with apt and on Fedora with dnf. The two commands are alternatives depending on the Linux distribution. ```bash sudo apt install mosh # Debian/Ubuntu sudo dnf install mosh # Fedora ``` -------------------------------- ### Run the container on Linux Source: https://docs.synocommunity.com/developer-guide/setup/docker Start the container on a Linux host. ```bash docker run -it --platform=linux/amd64 \ -v $(pwd):/spksrc \ -w /spksrc \ ghcr.io/synocommunity/spksrc /bin/bash ``` -------------------------------- ### Restart cloudflared service with synopkg start Source: https://docs.synocommunity.com/packages/cloudflared Starts the cloudflared service. Used in troubleshooting when the service stops unexpectedly, possibly due to OOM killer. ```bash synopkg start cloudflared ``` -------------------------------- ### DSM 7 resource file example Source: https://docs.synocommunity.com/developer-guide/migration/dsm7 Example resource file for DSM 7 WebStation integration. Defines a data share with read-write permission for the package user. ```json { "data-share": { "shares": [{ "name": "sc-mypackage", "permission": {"rw": ["sc-mypackage"]} }] } } ``` -------------------------------- ### Architecture-specific make targets Source: https://docs.synocommunity.com/reference/makefile-reference Examples of make targets for building for specific architectures and for all supported architectures. ```makefile make arch-x64-7.2 make arch-aarch64-7.1 make all-supported ``` -------------------------------- ### Override Compile and Install Arguments Source: https://docs.synocommunity.com/developer-guide/packaging/makefile-variables Example of overriding default COMPILE_ARGS and INSTALL_ARGS for custom build and install behavior. ```makefile COMPILE_ARGS = V=1 INSTALL_ARGS = install-strip DESTDIR=$(INSTALL_DIR) ``` -------------------------------- ### Custom install target overriding the install stage Source: https://docs.synocommunity.com/developer-guide/packaging/build-rules Override the entire install stage by defining install_target. The example prints a message, creates the bin directory under STAGING_INSTALL_PREFIX, and copies a binary from WORK_DIR/PKG_DIR into it. ```makefile # Override the entire install stage install_target: @$(MSG) "Custom install" mkdir -p $(STAGING_INSTALL_PREFIX)/bin cp $(WORK_DIR)/$(PKG_DIR)/mybin $(STAGING_INSTALL_PREFIX)/bin/ ``` -------------------------------- ### Data share with rw permission Source: https://docs.synocommunity.com/developer-guide/packaging/resource-files Define a shared folder requirement with read/write permission for a user. The name and user are placeholders that get replaced during installation. ```json { "data-share": { "shares": [ { "name": "{{wizard_data_share}}", "permission": { "rw": ["{{wizard_data_share_user}}"] } } ] } } ``` -------------------------------- ### Build Process Output Source: https://docs.synocommunity.com/developer-guide/basics/first-package Example console output showing the various stages of the build process. ```text ===> Downloading toolchain for x64-7.2 ===> Extracting for openssl3-x64-7.2 ===> Configuring for openssl3-x64-7.2 ===> Compiling for openssl3-x64-7.2 ===> Installing for openssl3-x64-7.2 ===> Extracting for curl-x64-7.2 ... ===> Creating package for transmission-x64-7.2 ``` -------------------------------- ### rclone config interactive remote setup Source: https://docs.synocommunity.com/packages/rclone Starts the interactive rclone configuration wizard for adding a cloud storage remote. Follow the prompts to create a new remote, such as a Google Drive remote named mydrive. ```bash rclone config # Follow prompts to add a remote: # n) New remote # name> mydrive # storage> drive (for Google Drive) # ... ``` -------------------------------- ### Show synocli-kernelmodule.sh help and usage Source: https://docs.synocommunity.com/packages/synocli-kernel Run the helper script with --help --verbose to display all supported options, defaults, and usage. The output shows the available actions (insmod, rmmod, reload, status) and optional flags for config and udev rules. ```bash ./synocli-kernelmodule.sh --spk synokernel-usbserial --config synokernel-usbserial.cfg:ch341,cp210x --verbose --udev 60-synokernel-usbserial.rules status --help # Output: # SynoCommunity kernel driver package name (SPK) [synokernel-usbserial] # SynoCommunity configuration file (SPK_CFG) [synokernel-usbserial.cfg] # SynoCommunity configuration path (SPK_CFG_PATH) [/var/packages/synokernel-usbserial/target/etc] # SynoCommunity configuration option (SPK_CFG_OPT) [ch341,cp210x] # Synology NAS arch (ARCH) [apollolake] # Synology DSM version (DSM_VERSION) [6.2.4] # Running kernel version (KVER) [4.4.59+] # Module action insmod|rmmod|reload|status (ACTION) [status] # Kernel modules path (MPATH) [/var/packages/synokernel-usbserial/target/lib/modules] # udev rules.d path (UPATH) [/var/packages/synokernel-usbserial/target/rules.d] # udev rules.d file (URULE) [60-synokernel-usbserial.rules] # Kernel objects list (KO_LIST) [usbserial ch341 cp210x] # Usage: # ./synocli-kernelmodule.sh [-s|--spk ] [] module1.ko module2.ko ... # Optional: [-c|--config :,,...] # [-u|--udev ] ``` -------------------------------- ### Define install_uifile and install_uifile.yml Source: https://docs.synocommunity.com/developer-guide/packaging/wizards The install_uifile defines the wizard structure, while install_uifile.yml provides the localized strings for the wizard labels and descriptions. ```json [{ "step_title": "{{{CONFIGURATION_TITLE}}}", "items": [{ "type": "textfield", "desc": "{{{SHARE_NAME_DESC}}}", "subitems": [{ "key": "wizard_data_share", "desc": "{{{SHARE_NAME_LABEL}}}", "defaultValue": "mypackage", "validator": { "allowBlank": false, "regex": { "expr": "/^[a-zA-Z][a-zA-Z0-9_-]*$/", "errorText": "{{{SHARE_NAME_INVALID}}}" } } }] }] }] ``` ```yaml CONFIGURATION_TITLE: "Configuration" SHARE_NAME_DESC: "Enter the name of the shared folder to use." SHARE_NAME_LABEL: "Shared folder name" SHARE_NAME_INVALID: "Invalid folder name. Use only letters, numbers, hyphens, and underscores." ``` -------------------------------- ### Debugging from command line with make flags Source: https://docs.synocommunity.com/developer-guide/packaging/build-rules Run make with these flags to get verbose output, a dry run that shows commands without executing, or debug output for makefile parsing. All examples use ARCH=x64 and TCVERSION=7.2. ```shell # Verbose output make V=1 ARCH=x64 TCVERSION=7.2 # Dry run (show commands) make -n ARCH=x64 TCVERSION=7.2 # Debug makefile parsing make -d ARCH=x64 TCVERSION=7.2 ``` -------------------------------- ### Manually install python modules via pip in Home Assistant env Source: https://docs.synocommunity.com/packages/homeassistant Use this shell sequence to manually install pure-python modules into the Home Assistant environment on Synology. It switches to the sc-homeassistant user, changes to the env directory, and shows pip commands such as installing spotifyaio==2.0.2, freezing requirements, and installing pipdeptree. After installing, restart Home Assistant in the DSM package center. ```bash sudo -i su sc-homeassistant -s /bin/bash cd /var/packages/homeassistant/target/env # use any pip command like: ./bin/pip install --no-deps spotifyaio==2.0.2 ./bin/pip freeze > requirements.txt ./bin/pip install pipdeptree ./bin/pipdeptree # finally restart homeassistant in the package center ``` -------------------------------- ### Install synogear via SSH Source: https://docs.synocommunity.com/packages/dsm-utilities Connect via SSH with an administrative account that has sudo rights. Switch to root, check if synogear is already installed, and install it if needed. ```bash # Switch to root sudo -s # Check if already installed synogear list # If not installed, output will show: # Tools are not installed yet. You can run this command to install it: # synogear install # Install synogear install ``` -------------------------------- ### Connect to Mosh server with basic, server-path, and port options Source: https://docs.synocommunity.com/packages/mosh Shows three common ways to start a Mosh session: a basic connection, specifying the server binary path, and using a specific UDP port. The server binary path is needed when the default location is not used. ```bash # Basic connection mosh user@your-nas # Specify server binary path mosh --server=/var/packages/mosh/target/bin/mosh-server user@your-nas # Use specific port mosh -p 60001 user@your-nas ``` -------------------------------- ### Kernel module installation structure Source: https://docs.synocommunity.com/packages/synocli-kernel Shows the installation directory structure for kernel modules when REQUIRE_KERNEL_MODULE is not empty. Modules are compiled and installed by spksrc.kernel.mk, with the location reflecting the default kernel path. ```text modules └── 4.4.59+ └── kernel └── drivers └── usb ├── class │ └── cdc-acm.ko └── serial ├── ch341.ko ├── cp210x.ko └── ftdi_sio.ko ``` -------------------------------- ### Install Python Dependencies Source: https://docs.synocommunity.com/developer-guide/setup/lxc Installs Python-related packages needed for spksrc build scripts. ```bash lxc exec spksrc -- /usr/bin/apt install --no-install-recommends -y \ httpie mercurial meson ninja-build \ python3 python3-mako python3-pip python3-setuptools \ python3-virtualenv python3-yaml ``` -------------------------------- ### Run Comskip from command line Source: https://docs.synocommunity.com/packages/comskip Launch Comskip with the default configuration file and a video file path. The default config is at /volume1/@appstore/comskip/bin/comskip.ini. ```shell comskip /volume1/@appstore/comskip/bin/comskip.ini "path to your video file" ``` -------------------------------- ### Create package directory structure Source: https://docs.synocommunity.com/contributing/development-process Initialize the necessary directories for a new package. ```bash mkdir -p spk/mypackage/src mkdir -p cross/mypackage # if native component needed ``` -------------------------------- ### Install Mosh client on macOS with Homebrew Source: https://docs.synocommunity.com/packages/mosh Installs the Mosh client on macOS using Homebrew. ```bash brew install mosh ``` -------------------------------- ### Install Build Dependencies Source: https://docs.synocommunity.com/developer-guide/setup/lxc Installs a comprehensive set of build tools and libraries required for spksrc development. ```bash lxc exec spksrc -- /usr/bin/apt install --no-install-recommends -y \ autoconf-archive autogen automake autopoint \ bash bash-completion bc bison build-essential \ check cmake curl cython3 debootstrap ed expect \ fakeroot flex gh g++-multilib gawk gettext gfortran \ git gobject-introspection gperf imagemagick intltool \ jq libbz2-dev libc6-i386 libcppunit-dev libelf-dev \ libffi-dev libgc-dev libgmp3-dev libicu76 libltdl-dev \ libmount-dev libncurses-dev libpcre2-dev libssl-dev \ libtool libtool-bin libunistring-dev lzip man-db manpages-dev \ moreutils nasm p7zip patchelf php pkg-config plocate \ rename ripgrep rsync ruby-mustache scons subversion \ sudo swig texinfo time tree unzip xmlto yasm \ zip zlib1g-dev ``` -------------------------------- ### Framework include hierarchy: entry-point .mk files and helper directories Source: https://docs.synocommunity.com/framework/makefile-system Shows the complete file layout of the SynoCommunity framework: entry-point .mk files at the mk/ root and per-subsystem helper directories. Use it to understand which entry point and helper files are involved for a given build type (cross, native, SPK, wheel, toolchain, toolkit). The comments note auto-loading behavior (spksrc.common.mk), pipeline steps (download -> install), and conditional files (e.g., ffmpeg.mk when FFMPEG_PACKAGE is set). ```makefile # Foundation — auto-loaded by every entry point (see Macros); entry points # also pull in the shared Core files and the build pipeline below. spksrc.common.mk spksrc.common/ ├── archs.mk # architecture classification / groups ├── directories.mk # work/staging/distrib directory layout ├── help.mk # context-aware `make help` inside a package ├── logs.mk # logging helpers ├── macros.mk # GNU Make helper macros └── stage0.mk # parse-time toolchain pre-bootstrap (TC_GCC) # Build pipeline — the per-package steps spksrc.build.mk # standard pipeline aggregator (download -> install), # included by spksrc.cross-cc.mk and spksrc.native-cc.mk spksrc.build/ ├── download.mk # source download ├── checksum.mk # archive verification ├── extract.mk # archive extraction ├── patch.mk # patch application ├── configure.mk # configure ├── compile.mk # compile ├── install.mk # install to staging ├── plist.mk # package list generation (cross/kernel/cross-virtual; not in build.mk) ├── ninja.mk # ninja helper (cmake/meson) └── archive.mk # optional post-install archive (ARCHIVE_NAME) # Rules — shared targets / orchestration, included by the entry points spksrc.rules.mk # rules entry point: clean/changelog targets, # aggregates dependency-tree.mk + generate-digests.mk spksrc.rules/ ├── depend.mk # dependency resolution/build ├── dependency-tree.mk # dependency graph ├── generate-digests.mk # digests generation ├── pre-check.mk # pre-build validation ├── status.mk # build status tracking ├── supported.mk # arch/version support (build-arch-* targets) └── tests.mk # test harness rules # Cross-compilation entry points (a cross/ package includes one) spksrc.cross-cc.mk # autotools / plain C/C++ spksrc.cross-cmake.mk # CMake spksrc.cross-dotnet.mk # .NET spksrc.cross-go.mk # Go spksrc.cross-meson.mk # Meson spksrc.cross-rust.mk # Rust spksrc.cross/ # environment setup loaded by the entry points above ├── cmake-toolchainfile.mk # generated CMake toolchain file ├── env-cmake.mk ├── env-default.mk # base cross env ├── env-dotnet.mk ├── env-go.mk ├── env-meson.mk ├── env-rust.mk └── meson-crossfile.mk # generated Meson cross file # Native build entry points spksrc.native-cc.mk spksrc.native-cmake.mk spksrc.native-install.mk spksrc.native-meson.mk spksrc.native/ ├── env-cmake.mk ├── env-default.mk # base native env └── env-meson.mk # SPK assembly entry point spksrc.spk.mk spksrc.spk/ ├── copy.mk # dependency copying to staging ├── icon.mk # icon processing ├── publish.mk # publish to package server └── strip.mk # binary stripping # Meta-consumer entry point (sets up the meta(s), then includes spksrc.spk.mk) spksrc.spk-meta.mk spksrc.spk-meta/ ├── base.mk # SPK_BASE_TEMPLATE ├── ffmpeg.mk # when FFMPEG_PACKAGE is set ├── meta.mk # generates tc_vars.meta.mk ├── python.mk # when PYTHON_PACKAGE is set └── videodriver.mk # when VIDEODRV_PACKAGE is set # Service configuration entry point spksrc.service.mk spksrc.service/ ├── create_links ├── installer.dsm5 ├── installer.dsm6 ├── installer.dsm7 ├── installer.functions ├── non-startable ├── privilege-installasroot ├── start-stop-status ├── testcase ├── use_alternate_tmpdir └── use_alternate_tmpdir.dsm7 # Python wheel entry point spksrc.wheel.mk spksrc.wheel/ ├── compile.mk ├── download.mk ├── env.mk ├── install.mk └── requirement.mk # Toolchain entry point spksrc.toolchain.mk spksrc.toolchain/ ├── overlay-binutils.mk # binutils 2.30 overlay (as/ld); OVERLAY_ family base ├── overlay-rustc.mk # custom from-source rustc overlay (OVERLAY_RUSTC) ├── tc-base.mk ├── tc-flags.mk ├── tc-normalize.mk ├── tc-rust.mk # rustup base install (rustup-rustc target) ├── tc-url.mk ├── tc-versions.mk └── tc_vars.mk # generates the tc_vars* files # Toolkit entry point (only via REQUIRE_TOOLKIT) spksrc.toolkit.mk spksrc.toolkit/ ├── tk-base.mk ├── tk-flags.mk ├── tk-normalize.mk ├── tk-url.mk ├── tk-versions.mk └── tk_vars.mk # generates the tk_vars* files ``` -------------------------------- ### Define Build and Native Dependencies Source: https://docs.synocommunity.com/developer-guide/packaging/makefile-variables Example showing how to specify packages required for building and inclusion in the final SPK. ```makefile # Include these in the SPK DEPENDS = cross/curl cross/openssl3 # Only needed during build BUILD_DEPENDS = native/cmake ``` -------------------------------- ### Install Required Packages Source: https://docs.synocommunity.com/developer-guide/setup/vm Commands to enable 32-bit architecture and install necessary build and Python dependencies on Debian. ```bash # Enable 32-bit architecture (required for some toolchains) sudo dpkg --add-architecture i386 sudo apt update # Install build dependencies sudo apt install --no-install-recommends -y \ autoconf-archive autogen automake autopoint \ bash bash-completion bc bison build-essential \ check cmake curl cython3 debootstrap ed expect \ fakeroot flex gh g++-multilib gawk gettext gfortran \ git gobject-introspection gperf imagemagick intltool \ jq libbz2-dev libc6-i386 libcppunit-dev libelf-dev \ libffi-dev libgc-dev libgmp3-dev libicu76 libltdl-dev \ libmount-dev libncurses-dev libpcre2-dev libssl-dev \ libtool libtool-bin libunistring-dev lzip man-db manpages-dev \ moreutils nasm p7zip patchelf php pkg-config plocate \ rename ripgrep rsync ruby-mustache scons subversion \ sudo swig texinfo time tree unzip xmlto yasm \ zip zlib1g-dev # Install Python dependencies sudo apt install --no-install-recommends -y \ httpie mercurial meson ninja-build \ python3 python3-mako python3-pip python3-setuptools \ python3-virtualenv python3-yaml ``` -------------------------------- ### Example SSH connection Source: https://docs.synocommunity.com/user-guide/ssh Example SSH connection using the admin account and a sample IP address. You will be prompted for your DSM password. ```bash ssh admin@192.168.1.100 ``` -------------------------------- ### Validate Intel Quick Sync (QSV) for Transcoding with ffmpeg7 Source: https://docs.synocommunity.com/packages/ffmpeg Run this FFmpeg command to test QSV hardware transcoding. It initializes the QSV device using the render node, uploads frames to hardware, scales with QSV, and encodes with h264_qsv. If QSV is not properly configured, an error about QSV mapping will appear. ```bash ffmpeg7 -hide_banner -init_hw_device qsv=hw,child_device=/dev/dri/renderD128 \ -filter_hw_device hw -i input.mp4 \ -vf 'hwupload=extra_hw_frames=64,scale_qsv=format=nv12' \ -c:v h264_qsv -preset veryfast output_qsv.mp4 ``` -------------------------------- ### Common Transmission settings.json example Source: https://docs.synocommunity.com/packages/transmission Example JSON configuration for Transmission settings, showing download directory, RPC authentication, and speed limits. ```json { "download-dir": "/volume1/downloads", "rpc-authentication-required": true, "rpc-username": "admin", "rpc-password": "your-password", "speed-limit-down": 1000, "speed-limit-down-enabled": true } ``` -------------------------------- ### Start interactive root shell Source: https://docs.synocommunity.com/user-guide/ssh Starts an interactive root shell. Be careful when running commands as root; incorrect commands can damage your system. ```bash sudo -i ``` -------------------------------- ### Wrapper script for DSM 5/SRM compatibility Source: https://docs.synocommunity.com/developer-guide/advanced/ash-pid-issue Recommended wrapper script that handles backgrounding and PID capture. Requires `SYNOPKG_PKGDEST` and `PID_FILE` to be set; do not set `SVC_BACKGROUND=y` in service-setup.sh and export required variables before calling. ```shell #!/bin/sh # start.sh - wrapper for DSM 5/SRM compatibility if [ -z "${SYNOPKG_PKGDEST}" ] || [ -z "${PID_FILE}" ]; then echo "ERROR: Required variables not set" exit 1 fi ${SYNOPKG_PKGDEST}/bin/myapp --some-arg & echo "$!" > "${PID_FILE}" ``` -------------------------------- ### Update Mono certificate store with cert-sync Source: https://docs.synocommunity.com/packages/mono Command to update the Mono certificate store with the currently installed ca-certificates of DSM. Run at package installation. ```text /var/packages/mono/target/bin/cert-sync /etc/ssl/certs/ca-certificates.crt ``` -------------------------------- ### Stop, edit, and start Transmission service Source: https://docs.synocommunity.com/packages/transmission Commands to stop the Transmission service, edit the settings file, and start the service again. Required before editing settings.json. ```bash synopkg stop transmission vim /var/packages/transmission/var/settings.json synopkg start transmission ``` -------------------------------- ### Run with proxy configuration Source: https://docs.synocommunity.com/developer-guide/setup/docker Start the container with HTTP and HTTPS proxy environment variables. ```bash docker run -it --platform=linux/amd64 \ -v $(pwd):/spksrc \ -w /spksrc \ -e http_proxy="http://proxy:3128" \ -e https_proxy="http://proxy:3128" \ ghcr.io/synocommunity/spksrc /bin/bash ``` -------------------------------- ### Run with custom network Source: https://docs.synocommunity.com/developer-guide/setup/docker Start the container with port mapping for external service access. ```bash docker run -it --platform=linux/amd64 \ -v $(pwd):/spksrc \ -w /spksrc \ -p 8080:8080 \ ghcr.io/synocommunity/spksrc /bin/bash ``` -------------------------------- ### Mono certificate update script path Source: https://docs.synocommunity.com/packages/mono Script installed by the package installer for later certificate updates. Can be run manually or via DSM Task Scheduler. ```text /var/packages/mono/var/update_ca_certificates.sh ``` -------------------------------- ### Complete data-share resource with permissions Source: https://docs.synocommunity.com/developer-guide/packaging/resource-files Complete data-share resource example with share name and read-write permission for a wizard-defined user. Port and command-line links are typically handled via Makefile variables (FWPORTS and SPK_COMMANDS). ```json { "data-share": { "shares": [ { "name": "{{wizard_data_share}}", "permission": { "rw": ["{{wizard_data_share_user}}"] } } ] } } ``` -------------------------------- ### Custom build steps Source: https://docs.synocommunity.com/developer-guide/packaging Shows how to define custom build steps using pre_configure_target and post_install_target. The pre_configure_target copies a config header, and post_install_target copies extra files to the staging prefix. ```makefile # Run before configure pre_configure_target: cp myconfig.h $(WORK_DIR)/$(PKG_DIR)/ # Run after install post_install_target: @$(MSG) Installing extra files cp -r extra/* $(STAGING_INSTALL_PREFIX)/ ```