Software repositories

In NS8, applications are available from remote application indexes known as “repositories.”

Cluster configuration

During installation, two repositories are configured:

  • default (enabled)
  • nethforge (disabled)

Key points:

  • You can configure additional repositories in an NS8 cluster.
  • Each repository can be in either an enabled or disabled state.
  • The list of available modules in NS8 is generated by merging data from all enabled repositories.
  • If two repositories contain modules with the same name, the module from the repository with higher priority is used, and others are ignored.
  • Repository priority is determined by the alphabetical order of repository names, with names later in the alphabet (e.g., “Z”) having higher priority than those earlier (e.g., “A”).
  • If a repository has the testing flag enabled, pre-releases are treated as stable and are included in application update calculations.

Repository configurations are stored in a Redis HASH with the key prefix cluster/repository/. For example, to view the configuration of the default repository, run:

redis-cli HGETALL cluster/repository/default

To enable the testing flag (for QA purposes only), use the following command:

redis-cli HSET cluster/repository/default testing 1

Note: If the testing flag is manually enabled, it will be reset to 0 after the next core update.

Repository metadata is downloaded and cached in Redis for 3600 seconds. To clear an existing repository cache, run:

redis-cli del cluster/repository_cache/<repository_name>

Create a repository

An NS8 repository must contain a file named repodata.json, which describes the content of the repository. Its format is detailed in repodata-schema.json.

Examples of existing repositories include:

To create a personal repository, you can copy the scripts from NethForge that generate repodata.json. The createrepo.sh command analyzes a directory passed as a parameter. If no path is given, it walks through the current working directory.

Each module that needs to be published inside the repository should have a directory named after the module itself. The directory should contain:

  • A file named metadata.json: this contains all module metadata such as the name and the URL of the image in the registry. It uses the same format as the UI metadata.json.
  • A file named logo.png: a PNG file with dimensions of 256x256 pixels.
  • A directory named screenshots: it can contain one or more images, each in PNG format, with a resolution of 1024x768 pixels.

For each directory found, createrepo.sh uses the directory name to query the remote image registry with skopeo and retrieve image tags. If the tags are valid semantic versions, they are added to the list of available module versions.

See the dokuwiki directory for an example of a complete module metadata directory.

The resulting repodata.json and the application directories can then be uploaded to a public website.