# App Center and package repositories

How a QPKG reaches other NAS units: App Center, its repositories (a `repo.xml` feed), a repository of your own on
a web server, and Bucket & Code Server IDE's own repository. Signing is its own page: [signing.md](signing.md).

## App Center

- App Center installs, updates, starts, stops and removes QPKGs. Besides QNAP's own store it reads third-party
  repositories: App Center, **Settings**, **App Repository**, **Add**, and the repository's address (a URL of an
  XML file).
- A manual install takes a `.qpkg` file from the computer. On the NAS itself, `qpkg_cli -m <file> --keep` installs
  one for a test (without `--keep` it deletes the file); copy the file to a shared folder first, never to `/tmp`.
- App Center checks each package's code signature at install ([signing.md](signing.md)). Do not tell anyone to
  allow apps without a valid digital signature.
- `QTS_MINI_VERSION` in `qpkg.cfg` is the lowest firmware that installs a package. QuTS hero 6.x and QTS 6.0 report
  `5.2.10` in `/etc/config/uLinux.conf`, so a floor above that number keeps them out; a program that needs a newer
  firmware checks for itself when it starts ([qpkg.md](qpkg.md)).

## The repository feed

A repository is one XML file that App Center fetches, and the package files it links to. Bucket & Code Server IDE
writes it like this (`<base>` is the repository's address), and a feed you write yourself follows the same form:

```xml
<?xml version="1.0" encoding="utf-8"?>
<plugins>
  <cachechk>…</cachechk>
  <item>
    <name>My Tool</name>
    <internalName>mytool</internalName>
    <version>0.1.0</version>
    <description><![CDATA[…]]></description>
    <icon80><base>/repo/icons/mytool_80.png</icon80>
    <icon100><base>/repo/icons/mytool_100.png</icon100>
    <platform>
      <platformID>TS-NASX86</platformID>
      <location><base>/repo/packages/mytool/0.1.0/mytool_0.1.0_x86_64.qpkg</location>
      <signature>…</signature>
    </platform>
    <publishedDate>2026/09/27</publishedDate>
    …
  </item>
</plugins>
```

- One `<item>` per package, for its one listed version. App Center offers that version and nothing older.
- `<cachechk>` changes only when something else in the file did: App Center fetches the feed again when it changes.
- `<platformID>` per architecture of the package file: `TS-NASX86` for x86_64, `TS-NASARM_64` and `TS-X28A` for
  64-bit ARM (`arm_64`), `TS-X41` for 32-bit ARM (`arm-x41`).
- `<signature>` is the last 32 base64 characters of the package's code-signing block. An unsigned package has no
  `<signature>`, and Bucket & Code Server IDE adds "This version carries no code signature." to its description.
- QDK names a package file `<name>_<version>_<arch>.qpkg` when it builds for one architecture (`--build-arch`), and
  `<name>_<version>.qpkg` otherwise. The architecture in the name is QDK's (`x86_64`, `arm_64`, `arm-x41`), not
  App Center's platform id; `bvs repo publish --arch` names it for a file without one.

## Your own repository, without Bucket & Code Server IDE

- Any HTTPS web server can serve a repository: `repo.xml` in the form above, and the package files and icons it
  links to. A static file on an ordinary web host works.
- Each NAS adds its address in App Center: **Settings**, **App Repository**, **Add**.
- Write one `<item>` per package for its listed version. When you publish a new version, upload its file, change
  `<version>`, `<location>` and `<signature>`, and change `<cachechk>` so that App Center fetches the feed again.
- A signed `qbuild` writes the `<signature>` value beside the package: `build/<file>.qpkg.codesigning` holds the
  last 32 base64 characters of the code-signing block.
- List signed packages only. An unsigned one has no `<signature>`, and App Center installs it only where the NAS's
  owner allows apps without a valid digital signature, which you do not recommend ([signing.md](signing.md)).

## Bucket & Code Server IDE's repository

```sh
bvs repo list                                          # its address for App Center, and its packages
bvs repo publish build/mytool_0.1.0_x86_64.qpkg [--arch x86_64|arm_64|arm-x41] [--latest]
```

- The address is `<base>/repo/repo.xml`. `<base>` is the published packages host (else the published full host)
  while the package is published on the internet, else its public URL, else `http://<NAS address>:9950`
  (`https://…:9951` when plain HTTP only redirects).
- It takes code-signed packages only. An admin can let unsigned ones in on the Packages page
  (`repo.accept_unsigned`); do not suggest it ([signing.md](signing.md), case 3).
- An admin's first version of a package is listed at once; a later one when the admin makes it the latest
  (`--latest`). A developer's publish waits until an admin lists a version: every NAS that added the repository
  installs the listed version as root.
- The name, version, description and author come from the package's own `qpkg.cfg`; an admin changes what App
  Center shows (texts, links, a PNG icon) on the Packages page.
- The QPKG template's workflow builds with `bvs qbuild` and publishes into this repository at every push; an
  unsigned build is not published, and the run ends with a warning.

## Sources

Bucket & Code Server IDE's user guide (`bvs guide`, "Package repository") and its feed writer; QDK 2.5.0's
`qbuild` for the file names, the code-signing block and the `.codesigning` file (on a test package signed with a
throwaway certificate, its value matched the feed writer's reading of the same file). A `repo.xml` served as a static
file from an ordinary web host was used while building QPKGs with QDK 2.5.0 on Ubuntu 24.04 for QTS 6.1 and QuTS
hero 6.1 units.
