Skip to content

Commit cc88379

Browse files
committed
Now update forces refresh
1 parent e88fbb4 commit cc88379

5 files changed

Lines changed: 14 additions & 9 deletions

File tree

nodejs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Note: proxy will add `x-forwarded-proto: https` to headers. This is to support e
5555
backloop.dev-proxy <target host>[:<target port>] [<port>]
5656
```
5757

58-
Manually update the certificates:
58+
Manually force update of the certificates:
5959

6060
```
6161
backloop.dev-update

nodejs/bin/update.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
const updateAndLoad = require('../src/check').updateAndLoad;
33

44
(async () => {
5-
await updateAndLoad();
5+
await updateAndLoad(true);
66
})()

nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backloop.dev",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"description": "Local HTTPS development with *.backloop.dev pointing to localhost and SSL certificates",
55
"keywords": [
66
"SSL",

nodejs/src/check.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ if (! fs.existsSync(certsPath)) {
1919

2020
const packPath = path.resolve(certsPath, 'pack.json');
2121

22-
async function updateAndLoad () {
23-
const actual = loadFromLocalDirectory(' Auto updating ');
24-
if (actual != null && actual.expirationDays > 0) {
25-
return actual;
22+
async function updateAndLoad (force = false) {
23+
if (!force) {
24+
const actual = loadFromLocalDirectory(' Auto updating ');
25+
if (actual != null && actual.expirationDays > 0) {
26+
return actual;
27+
}
28+
} else {
29+
console.log('Force update of backloop.dev certificate');
2630
}
31+
2732

2833
const res = await fetchPack();
2934

renew/src/pack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ async function pack (domain) {
1010
domain: domain,
1111
cert: read(['./gh-pages', domain + '-cert.crt']),
1212
ca: read(['./gh-pages', domain + '-ca.crt']),
13-
key1: read(['./gh-pages', domain + '-key.part1.pem']),
14-
key2: read(['./gh-pages', domain + '-key.part2.pem'])
13+
key2: read(['./gh-pages', domain + '-key.part2.pem']),
14+
key1: read(['./gh-pages', domain + '-key.part1.pem'])
1515
};
1616
res.info = await acme.forge.readCertificateInfo(res.cert);
1717
write(['./gh-pages', 'pack.json'], JSON.stringify(res, null, 2));

0 commit comments

Comments
 (0)