Skip to content

Repositories

Repositories provide a way for you to use your own storage for saving endpoints. This allows for you to handle your own backups, imports, version control, etc right from your favourite Git provider. Some examples of Git providers are GitHub, Bitbucket, and GitLab, although there are many more, including self-hosted options.

To use the repository sync feature, your tenant must have this option enabled. Please request this using support@airelogic.com

Adding a repository

The process of adding a repository is reasonably simple. You'll need to know your repository URL (you can find this out from your provider), and any credentials needed to read from it. You should also ensure that this repository contains a valid AireGlu file structure (see Repository Layout below).

  • Go to the Repositories section, and click the + button at the top right corner of the page
  • Choose your authentication method (see below for more information on each)
  • Enter the repository URL (starting with https:// or git@, depending on if you're using SSH authentication)
  • Select the repository branch (will default to master if not specified)
  • If you are using auto sync and want to be notified of any problems, enter your email address in Error email
  • If you want to automatically pull in changes that you make in git, check the Auto Sync Repository option. If you want to do this manually, make sure this option is not ticked.
  • If you are using authentication then enter the appropriate details (see below)
  • Click Test and Save to verify AireGlu can connect to your repository

Authentication

It is likely, and reccomended, that your repository requires some form of authentication before it can be used. There are 3 options available to you for this. None, Credentials, and SSH.

None

While not recommended, you may use a repository that does not require any authentication and is publicly readable and writable. There is nothing extra to configure here, but be aware that anyone will be able to see or change your endpoints if they find your repository.

Credentials

Credentials allows for the use of a username and password to login to the repository. AireGlu will act as the user whose credentials have been used, and will appear on the commit history as that user.

SSH

Finally authentication can be completed with the use of a public and private key pair, using SSH. This is the most complex to set up, as it requires generating a key pair, adding the public key to your Git repository, and the private key to AireGlu. It is reccomended to ensure this private key is not used anywhere else for security reasons. The benefit of this approach is that each device that uses SSH to connect can have its own key that can be revoked if it gets compromised, without affecting any of the other devices.

When using SSH authentication, your repository url should begin with git@ or something similar. It should not start with https://.

GitHub and Bitbucket both have guides on how to set up a key for your account as examples, but most providers support this feature, and will offer some support in setting it up.

Repository Layout

When connecting a repository to AireGlu, it expects a specific file structure to be in place to correctly sync your endpoints. These files are expected to be in a specific format that AireGlu can use. The easiest way to ensure this is correct is to export any current endpoints either to YAML or JSON first.

 + Endpoints/
 | + MyJsonEndpoint/
 | | - endpoint.json
 | | + Functions/
 | | | - myFunction.js
 | + MyYamlEndpoint/
 | | - endpoint.yml

Exporting an Endpoint Config

In order to export an endpoint for saving to git, follow these steps:

  • Go to the Endpoints page in AireGlu
  • Find the endpoint you want to export, and click on the export button (box with an arrow icon) on the endpoint overview
  • Choose your preferred format
  • Decide whether to include encrypted values
    • this determines whether sensitive fields within the endpoint have their values include in the export, or whether a placeholder is used (which must be replaced for the endpoint to function after import/repository synchronisation). If you have used AireGlu secret references in sensitive fields such as password fields, then choose Include encrypted values and these will be included in the endpoint definition
  • Paste the export into a Notepad file named endpoint.yml if you chose YAML format, or endpoint.json if you chose JSON format

    IMPORTANT

    This must be a plain text file created by Notepad or similar. Do not use programs such as Word to create this file as they will not work and could casue damage to your setup when imported.

  • Save or copy this file to your repository at {repository path}/Endpoints/your-endpoint-name/