Commit Graph

13 Commits

Author SHA1 Message Date
3372ce29f3 Support uploading config files. (#14)
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"
}
```

Reviewed-on: #14
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-08-27 19:44:52 +00:00
975f64f539 Update src/config.ts 2024-07-22 17:36:40 +00:00
698e630a18 Update src/deployments.ts 2024-07-12 17:09:18 +00:00
c6309fc875 new config name 2024-03-25 14:46:59 -05:00
b9cdc036ed try/catch 2024-02-28 19:09:29 -06:00
ad3e01b2ee r can be null 2024-02-29 01:05:55 +00:00
1bbfbf399f :id/log instead of /log/:id 2024-02-19 16:53:32 -06:00
ecc21cb935 Normalize / and /{id} responses. 2024-02-19 16:40:41 -06:00
4f0fb236bd Typo 2024-02-15 14:09:25 -06:00
5160a3f692 Add log API 2024-02-15 13:55:48 -06:00
e8b25c1e6a Fixes for prod k8s 2024-02-09 00:17:26 +00:00
3da2b57b3f Basic docker/k8s setup. 2024-02-02 19:39:21 -06:00
32a30a9c01 Initial commit 2024-01-18 20:17:30 -06:00