update README with Alternative Domains & Sub-Domains

This commit is contained in:
basebuilder 2024-06-13 14:17:06 +02:00
parent f7d721ff0a
commit 21e1275cad

View File

@ -76,13 +76,14 @@ Then, you need to remove the final newline of the file:
$ truncate -s -1 <ssh-private-key-file>
```
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:
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 SSH private key file manually.
If you are deploying a site that is an alternative domain or sub-domain from the server name, please read [this troubleshooting note](#alternative-domainssub-domains).
```
$ DOCKER_CONTEXT=example.org docker secret create example_org_deploy_key_v1 /path/to/ssh-private-key
```
Assuming that completes with no errors, run the following command to confirm:
If that completes with no errors, run the following command:
```
$ abra app secret ls example.org
@ -98,20 +99,24 @@ If successful, you should see `true` in the far right column.
+------------+---------+----------------------------+-------------------+
```
Then, you need to upload the public SSH key part to the Git repository settings
as a "Deploy key". In *Gitea*, that is located in:
You now need to upload the public SSH key part to the Git repository settings
as a `Deploy Key`, which in *Gitea/Forgejo* is located in the web UI at:
```
Repository -> Settings > Deploy keys
```
Or via URL path:
Or via URL:
- https://codeberg.org/user/website-repo/settings/keys
You can then deploy and the deploy key will be loaded before cloning the private
repository and all should nicely.
```
$ abra app deploy example.org
```
### HTTP Basic Auth & Private Repository
@ -154,6 +159,23 @@ abra app run <domain> badger sh
cat /etc/nginx/.htpasswd
```
#### Alternative Domains & Sub-Domains
If you are deploying a private repository where a *alternative domain*
(`alternative.com`) or a *sub-domain* (`sub.example.org`) from that of the
server `example.org` you need to craft a special `DOCKER_CONTEXT` value. If your
apps are named:
- `alternative.com`
- `sub.example.org`
Then the respective commands would be:
```
$ DOCKER_CONTEXT=example.org docker secret create alternative_com_deploy_key_v1 /path/to/ssh-private-key
$ DOCKER_CONTEXT=example.org docker secret create sub_example_org_deploy_key_v1 /path/to/ssh-private-key
```
For more details documentation, see the *Coop-Cloud Docs*
- [`docs.coopcloud.tech`](https://docs.coopcloud.tech)