enhance Private Repo docs in README

This commit is contained in:
basebuilder 2024-03-24 19:51:39 +01:00
parent cab6a5531f
commit 6d277e052d

View File

@ -47,7 +47,7 @@ When you deploy:
* `/`: the Hugo site is served * `/`: the Hugo site is served
* `/deploy`: the webhook is behind HTTP basic auth * `/deploy`: the webhook is behind HTTP basic auth
#### Private repository #### Private Repository
If you enable this in your `.env` file: If you enable this in your `.env` file:
@ -60,30 +60,44 @@ SECRET_DEPLOY_KEY_VERSION=v1
Then you need to generate a SSH key: Then you need to generate a SSH key:
``` ```
ssh-keygen -a 100 -t ed25519 $ ssh-keygen -a 100 -t ed25519
``` ```
Then, you need to remove the final newline of the file: Then, you need to remove the final newline of the file:
``` ```
truncate -s -1 <ssh-private-key-file> $ truncate -s -1 <ssh-private-key-file>
``` ```
And due to a limitation in `abra` ([can't insert files yet](https://git.coopcloud.tech/coop-cloud/organising/issues/586)), you'll have to manually insert the secret yourself: Due to a limitation in `abra` ([can't insert files yet](https://git.coopcloud.tech/coop-cloud/organising/issues/586)), you'll have to manually ingest the privater key file with this command:
``` ```
DOCKER_CONTEXT=example.org \ $ DOCKER_CONTEXT=example.org docker secret create example_org_deploy_key_v1 /path/to/ssh-private-key
docker secret create \
parasol-static-site_example_org_deploy_key_v1 \
<ssh-private-key-file>
``` ```
Run `abra app secret ls <domain>` to get a hint about the exact formatting of the secret name. Assuming that completes with no errors, run the following command to confirm the
key was written to the server and look for `true` in the far right column:
```
$ abra app secret ls example.org
+------------+---------+----------------------------+-------------------+
| NAME | VERSION | GENERATED NAME | CREATED ON SERVER |
+------------+---------+----------------------------+-------------------+
| deploy_key | v1 | example_org_deploy_key_v1 | true |
+------------+---------+----------------------------+-------------------+
```
Then, you need to upload the public SSH key part to the Git repository settings Then, you need to upload the public SSH key part to the Git repository settings
as a "Deploy key". In Gitea, that is `Repository Settings > Deploy keys`. as a "Deploy key". In *Gitea*, that is located in:
```
Repository Settings > Deploy keys
```
You can then deploy and the deploy key will be loaded before cloning the private
repository and all should nicely.
You can then deploy and the deploy key will be loaded before cloning the private repository.
#### HTTP Basic Auth & Private repository #### HTTP Basic Auth & Private repository