Support uploading config files. #14

Merged
telackey merged 5 commits from telackey/configupload into main 2024-08-27 19:44:53 +00:00
Member

This adds a new /upload/config endpoint to the API for uploading encrypted configuration files for later use by the deployer.

The payload takes the form:

authorized:
  - accounta
  - accountb
config:
  env:
    FOO: bar
    BAR: baz

The request is the encrypted using the deployer's public key (discoverable from its WebappDeployer record). This is handled automatically by laconic-so but can also be handled manually using standard CLI tools like gpg and curl.

For example:

# Get the key
$ laconic -c ~/.laconic/testnet-a-cercio.yml registry name resolve lrn://laconic/deployers/webapp-deployer-api.dev.vaasl.io | jq -r '.[0].attributes.publicKey' | base64 -d > webapp-deployer-api.dev.vaasl.io.pgp.pub

# Import it
$ gpg --import webapp-deployer-api.dev.vaasl.io.pgp.pub

# Encrypt your config file.
$ gpg --yes --encrypt --recipient webapp-deployer-api.dev.vaasl.io --trust-model always config.yaml

# Post it
$ curl -s -X POST -d '@config.yaml.gpg' https://webapp-deployer-api.dev.vaasl.io/upload/config | jq
{
  "id": "B56C65AB96B741B7B219520A3ABFCD10"
}
This adds a new `/upload/config` endpoint to the API for uploading encrypted configuration files for later use by the deployer. The payload takes the form: ``` authorized: - accounta - accountb config: env: FOO: bar BAR: baz ``` The request is the encrypted using the deployer's public key (discoverable from its `WebappDeployer` record). This is handled automatically by `laconic-so` but can also be handled manually using standard CLI tools like `gpg` and `curl`. For example: ``` # Get the key $ laconic -c ~/.laconic/testnet-a-cercio.yml registry name resolve lrn://laconic/deployers/webapp-deployer-api.dev.vaasl.io | jq -r '.[0].attributes.publicKey' | base64 -d > webapp-deployer-api.dev.vaasl.io.pgp.pub # Import it $ gpg --import webapp-deployer-api.dev.vaasl.io.pgp.pub # Encrypt your config file. $ gpg --yes --encrypt --recipient webapp-deployer-api.dev.vaasl.io --trust-model always config.yaml # Post it $ curl -s -X POST -d '@config.yaml.gpg' https://webapp-deployer-api.dev.vaasl.io/upload/config | jq { "id": "B56C65AB96B741B7B219520A3ABFCD10" } ```
telackey added 1 commit 2024-08-24 05:03:50 +00:00
telackey added 1 commit 2024-08-24 05:04:27 +00:00
telackey added 1 commit 2024-08-26 18:19:26 +00:00
telackey added 1 commit 2024-08-26 22:02:39 +00:00
telackey added 1 commit 2024-08-26 22:13:02 +00:00
telackey changed title from WIP: Config upload to Support uploading config files. 2024-08-27 03:06:54 +00:00
telackey requested review from dboreham 2024-08-27 03:20:18 +00:00
telackey merged commit 3372ce29f3 into main 2024-08-27 19:44:53 +00:00
telackey deleted branch telackey/configupload 2024-08-27 19:44:54 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/webapp-deployment-status-api#14
No description provided.