Commit Graph

14 Commits

Author SHA1 Message Date
fbdeba9eed \ 2024-08-27 15:00:21 -05:00
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
30b349ea49 Log if the deployer command fails. (#12)
Reviewed-on: #12
2024-08-15 00:28:52 +00:00
zramsay
4bee6fc492 crn -> lrn 2024-07-23 20:40:14 -04:00
6adc0af591 Add FQDN_POLICY env. 2024-04-15 14:26:37 -05:00
819b691249 Restart API if needed. 2024-03-25 11:50:40 -05:00
359607488c Prune dangling images 2024-02-28 04:36:20 +00:00
fb6ad1030f Only remove images if we have any. 2024-02-28 00:35:30 +00:00
14646f42b2 Add more cleanup options. 2024-02-27 23:59:16 +00:00
a39f2296da Workaround 'podman manifest' bug by including static docker as well. 2024-02-23 11:20:30 -06:00
ebb3376e2d Add new update state option 2024-02-09 00:22:47 +00:00
e8b25c1e6a Fixes for prod k8s 2024-02-09 00:17:26 +00:00
8ee61c4ebe Add tag and logging options. 2024-02-07 15:58:19 -06:00
3da2b57b3f Basic docker/k8s setup. 2024-02-02 19:39:21 -06:00