deployment-api-rs/README.md

26 lines
1.1 KiB
Markdown
Raw Normal View History

2025-06-13 00:04:43 +02:00
# deployment-api-rs
Example `config.extension` file to be created in `etc` sub-directory of working directory of this microservice:
```yaml
---
port: 8356
apps:
example-website.tld/optional_domain_path:
AUTH_TOKEN: <a super secret token sent in request>
SECRET: <another super secrete token NOT sent in request but rather used as seed to compute request payload/body hash>
REDEPLOYMENT_COMMAND: <shell command for re-deployment>
HASH_HEADER_KEY: <optional, default to `x-gitea-signature`>
HASH_FUNCTION: <optional, default to SHA512>
HASH_ENCODING: <optional, currently only support hex>
HASH_PREFIX: <optional, default to nothing (empty string)>
```
Then configure your webhook to send trigger similar to below request:
```sh
curl -X POST -H "x-gitea-signature: <computed HASH_FUNCTION hash from SECRET salt/seed and request payload/body>" --data-binary "@/path/to/some/payload" "https://example-website.tld/optional_domain_path/deploy?auth_token=<AUTH_TOKEN>"
```
Configure reverse proxy to re-direct `/deploy` endpoint requests to this microservice port.