[Code]: Add content for cloning repositories (#46389)

* [DOCS] Fix beta tag in Code Docs

* Add additional content about cloning repos

* More grammar edits

* Address Gail's feedback.

* Fix build errors

* Another build fix
This commit is contained in:
Nate Archer 2019-09-27 18:58:10 -05:00 committed by GitHub
parent 3b0e7d79a6
commit 775c17ffd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 10 deletions

View file

@ -29,7 +29,7 @@ xpack.code.ui.enabled: true
https://github.com/Microsoft/TypeScript-Node-Starter
----
`https` is recommend for cloning git repositories.
`https` is recommend for cloning most git repositories. To clone a private repository, <<code-repo-management, use SSH>>.
. Click *Import*.
+

View file

@ -6,20 +6,40 @@ Code starts with an overview of your repositories. You can then use the UI to a
image::images/code-repo-management.png[]
[float]
[[add-delete-a-repo]]
==== Add and delete a repo
The <<code-import-first-repo, 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.
The <<code-import-first-repo, 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, by default. You can add an SSH key to {kib} to clone private repos.
For security reasons, Code allows only a few <<clone-url-management,trusted hostnames>>, such as github.com. To clone private repositories see <<clone-private-repo,add an SSH key>>.
Deleting a repo removes it from local storage and the Elasticsearch index.
To delete a repository, go to the **Repositories** tab, find the name of the repo, and click *Delete*.
[float]
[[clone-private-repo]]
==== Clone private repo with an SSH key
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. https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key[Generate an ssh key].
2. https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent[Add the ssh key to your ssh-agent.]
3. https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account[Add the ssh key to your host].
4. Copy the ssh key into `data/code/credentials/` under the {kib} 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*.
[float]
[[reindex-a-repo]]
==== Reindex a repo
*Code* automatically reindexes an imported repo at set intervals, but in some cases you might need to manually refresh the index. For example, you might refresh an index after a new language server is installed. Or, you might want to immediately update the index to the HEAD revision. Click *Reindex* to initiate a reindex.
In some cases you might need to manually refresh the index besides automatic indexing. For example, you might refresh an index after a new language server is installed. Or, you might want to immediately update the index to the HEAD revision. Click *Reindex* to initiate a reindex.
*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.
[float]
[[clone-url-management]]
==== Clone URL management
For security reasons, *Code* only allows the following hostnames in the git clone URL by default:
@ -46,9 +66,11 @@ xpack.code.security.gitProtocolWhitelist: [ "https" ]
----
[float]
==== Clone repo with SSH key
If your repo clone requires an SSH key for authentication, put the SSH key in `data/code/credentials/` under the {kib} folder.
[[repo-limitations]]
==== Limitations
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 {kib} watermark settings. To update your watermark settings, contact your system administrator and request additional disk space.
include::code-install-lang-server.asciidoc[]