Go to file
2025-06-19 11:13:43 +10:00
.vscode v1 2025-06-16 09:40:41 +10:00
src Added get method for testing and monitoring 2025-06-19 11:13:43 +10:00
.gitignore v1 2025-06-16 09:40:41 +10:00
Cargo.toml v1 2025-06-16 09:40:41 +10:00
LICENSE v1 2025-06-16 09:40:41 +10:00
README.md Added get method for testing and monitoring 2025-06-19 11:13:43 +10:00

deployment-api-rs

Example config.extension file to be created in etc sub-directory of working directory of this microservice:

---
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:

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.