webapp-deployment-status-api/package.json
Thomas E Lackey 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

56 lines
1.6 KiB
JSON

{
"name": "node-typescript-boilerplate",
"version": "0.0.0",
"description": "Minimalistic boilerplate to quick-start Node.js development in TypeScript.",
"type": "module",
"engines": {
"node": ">= 20.9 < 21"
},
"devDependencies": {
"@types/jest": "~29.5",
"@types/node": "~20",
"@typescript-eslint/eslint-plugin": "~6.15",
"@typescript-eslint/parser": "~6.15",
"eslint": "~8.56",
"eslint-config-prettier": "~9.1",
"eslint-plugin-jest": "~27.6",
"jest": "~29.7",
"prettier": "~3.1",
"rimraf": "~5.0",
"ts-api-utils": "~1.0",
"ts-jest": "~29.1",
"typescript": "~5.3"
},
"scripts": {
"start": "node build/src/main.js",
"clean": "rimraf coverage build tmp",
"prebuild": "npm run lint",
"build": "tsc -p tsconfig.json",
"build:watch": "tsc -w -p tsconfig.json",
"build:release": "npm run clean && tsc -p tsconfig.release.json",
"lint": "eslint . --ext .ts --ext .mts",
"test": "jest --coverage",
"prettier": "prettier --config .prettierrc --write .",
"test:watch": "jest --watch"
},
"author": "Jakub Synowiec <jsynowiec@users.noreply.github.com>",
"license": "Apache-2.0",
"dependencies": {
"@cerc-io/laconic-sdk": "^0.1.15",
"@openpgp/web-stream-tools": "^0.1.3",
"body-parser": "^1.20.2",
"express": "^4.18.2",
"express-async-handler": "^1.2.0",
"express-serve-static-core": "^0.1.1",
"js-yaml": "^4.1.0",
"json-stable-stringify": "^1.1.1",
"openpgp": "^5.11.2",
"tslib": "~2.6",
"yaml": "^2.5.0"
},
"volta": {
"node": "20.10.0"
},
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
}