Package Format


NAS OS apps are distributed under the form of package files. The packages have the extension .rbw, named after the NAS OS SDK tool rainbow. A .rbw file is an uncompressed TAR archive with the following content:

Name Description
version The package’s format version (not the app version)
package.json The main package metadata file
package-extra.json The package publishing metadata
content.tar.gz The actual package content
scripts/pre-install The package’s pre-install script
scripts/post-install The package’s post-install script
scripts/pre-update The package’s pre-update script
scripts/post-update The package’s post-update script
scripts/pre-remove The package’s pre-remove script
scripts/events Script called when an event is received by the package
resources/icons/ The package’s icons
resources/screenshots/ The package’s screenshots
package.key The package’s public key
package.sig The package’s signature

Packages files are named as follows:

<package_id>-<package_version>-<package_architecture>.rbw

An example would be:

com.mycompany.myapp-1.0-x86_64.rbw

Metadata

The package.json file is a JSON file that contains the package’s metadata. You will find below a detailed description of each supported field.

Note

Only the mandatory fields have to be specified. The optional fields can be omitted if they are not required by the app. In such cases, the default value will be assumed for each omitted field.


id

{
    "id": "com.seagate.my_app"
}

version

{
    "version": "1.2.3"
}

architecture

{
    "type": "x86_64"
}
{
    "type": "armv5"
}
{
    "type": "armv7"
}
{
    "type": "x86_64"
}

type

{
    "type": "application"
}
{
    "type": "container"
}
{
    "type": "utility"
}
{
    "type": "application"
}

Note

For app developers, the only relevant type is application. Other types are internal to the SDK and can only be used as dependencies. Always specify application for your app type.


depends

{
    "depends": [
        "org.debian.wheezy-lamp-1.2",
        "com.nasos.unicorn_api-5.0.1"
    ]
}
{
    "depends": []
}

conflicts

New in SDK 0.7, requires NASOS ≥ 4.2.

To specify a conflict for an app older than version 0.9:

{
    "conflicts": [{"id": "com.vendor.conflicting_app", "to": "0.9"}]
}

To specify a conflict for an app regardless of versions:

{
    "conflicts": [{"id": "com.vendor.conflicting_app"}]
}

To specify a conflict for an app with a given version 1.5:

{
    "conflicts": [{"id": "com.vendor.conflicting_app", "from": "1.5", "to": "1.5"}]
}

To specify a conflict for an app between versions 0.1 and 0.5 and between versions 0.8 and 0.9:

{
    "conflicts": [
        {"id": "com.vendor.conflicting_app", "from": "0.1", "to": "0.5"},
        {"id": "com.vendor.conflicting_app", "from": "0.8", "to": "0.9"}
    ]
}
{
    "conflicts": []
}

network_ports

{
    "network_ports": {
        "WEB_UI": 8080,
        "DOWNLOAD": 1234,
        "UPLOAD": 4567
    }
}
{
    "network_ports": {}
}

fixed_ports

{
    "fixed_ports": [
        "DOWNLOAD",
        "UPLOAD"
    ]
}
{
    "fixed_ports": []
}

port_mapping

{
    "port_mapping": [
        "UPLOAD"
    ]
}
{
    "port_mapping": []
}

settings

{
    "settings": {
        "my_custom_setting": "my_custom_value"
    }
}

The setting will be available as $RAINBOW_MY_CUSTOM_SETTING

{
    "settings": {}
}

startup_mode

{
    "startup_mode": "auto"
}
{
    "startup_mode": "manual"
}
{
    "startup_mode": "auto"
}

display_mode

To open the app in a new tab:

{
    "display_mode": "tab"
}

To embed the app in an iframe inside the NAS OS App Board:

{
    "display_mode": "embedded"
}
{
    "display_mode": "tab"
}

redirect_mode

To enable the reverse proxy, use the following mode:

{
    "redirect_mode": "transparent"
}

The app can be accessed with the URL http:///apps/

For a simple redirection, use:

{
    "redirect_mode": "custom"
}

The URL can be customized using the redirect_protocol and redirect_path settings

{
    "redirect_mode": "transparent"
}

redirect_protocol

{
    "redirect_protocol": "http"
}
{
    "redirect_protocol": "https"
}
{
    "redirect_protocol": "http"
}

redirect_path

{
    "redirect_path": "my_custom_path"
}

user_data_access

{
    "user_data_access": true
}
{
    "user_data_access": false
}
{
    "user_data_access": true
}

private_data_access

{
    "private_data_access": true
}
{
    "private_data_access": false
}
{
    "private_data_access": false
}

app_data

{
    "app_data": [
        "/etc/my_app.config",
        "/var/lib/my_app/",
        "/var/log/my_app*.log"
    ]
}

nasos_min_version

{
    "nasos_min_version": "4.0.1"
}

nasos_max_version

{
    "nasos_max_version": "4.2.1"
}

Warning

This field is only to be used in rare occasions where a NAS OS update breaks compatibility with an app. In most cases this should not be required


registered_events

{
    "registered_events": [
        "volume.post_insert",
        "volume.post_update",
        "volume.pre_delete"
    ]
}

events

    {
        "events": [
            {
            "name": "<event_name>",
                "args": [
                    ["<arg1_name>", "<arg1_type>"],
                    ["<arg2_name>", "<arg2_type>"]
                ]
            }
        ]
    }

Supported argument types are:

You can also specify a list by appending an * to the type specifier:

{
    "events": [
        {
            "name": "my_event",
            "args": [
                ["my_string", "unicode"],
                ["my_integer", "int"],
                ["my_strings", "unicode*"],
                ["my_integers*", "int*"]
            ]
        }
    ]
}

ra_compliant

{
    "ra_compliant": false
}

https_compliant

{
    "https_compliant": false
}