-
Notifications
You must be signed in to change notification settings - Fork 215
/
disable.js
35 lines (29 loc) · 1.06 KB
/
disable.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict'
let cli = require('heroku-cli-util')
async function run(context, heroku) {
let app = cli.color.app(context.app)
let warning = `This command will disable Automatic Certificate Management from ${app}.
This will cause the certificate to be removed from ${app} causing SSL
validation errors. In order to avoid downtime, the recommended steps
are preferred which will also disable Automatic Certificate Management.
1) Request a new SSL certificate for your domains names from your certificate provider
2) heroku certs:update CRT KEY
`
await cli.confirmApp(context.app, context.flags.confirm, warning)
await cli.action('Disabling Automatic Certificate Management', heroku.request({
method: 'DELETE',
path: `/apps/${context.app}/acm`,
headers: {Accept: 'application/vnd.heroku+json; version=3.cedar-acm'},
}))
}
module.exports = {
topic: 'certs',
command: 'auto:disable',
description: 'disable ACM for an app',
flags: [
{name: 'confirm', hasValue: true, hidden: true},
],
needsApp: true,
needsAuth: true,
run: cli.command(run),
}