Page Contents

Overview

Bintray works seamlessly with the Opkg client. You can use the Opkg client to resolve packages from Bintray, and upload Opkg packages using any compatible command line tool such as cURL.

Tip
To get code snippets formulated for your specific username and repository, use the Set Me Up button.

Downloading Files

To download files using Bintray’s REST API, please refer to Downloading Using APIs.

Resolving Opkg Packages

To use a Bintray repository to resolve and install ipk packages, you need to add an indexed path (a feed) to your opkg.conf file. You can do that using the following command:

 echo 'src <FEED_NAME> https://dl.bintray.com/<USERNAME>/<REPOSITORY_NAME>/<FILE_TARGET_PATH>' >> /etc/opkg/opkg.conf

If you want your client to download the .gz variant of the Packages index file instead, change the src part to src/gz. To access Bintray using credentials you can specify them in the opkg.conf file as follows:

 echo 'option http_auth <USERNAME>:<API_KEY>' >> /etc/opkg/opkg.conf

Your Opkg client will use the specified Bintray repositories to install the package:

 opkg install <PACKAGE>

Uploading Files

Distributing files via Bintray includes three steps: creating a version, uploading the files and publishing the files as follows:

  1. Creating a Version: Uploaded files are associated with a specific version of a package. In some cases, the upload process creates the version automatically; in other cases you need to create a target version through the Bintray UI or using the REST API.

  2. Uploading: You can upload (or deploy) your files using cURL as described below. After uploading your files, the files have a status of "un-published". This means that in the Bintray UI, they are only visible to you and can only be downloaded with your username and API Key. While your uploaded files are still "un-published", you can still discard them before anyone sees or downloads them. The Bintray UI indicates files that are un-published and provides links to publish or discard them.

  3. Publishing: Once you are ready to expose your uploaded files, you can publish them and make them visible and available to all Bintray users. Files can be published via the Bintray UI, or via the REST API, both as part of the upload, or separately. In some cases, uploading the files publishes them automatically, so you can skip this step.

The cURL command to upload Opkg packages is as follows:

 curl -T <FILE.ipk> -u<USER_NAME>:<API_KEY> https://api.bintray.com/content/<USERNAME>/<REPOSITORY_NAME>/<PACKAGE_NAME>/<VERSION_NAME>/<FILE_TARGET_PATH>

For more details (including repository signing), please refer to the REST API documentation under Upload Content.

Once your ipk package is uploaded, Bintray automatically calculates the repository-wide Opkg metadata.

Signing Opkg Package Indexes

Bintray uses your GPG public and private keys to sign and verify Opkg package indexes. To learn how to generate a GPG key pair and upload it to Bintray, please refer to GPG Signing. Once you have GPG key pair, to have Opkg verify signatures created with the private key you uploaded to Bintray, you need to import the corresponding public key into Opkg’s keychain (requires gnupg).

# Commands taken from opkg-utils package:
mkdir /etc/opkg
gpg --no-options --no-default-keyring --keyring /etc/opkg/trusted.gpg --secret-keyring /etc/opkg/secring.gpg --trustdb-name /etc/opkg/trustdb.gpg --batch --import key.pub

After the key is imported you need to add the check_signature option in your opkg.conf file by adding the following entry:

option check_signature true