Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve git PAT configuration documentation #2567

Merged
merged 9 commits into from
Apr 4, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ $ {orch-cli} create configmap che-git-self-signed-cert \
--from-file=ca.crt=__<path_to_certificate>__ \ <1>
--from-literal=githost=__<host:port>__ -n {prod-namespace} <2>
----
<1> Path to self-signed certificate
<2> The host and port of the HTTPS connection on the Git server (optional).
<1> Path to the self-signed certificate.
<2> Optional parameter to specify the `https://` host and port of the HTTPS connection on the Git server. When omitted, the self-signed certificate is used for all repositories over HTTPS.
+
[NOTE]
====
* When `githost` is not specified, the given certificate is used for all HTTPS repositories.
* Certificate files are typically stored as Base64 ASCII files, such as. `.pem`, `.crt`, `.ca-bundle`. Also, they can be encoded as binary data, for example, `.cer`. All `Secrets` that hold certificate files should use the Base64 ASCII certificate rather than the binary data certificate.

* Certificate files are typically stored as Base64 ASCII files, such as. `.pem`, `.crt`, `.ca-bundle`. All `ConfigMaps` that hold certificate files should use the Base64 ASCII certificate rather than the binary data certificate.

* A certificate chain of trust is required. If the `ca.crt` is signed by a certificate authority (CA), the CA certificate must be included in the `ca.crt` file.

====

. Add the required labels to the ConfigMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ With GitHub and GitLab, you can even use the URL of a specific branch of the rep
* `pass:c,a,q[{prod-url}#https://github.com/__<user_or_org>__/__<repository>__]` starts a new workspace with a clone of the default branch.
* `pass:c,a,q[{prod-url}#https://github.com/__<user_or_org>__/__<repository>__/tree/__<branch_name>__]` starts a new workspace with a clone of the specified branch.
* `pass:c,a,q[{prod-url}#https://github.com/__<user_or_org>__/__<repository>__/pull/__<pull_request_id>__]` starts a new workspace with a clone of the branch of the pull request.
====
+
.The URL syntax for starting a new workspace with a clone of a BitBucket Server repository
====

* `pass:c,a,q[{prod-url}#https://<bb-host>/scm/<project-key>/<repository_name>.git]` starts a new workspace with a clone of the default branch.
* `pass:c,a,q[{prod-url}#https://<bb-host>/users/<user-slug>/repos/<repo-name>/]` starts a new workspace with a clone of the default branch, if a repository was created under the user profile.
* `pass:c,a,q[{prod-url}#https://<bb-host>/users/<user-slug>/repos/<repo-name>/browse?at=refs%2Fheads%2F<branch-name>]` starts a new workspace with a clone of the specified branch.

====
+
After you enter the URL to start a new workspace in a browser tab, it renders the workspace-starting page.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ If you have the link:https://www.gnu.org/software/coreutils/base64[base64] comma
+
* GitHub: link:https://docs.github.com/en/rest/users/users#get-a-user[Get a user]. See the `id` value in the response.
* GitLab: link:https://docs.gitlab.com/ee/api/users.html#for-normal-users[List users: For normal users], use the `username` filter: `/users?username=:username`. See the `id` value in the response.
* Bitbucket Server: link:https://developer.atlassian.com/server/bitbucket/rest/v802/api-group-api/#api-api-latest-users-userslug-get[Get users]. See the `id` value in the response.
* Bitbucket Server: Get the `id` by running `curl -D- -u username:password -X GET -H "Content-Type: application/json" https://__<baseurl>__/rest/api/latest/users/__<userSlug>__`. See the Bitbucket API documentation about link:https://developer.atlassian.com/server/bitbucket/rest/v802/api-group-api/#api-api-latest-users-userslug-get[using the user slug] and link:https://developer.atlassian.com/server/bitbucket/how-tos/example-basic-authentication/[authentication].

. Prepare a new {orch-name} Secret.
+
Expand Down Expand Up @@ -87,7 +87,7 @@ type: Opaque
<1> Your {prod-short} user ID.
<2> The Git provider name: `github` or `gitlab` or `bitbucket-server` or `azure-devops`.
<3> The Git provider URL.
<4> Your Git provider user ID.
<4> Your Git provider user ID wrapped in `' '` or `" "`.
<5> This line is only applicable to `azure-devops`: your Git provider user organization.

. Visit `pass:c,a,q[{prod-url}]/api/kubernetes/namespace` to get your {prod-short} user namespace as `name`.
Expand Down Expand Up @@ -126,3 +126,6 @@ EOF
. xref:starting-a-new-workspace-with-a-clone-of-a-git-repository.adoc[Start a new workspace by using the URL of a remote Git repository] that the Git provider hosts.
. Make some changes and push to the remote Git repository from the workspace.

.Additional resources

* xref:administration-guide:deploying-che-with-support-for-git-repositories-with-self-signed-certificates.adoc[Deploying Che with support for Git repositories with self-signed certificates]