snappy/snapp.go:
// this is to prevent installation of legacy packages such as those that
// contain the origin/origin in the package name.
if strings.ContainsRune(m.Name, '.') {
return nil, ErrPackageNameNotSupported
}
4.2 KiB
Package metadata
This document describes the meta data of a snappy package. All files
are located under the meta/ directory.
The following files are supported:
readme.md
The readme.md file contains a description of the snap. The snappy
tools will automatically extract the heading as the short summary for
the snap and the first paragraph as the description in the store.
package.yaml
This file describes the snap package and is the most important file for a snap package. The following keys are mandatory:
name: the name of the snap (only[a-z0-9][a-z0-9+-])version: the version of the snap (only[a-zA-Z0-9.+~-]are allowed)vendor: the vendor of the snap
The following keys are optional:
-
icon: a SVG icon for the snap that is displayed in the store -
explicit-license-agreement: set toYif the user needs to accept a specialmeta/license.txtbefore the snap can be installed -
license-version: a string that, when it changes andexplicit-license-agreementisY, prompts the user to accept the license again. -
type: (optional) the type of the snap, can be:app- the default if emptyoem- a special snap that OEMs can use to customize snappy for their hardwareframework- a specialized snap that extends the system that other snaps may use
-
architectures: (optional) a yaml list of supported architectures["all"]if empty -
frameworks: a list of the frameworks the snap needs as dependencies -
services: the servies (daemons) that the snap providesname: (required) name of the service (only[a-zA-Z0-9+.-])description: (required) description of the servicestart: (required) the command to start the servicestop: (optional) the command to stop the servicestop-timeout: (optional) the time in seconds to wait for the service to stoppoststop: a command that runs after the service has stoppedcaps: (optional) list of additional security policies to add. Seesecurity.mdfor detailssecurity-template: (optional) alternate security template to use instead ofdefault. Seesecurity.mdfor detailssecurity-override: (optional) high level overrides to use whensecurity-templateandcapsare not sufficient. See security.md for detailssecurity-policy: (optional) hand-crafted low-level raw security policy to use instead of using default template-based security policy. See security.md for detailsports: (optional) define what ports the service will workinternal: the ports the service is going to connect totagname: a free form nameport: (optional) number/protocol, e.g.80/tcpnegotiable: (optional) Y if the app can use a different port
external: the ports the service offer to the worldtagname: a free form name, some names have meaning like "ui"port: (optional) see abovenegotiable: (optional) see above
bus-name: (optional) message bus connection name for the service. May only be specified for snaps of 'type: framework' (see above). See frameworks.md for details.
-
binaries: the binaries (executables) that the snap providesname: (required) the name of the binary, the user will be able to call it as $name.$pkgname (only[a-zA-Z0-9+.-])exec: the program that gets executed (can be omited if name points to a binary already)caps: (optional) see entry inservices(above)security-template: (optional) see entry inservices(above)security-override: (optional) see entry inservices(above)security-policy: (optional) see entry inservices(above)
license.txt
A license text that the user must accept before the snap can be installed.
hooks/ directory
See config.md for details.
Examples
See lp:~snappy-dev/snappy-hub/snappy-examples for up-to-date examples.