Skip to content

Source plugins ​

A source plugin adds a new app store format, in addition to the built-in Git and HTTP app stores. It is declared with type: source. Apps from a source plugin are still stored and managed by n5i; the plugin only downloads them.

Source plugins are often combined with a runtime plugin for apps in a custom format.

How it works ​

  • GetConfigSchema returns the formats the plugin supports, each with the settings users fill in when adding a store (for example a URL).
  • GetAppStoreMetadata returns the name, description and icon of a store.
  • DownloadAllApps returns the metadata of all apps as a gzip-compressed tar archive, skipping skip_apps.
  • DownloadApp returns one app (optionally in a specific version) as a gzip-compressed tar archive.
  • GetAppVersions lists the versions of an app that can be installed.

RPC interface ​

proto
syntax = "proto3";

package n5i_plugin;
import "common.proto";

message SourceInfo {
  string format_id = 1;
  map<string, string> src = 2;
}

message DownloadAppRequest {
  SourceInfo source = 1;
  string app_id = 2;
  // The version to download
  optional string app_version = 3;
}

message DownloadAppResponse {
  // The directory of the app as a compressed tar archive (compressed using gzip)
  bytes app_directory = 1;
}

message DownloadAppsRequest {
  SourceInfo source = 1;
  // Already existing apps that should be skipped
  repeated string skip_apps = 2;
}

message DownloadAppsResponse {
  // A directory with all apps as a compressed tar archive (compressed using gzip)
  bytes apps_directory = 1;
}

message GetAppStoreMetadataRequest {
  SourceInfo source = 1;
}

message GetAppStoreMetadataResponse {
  MultiLanguageItem name = 1;
  MultiLanguageItem tagline = 2;
  MultiLanguageItem description = 3;
  string icon = 4;
  map<string, string> developers = 5;
  string license = 6;
}

message GetAppVersionsRequest {
  SourceInfo source = 1;
  string app_id = 2;
}

message GetAppVersionsResponse {
  repeated string versions = 1;
}

message GetConfigSchemaRequest {}

message ConfigSchema {
  string id = 1;
  MultiLanguageItem name = 2;
  MultiLanguageItem description = 3;
  map<string, Setting> settings = 4;
}

message GetConfigSchemaResponse {
  repeated ConfigSchema schemas = 1;
}

// A source plugin adds support for a custom repository format
// In most cases, it is used together with a ParserPlugin.
// Apps will still be stored in the main app manager, a source plugin just provides a way to import them from a custom source,
// for example a custom HTTP-based protocol
service SourcePlugin {
  // Download a full app directory
  rpc DownloadApp(DownloadAppRequest) returns (DownloadAppResponse) {}
  // Download metadata about all apps
  rpc DownloadAllApps(DownloadAppsRequest) returns (DownloadAppsResponse) {}
  // Get metadata about the app store itself
  rpc GetAppStoreMetadata(GetAppStoreMetadataRequest) returns (GetAppStoreMetadataResponse) {}
  // Get all available versions of an app
  rpc GetAppVersions(GetAppVersionsRequest) returns (GetAppVersionsResponse) {}

  // Get the config schema for this plugin
  rpc GetConfigSchema(GetConfigSchemaRequest) returns (GetConfigSchemaResponse) {}
}

Free and open-source software under the GNU AGPL 3.0 or later.