@leverege/build-tools 1.12.13 → 1.12.15
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/lib/server/helmup +8 -0
- package/lib/web/dnsify/CloudflareAPI.js +160 -126
- package/lib/web/dnsify/index.js +58 -45
- package/lib/web/packleate/Packleator.js +494 -390
- package/lib/web/packleate/index.js +51 -38
- package/package.json +2 -2
- package/src/helmup +8 -0
- package/.circleci/config.yml +0 -0
package/lib/server/helmup
CHANGED
|
@@ -319,6 +319,14 @@ function doInstall() {
|
|
|
319
319
|
helm dep up ./monitoring && helm upgrade --install monitoring ./monitoring
|
|
320
320
|
;;
|
|
321
321
|
|
|
322
|
+
"mysql")
|
|
323
|
+
helm dep up ./mysql && helm upgrade --install mysql ./mysql
|
|
324
|
+
printf "\n***Proxy 4306 with this => kubectl port-forward svc/mysql 4306:3306\n\n"
|
|
325
|
+
printf "\n***Grab MYSQL Root Password => MYSQL_ROOT_PASSWORD=\$(kubectl get secret --namespace default mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo)"
|
|
326
|
+
printf "\n***Set MYSQL_HOST to 127.0.0.1 and MYSQL_PORT to 4306 and run => mysql -h \${MYSQL_HOST} -P\${MYSQL_PORT} -u root -p\${MYSQL_ROOT_PASSWORD} \n\n"
|
|
327
|
+
printf "\n***Set Make sure to make api-server an admin \n\n"
|
|
328
|
+
;;
|
|
329
|
+
|
|
322
330
|
"polaris")
|
|
323
331
|
helm repo add reactiveops-stable https://charts.reactiveops.com/stable
|
|
324
332
|
helm upgrade --install polaris reactiveops-stable/polaris --namespace polaris
|
|
@@ -28,6 +28,10 @@ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) ||
|
|
|
28
28
|
|
|
29
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
30
|
|
|
31
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
32
|
+
|
|
33
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
34
|
+
|
|
31
35
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
32
36
|
|
|
33
37
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -66,71 +70,81 @@ function () {
|
|
|
66
70
|
|
|
67
71
|
_createClass(CloudflareAPI, [{
|
|
68
72
|
key: "decrypt",
|
|
69
|
-
value: function
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
73
|
+
value: function () {
|
|
74
|
+
var _decrypt = _asyncToGenerator(
|
|
75
|
+
/*#__PURE__*/
|
|
76
|
+
regeneratorRuntime.mark(function _callee() {
|
|
77
|
+
var projectId,
|
|
78
|
+
keyRingId,
|
|
79
|
+
cryptoKeyId,
|
|
80
|
+
ciphertextFileName,
|
|
81
|
+
plaintextFileName,
|
|
82
|
+
kms,
|
|
83
|
+
client,
|
|
84
|
+
locationId,
|
|
85
|
+
readFile,
|
|
86
|
+
contentsBuffer,
|
|
87
|
+
name,
|
|
88
|
+
ciphertext,
|
|
89
|
+
_ref,
|
|
90
|
+
_ref2,
|
|
91
|
+
result,
|
|
92
|
+
writeFile,
|
|
93
|
+
_args = arguments;
|
|
94
|
+
|
|
95
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
96
|
+
while (1) {
|
|
97
|
+
switch (_context.prev = _context.next) {
|
|
98
|
+
case 0:
|
|
99
|
+
projectId = _args.length > 0 && _args[0] !== undefined ? _args[0] : 'leverege-docker-images';
|
|
100
|
+
keyRingId = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'build-tools';
|
|
101
|
+
cryptoKeyId = _args.length > 2 && _args[2] !== undefined ? _args[2] : 'circle-ci';
|
|
102
|
+
ciphertextFileName = _args.length > 3 && _args[3] !== undefined ? _args[3] : './accounts.json.enc';
|
|
103
|
+
plaintextFileName = _args.length > 4 && _args[4] !== undefined ? _args[4] : './accounts.json';
|
|
104
|
+
// Import the library and create a client
|
|
105
|
+
kms = require('@google-cloud/kms');
|
|
106
|
+
client = new kms.KeyManagementServiceClient(); // The location of the crypto key's key ring, e.g. "global"
|
|
107
|
+
|
|
108
|
+
locationId = 'us-east4'; // Reads the file to be decrypted
|
|
109
|
+
|
|
110
|
+
readFile = promisify(fs.readFile);
|
|
111
|
+
_context.next = 11;
|
|
112
|
+
return readFile(path.resolve(__dirname, ciphertextFileName));
|
|
113
|
+
|
|
114
|
+
case 11:
|
|
115
|
+
contentsBuffer = _context.sent;
|
|
116
|
+
name = client.cryptoKeyPath(projectId, locationId, keyRingId, cryptoKeyId);
|
|
117
|
+
ciphertext = contentsBuffer.toString('base64'); // Decrypts the file using the specified crypto key
|
|
118
|
+
|
|
119
|
+
_context.next = 16;
|
|
120
|
+
return client.decrypt({
|
|
121
|
+
name: name,
|
|
122
|
+
ciphertext: ciphertext
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
case 16:
|
|
126
|
+
_ref = _context.sent;
|
|
127
|
+
_ref2 = _slicedToArray(_ref, 1);
|
|
128
|
+
result = _ref2[0];
|
|
129
|
+
// Writes the decrypted file to disk
|
|
130
|
+
writeFile = promisify(fs.writeFile);
|
|
131
|
+
_context.next = 22;
|
|
132
|
+
return writeFile(path.resolve(__dirname, plaintextFileName), Buffer.from(result.plaintext, 'base64'));
|
|
133
|
+
|
|
134
|
+
case 22:
|
|
135
|
+
case "end":
|
|
136
|
+
return _context.stop();
|
|
137
|
+
}
|
|
130
138
|
}
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
|
|
139
|
+
}, _callee);
|
|
140
|
+
}));
|
|
141
|
+
|
|
142
|
+
function decrypt() {
|
|
143
|
+
return _decrypt.apply(this, arguments);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return decrypt;
|
|
147
|
+
}()
|
|
134
148
|
}, {
|
|
135
149
|
key: "setAccountValues",
|
|
136
150
|
value: function setAccountValues() {
|
|
@@ -148,72 +162,92 @@ function () {
|
|
|
148
162
|
}
|
|
149
163
|
}, {
|
|
150
164
|
key: "deleteSecrets",
|
|
151
|
-
value: function
|
|
152
|
-
var
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
value: function () {
|
|
166
|
+
var _deleteSecrets = _asyncToGenerator(
|
|
167
|
+
/*#__PURE__*/
|
|
168
|
+
regeneratorRuntime.mark(function _callee2() {
|
|
169
|
+
var deleteFile;
|
|
170
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
171
|
+
while (1) {
|
|
172
|
+
switch (_context2.prev = _context2.next) {
|
|
173
|
+
case 0:
|
|
174
|
+
deleteFile = promisify(fs.unlink);
|
|
175
|
+
_context2.next = 3;
|
|
176
|
+
return deleteFile(path.resolve(__dirname, './accounts.json'));
|
|
177
|
+
|
|
178
|
+
case 3:
|
|
179
|
+
case "end":
|
|
180
|
+
return _context2.stop();
|
|
181
|
+
}
|
|
164
182
|
}
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
|
|
183
|
+
}, _callee2);
|
|
184
|
+
}));
|
|
185
|
+
|
|
186
|
+
function deleteSecrets() {
|
|
187
|
+
return _deleteSecrets.apply(this, arguments);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return deleteSecrets;
|
|
191
|
+
}()
|
|
168
192
|
}, {
|
|
169
193
|
key: "createDNSRecord",
|
|
170
|
-
value: function
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
194
|
+
value: function () {
|
|
195
|
+
var _createDNSRecord = _asyncToGenerator(
|
|
196
|
+
/*#__PURE__*/
|
|
197
|
+
regeneratorRuntime.mark(function _callee3() {
|
|
198
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
199
|
+
while (1) {
|
|
200
|
+
switch (_context3.prev = _context3.next) {
|
|
201
|
+
case 0:
|
|
202
|
+
_context3.prev = 0;
|
|
203
|
+
this.spinner.start();
|
|
204
|
+
this.spinner.text = 'Decrypting Cloudflare secrets...';
|
|
205
|
+
_context3.next = 5;
|
|
206
|
+
return this.decrypt();
|
|
207
|
+
|
|
208
|
+
case 5:
|
|
209
|
+
this.spinner.text = 'Initializing Cloudflare API...';
|
|
210
|
+
this.setAccountValues();
|
|
211
|
+
this.spinner.text = 'Adding A name record...';
|
|
212
|
+
_context3.next = 10;
|
|
213
|
+
return this.cf.dnsRecords.add(this.zone, {
|
|
214
|
+
type: 'A',
|
|
215
|
+
name: this.url,
|
|
216
|
+
content: this.ipaddress,
|
|
217
|
+
proxied: this.proxy
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
case 10:
|
|
221
|
+
this.spinner.text = 'Removing secrets...';
|
|
222
|
+
_context3.next = 13;
|
|
223
|
+
return this.deleteSecrets();
|
|
224
|
+
|
|
225
|
+
case 13:
|
|
226
|
+
this.spinner.stop();
|
|
227
|
+
_context3.next = 21;
|
|
228
|
+
break;
|
|
229
|
+
|
|
230
|
+
case 16:
|
|
231
|
+
_context3.prev = 16;
|
|
232
|
+
_context3.t0 = _context3["catch"](0);
|
|
233
|
+
this.spinner.stop();
|
|
234
|
+
console.log(_context3.t0);
|
|
235
|
+
throw _context3.t0;
|
|
236
|
+
|
|
237
|
+
case 21:
|
|
238
|
+
case "end":
|
|
239
|
+
return _context3.stop();
|
|
240
|
+
}
|
|
213
241
|
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
242
|
+
}, _callee3, this, [[0, 16]]);
|
|
243
|
+
}));
|
|
244
|
+
|
|
245
|
+
function createDNSRecord() {
|
|
246
|
+
return _createDNSRecord.apply(this, arguments);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return createDNSRecord;
|
|
250
|
+
}()
|
|
217
251
|
}]);
|
|
218
252
|
|
|
219
253
|
return CloudflareAPI;
|
package/lib/web/dnsify/index.js
CHANGED
|
@@ -21,10 +21,14 @@ require("regenerator-runtime/runtime");
|
|
|
21
21
|
|
|
22
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
23
23
|
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
25
25
|
|
|
26
26
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
27
|
|
|
28
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
29
|
+
|
|
30
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
31
|
+
|
|
28
32
|
var commandLineArgs = require('command-line-args');
|
|
29
33
|
|
|
30
34
|
var commandLineUsage = require('command-line-usage');
|
|
@@ -87,54 +91,63 @@ var optionDefinitions = [{
|
|
|
87
91
|
var args = commandLineArgs(optionDefinitions);
|
|
88
92
|
|
|
89
93
|
function main() {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
return _main.apply(this, arguments);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function _main() {
|
|
98
|
+
_main = _asyncToGenerator(
|
|
99
|
+
/*#__PURE__*/
|
|
100
|
+
regeneratorRuntime.mark(function _callee() {
|
|
101
|
+
var CF;
|
|
102
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
103
|
+
while (1) {
|
|
104
|
+
switch (_context.prev = _context.next) {
|
|
105
|
+
case 0:
|
|
106
|
+
if (args.help) {
|
|
107
|
+
console.log(usage);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (!(!args.url || !args.ipaddress)) {
|
|
111
|
+
_context.next = 10;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
console.log('\n*******************************************');
|
|
116
|
+
console.log('** **');
|
|
117
|
+
console.log('** Need to specify URL and/or IP address **');
|
|
118
|
+
console.log('** **');
|
|
119
|
+
console.log('*******************************************');
|
|
96
120
|
console.log(usage);
|
|
97
|
-
|
|
121
|
+
_context.next = 21;
|
|
122
|
+
break;
|
|
98
123
|
|
|
99
|
-
|
|
100
|
-
|
|
124
|
+
case 10:
|
|
125
|
+
CF = new Cloudflare(_objectSpread({}, defaultConfig, {
|
|
126
|
+
args: args
|
|
127
|
+
}));
|
|
128
|
+
_context.prev = 11;
|
|
129
|
+
_context.next = 14;
|
|
130
|
+
return CF.createDNSRecord();
|
|
131
|
+
|
|
132
|
+
case 14:
|
|
133
|
+
console.log('Successfully created a new DNS record');
|
|
134
|
+
console.log('It may take a few minutes for DNS to propagate');
|
|
135
|
+
_context.next = 21;
|
|
101
136
|
break;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
case 10:
|
|
114
|
-
CF = new Cloudflare(_objectSpread({}, defaultConfig, {
|
|
115
|
-
args: args
|
|
116
|
-
}));
|
|
117
|
-
_context.prev = 11;
|
|
118
|
-
_context.next = 14;
|
|
119
|
-
return regeneratorRuntime.awrap(CF.createDNSRecord());
|
|
120
|
-
|
|
121
|
-
case 14:
|
|
122
|
-
console.log('Successfully created a new DNS record');
|
|
123
|
-
console.log('It may take a few minutes for DNS to propagate');
|
|
124
|
-
_context.next = 21;
|
|
125
|
-
break;
|
|
126
|
-
|
|
127
|
-
case 18:
|
|
128
|
-
_context.prev = 18;
|
|
129
|
-
_context.t0 = _context["catch"](11);
|
|
130
|
-
console.error(_context.t0.message);
|
|
131
|
-
|
|
132
|
-
case 21:
|
|
133
|
-
case "end":
|
|
134
|
-
return _context.stop();
|
|
137
|
+
|
|
138
|
+
case 18:
|
|
139
|
+
_context.prev = 18;
|
|
140
|
+
_context.t0 = _context["catch"](11);
|
|
141
|
+
console.error(_context.t0.message);
|
|
142
|
+
|
|
143
|
+
case 21:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context.stop();
|
|
146
|
+
}
|
|
135
147
|
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
148
|
+
}, _callee, null, [[11, 18]]);
|
|
149
|
+
}));
|
|
150
|
+
return _main.apply(this, arguments);
|
|
138
151
|
}
|
|
139
152
|
|
|
140
153
|
main();
|