Repo management

edit

Repo management

edit

Code starts with an overview of your repositories. You can then use the UI to add, delete, and reindex a repo.

code repo management

Add and delete a repo

edit

The Import your first repository page provides step-by-step instructions for adding a GitHub repo to Code. You can fine-tune the hostname of the git clone URL in your kibana.yml file.

For security reasons, Code allows only a few trusted hostnames, such as github.com. To clone private repositories see add an SSH key.

To delete a repository, go to the Repositories tab, find the name of the repo, and click Delete.

Clone private repo with an SSH key

edit

Clones of private repos require an SSH key for authentication. The username associated with your host must have write access to the repository you want to clone.

The following section provides links for generating your ssh key through GitHub. If you already have an SSH key added through your host, skip to step 4.

  1. Generate an ssh key.
  2. Add the ssh key to your ssh-agent.
  3. Add the ssh key to your host.
  4. Copy the ssh key into data/code/credentials/ under the Kibana folder.

You can now copy private Git repositories into Code.

To delete a repository, find the go to the Repositories tab, find the name of the repo and click Delete.

Reindex a repo

edit

Code automatically reindexes an imported repo at set intervals, but in some cases, you might need to refresh the index manually. For example, you might refresh an index after a new language server installs. Or, you might want to update the index to the HEAD revision immediately. Click Reindex to initiate a reindex.

Clone URL management

edit

For security reasons, Code only allows the following hostnames in the git clone URL by default:

  • github.com
  • gitlab.com
  • bitbucket.org
  • gitbox.apache.org
  • eclipse.org

You can add your own hostname (for example, acme.com) to the whitelist by adding the following line to your config/kibana.yaml file:

xpack.code.security.gitHostWhitelist: [ "github.com", "gitlab.com", "bitbucket.org", "gitbox.apache.org", "eclipse.org", "acme.com" ]

Set xpack.code.security.gitHostWhitelist to [] (empty list) allow any hostname.

You can also control the protocol to use for the clone address. By default, the following protocols are supported: [ 'https', 'git', 'ssh' ]. You can change this value by adding the following line to your config/kibana.yaml file. In this example, the user only wants to support the https protocol:

xpack.code.security.gitProtocolWhitelist: [ "https" ]

Limitations

edit

Consider the following limitations before cloning repositories:

  • Only Git is supported. Other version control systems, such as Mercurial and SVN, are not supported.
  • Your disk might not have enough space to clone repositories due to Kibana watermark settings. To update your watermark settings, contact your system administrator and request additional disk space.