@cocreate/cli 1.42.4 → 1.42.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.42.6](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.42.5...v1.42.6) (2023-10-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* cerbot using basic command ([1a96cf1](https://github.com/CoCreate-app/CoCreate-cli/commit/1a96cf15032edb4bee3146a1f03fffb88bfc5683))
|
|
7
|
+
|
|
8
|
+
## [1.42.5](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.42.4...v1.42.5) (2023-10-25)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* log ([46b9ffe](https://github.com/CoCreate-app/CoCreate-cli/commit/46b9ffe2de732e2b9f76de1a8512a3b2dfc4675d))
|
|
14
|
+
* update template ([225c779](https://github.com/CoCreate-app/CoCreate-cli/commit/225c77908847d8e2b42b3adedc253a67376992db))
|
|
15
|
+
|
|
1
16
|
## [1.42.4](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.42.3...v1.42.4) (2023-10-25)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/cli",
|
|
3
|
-
"version": "1.42.
|
|
3
|
+
"version": "1.42.6",
|
|
4
4
|
"description": "Polyrepo management bash CLI tool. Run all git commands and yarn commands on multiple repositories. Also includes a few custom macros for cloning, installing, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -35,21 +35,6 @@ server {
|
|
|
35
35
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
location /api/ {
|
|
39
|
-
proxy_pass http://localhost:3002;
|
|
40
|
-
proxy_set_header Host $host;
|
|
41
|
-
proxy_set_header X-Real-IP $remote_addr;
|
|
42
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
43
|
-
proxy_set_header X-Forwarded-Proto $scheme;
|
|
44
|
-
proxy_set_header Upgrade $http_upgrade;
|
|
45
|
-
proxy_set_header Connection "Upgrade";
|
|
46
|
-
fastcgi_buffers 16 16k;
|
|
47
|
-
fastcgi_buffer_size 32k;
|
|
48
|
-
proxy_buffer_size 128k;
|
|
49
|
-
proxy_buffers 4 256k;
|
|
50
|
-
proxy_busy_buffers_size 256k;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
38
|
listen 443 ssl http2;
|
|
54
39
|
ssl_certificate /etc/letsencrypt/live/${host}/fullchain.pem;
|
|
55
40
|
ssl_certificate_key /etc/letsencrypt/live/${host}/privkey.pem;
|
|
@@ -21,8 +21,8 @@ async function checkDns(host) {
|
|
|
21
21
|
}
|
|
22
22
|
if (err)
|
|
23
23
|
console.log(host, err);
|
|
24
|
-
});
|
|
25
|
-
} catch(err) {
|
|
24
|
+
});
|
|
25
|
+
} catch (err) {
|
|
26
26
|
console.log('certificate', err)
|
|
27
27
|
}
|
|
28
28
|
});
|
|
@@ -33,20 +33,20 @@ async function createCert(host) {
|
|
|
33
33
|
// let hosts = await exec(`sudo openssl x509 -dates -noout -in /etc/letsencrypt/live/${host}/fullchain.pem`);
|
|
34
34
|
// console.log('hostst check', hosts)
|
|
35
35
|
let test = await checkDns(host)
|
|
36
|
-
console.log('checked dns from
|
|
36
|
+
console.log('checked dns from createCert', test)
|
|
37
37
|
if (test) {
|
|
38
|
-
await exec(`sudo certbot certonly
|
|
39
|
-
let exitCode = await spawn('sudo', ['certbot', 'certonly', '--manual', '-d', `*.${host}`, '-d', host, '--agree-tos', '--preferred-challenges', 'dns-01', '--server', 'https://acme-v02.api.letsencrypt.org/directory'], { stdio: 'inherit', cwd: process.cwd() })
|
|
38
|
+
await exec(`sudo certbot certonly -d ${host}`);
|
|
39
|
+
// let exitCode = await spawn('sudo', ['certbot', 'certonly', '--manual', '-d', `*.${host}`, '-d', host, '--agree-tos', '--preferred-challenges', 'dns-01', '--server', 'https://acme-v02.api.letsencrypt.org/directory'], { stdio: 'inherit', cwd: process.cwd() })
|
|
40
40
|
if (exitCode !== 0) {
|
|
41
41
|
failed.push({ name: false, des: `creating directory failed` })
|
|
42
|
-
} else
|
|
42
|
+
} else
|
|
43
43
|
console.log(true)
|
|
44
44
|
|
|
45
45
|
// return true
|
|
46
|
-
} else
|
|
46
|
+
} else
|
|
47
47
|
return false
|
|
48
|
-
} catch(err) {
|
|
49
|
-
|
|
48
|
+
} catch (err) {
|
|
49
|
+
return false
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -54,8 +54,8 @@ async function deleteCert(host) {
|
|
|
54
54
|
try {
|
|
55
55
|
await exec(`sudo certbot delete --cert-name ${host}`);
|
|
56
56
|
return true
|
|
57
|
-
} catch(err) {
|
|
58
|
-
|
|
57
|
+
} catch (err) {
|
|
58
|
+
return false
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -74,10 +74,10 @@ async function checkCert(host) {
|
|
|
74
74
|
let currentDate = new Date()
|
|
75
75
|
|
|
76
76
|
if (!issued || !expires)
|
|
77
|
-
console.log('not defined', {issued, expires})
|
|
77
|
+
console.log('not defined', { issued, expires })
|
|
78
78
|
else if (!isNaN(expires)) {
|
|
79
79
|
if (currentDate < expires) {
|
|
80
|
-
certificates.set(host, {issued, expires})
|
|
80
|
+
certificates.set(host, { issued, expires })
|
|
81
81
|
return true
|
|
82
82
|
} else {
|
|
83
83
|
let cert = await createCert(host)
|
|
@@ -88,23 +88,23 @@ async function checkCert(host) {
|
|
|
88
88
|
return cert
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
} catch(err) {
|
|
91
|
+
} catch (err) {
|
|
92
92
|
let cert = await createCert(host)
|
|
93
93
|
if (cert)
|
|
94
|
-
certificates.set(host, {issued, expires})
|
|
94
|
+
certificates.set(host, { issued, expires })
|
|
95
95
|
return cert
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
async function test(host) {
|
|
100
100
|
try {
|
|
101
|
-
|
|
101
|
+
|
|
102
102
|
|
|
103
103
|
await exec(`sudo certbot certonly --manual --test-cert -d *.${host} -d ${host} --agree-tos --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory`);
|
|
104
104
|
let exitCode = await spawn('sudo', ['certbot', 'certonly', '--manual', '--test-cert', '-d', `*.${host}`, '-d', host, '--agree-tos', '--preferred-challenges', 'dns-01', '--server', 'https://acme-v02.api.letsencrypt.org/directory'], { stdio: 'inherit', cwd: process.cwd() })
|
|
105
105
|
if (exitCode !== 0) {
|
|
106
106
|
failed.push({ name: false, des: `creating directory failed` })
|
|
107
|
-
} else
|
|
107
|
+
} else
|
|
108
108
|
console.log(true)
|
|
109
109
|
|
|
110
110
|
// let child = exec('su -')
|
|
@@ -113,9 +113,9 @@ async function test(host) {
|
|
|
113
113
|
// child.stdout.on('data', (data) => {
|
|
114
114
|
// console.log(`stdout: "${data}"`);
|
|
115
115
|
// });
|
|
116
|
-
|
|
116
|
+
|
|
117
117
|
// child.stdin.end(); // EOF
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
// child.on('close', (code) => {
|
|
120
120
|
// console.log(`Child process exited with code ${code}.`);
|
|
121
121
|
// });
|
|
@@ -136,13 +136,13 @@ async function test(host) {
|
|
|
136
136
|
|
|
137
137
|
// return true
|
|
138
138
|
// return false
|
|
139
|
-
} catch(err) {
|
|
139
|
+
} catch (err) {
|
|
140
140
|
process.exit(1)
|
|
141
|
-
|
|
141
|
+
// return false
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
test('cocreate.app')
|
|
146
|
+
// test('cocreate.app')
|
|
147
147
|
|
|
148
|
-
module.exports = {checkDns, checkCert, createCert, deleteCert}
|
|
148
|
+
module.exports = { checkDns, checkCert, createCert, deleteCert }
|