27 lines
1.2 KiB
Markdown
27 lines
1.2 KiB
Markdown
# deployment-api-rs
|
|
|
|
Example `config.extension` file to be created in `etc` sub-directory of working directory of this microservice:
|
|
|
|
```yaml
|
|
---
|
|
bind: <Optional, bind/interface to listen requests on. By default localhost only>
|
|
port: <Optional port, start service on 7777 by default>
|
|
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.
|