cloudron 5.7.1 → 5.8.1
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/package.json +1 -1
- package/src/actions.js +22 -17
package/package.json
CHANGED
package/src/actions.js
CHANGED
|
@@ -609,27 +609,27 @@ async function install(localOptions, cmd) {
|
|
|
609
609
|
}
|
|
610
610
|
|
|
611
611
|
// port bindings
|
|
612
|
-
let
|
|
612
|
+
let ports = {};
|
|
613
613
|
if (options.portBindings) {
|
|
614
614
|
// ask the user for port values if the ports are different in the app and the manifest
|
|
615
615
|
if (typeof options.portBindings === 'string') {
|
|
616
|
-
|
|
616
|
+
ports = { };
|
|
617
617
|
options.portBindings.split(',').forEach(function (kv) {
|
|
618
618
|
const tmp = kv.split('=');
|
|
619
619
|
if (isNaN(parseInt(tmp[1], 10))) return; // disable the port
|
|
620
|
-
|
|
620
|
+
ports[tmp[0]] = parseInt(tmp[1], 10);
|
|
621
621
|
});
|
|
622
622
|
} else {
|
|
623
|
-
|
|
623
|
+
ports = queryPortBindings(null /* existing app */, manifest);
|
|
624
624
|
}
|
|
625
625
|
} else { // just put in defaults
|
|
626
626
|
const allPorts = _.extend({}, manifest.tcpPorts, manifest.udpPorts);
|
|
627
627
|
for (const portName in allPorts) {
|
|
628
|
-
|
|
628
|
+
ports[portName] = allPorts[portName].defaultValue;
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
|
|
632
|
-
for (const
|
|
632
|
+
for (const port in ports) console.log(`Port ${port}: ${ports[port]}`);
|
|
633
633
|
|
|
634
634
|
const data = {
|
|
635
635
|
appStoreId: options.appstoreId || '', // note case change
|
|
@@ -639,7 +639,7 @@ async function install(localOptions, cmd) {
|
|
|
639
639
|
domain: domainObject.domain,
|
|
640
640
|
secondaryDomains,
|
|
641
641
|
aliasDomains,
|
|
642
|
-
|
|
642
|
+
ports,
|
|
643
643
|
accessRestriction: null
|
|
644
644
|
};
|
|
645
645
|
|
|
@@ -707,11 +707,16 @@ async function configure(localOptions, cmd) {
|
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
709
|
|
|
710
|
+
const ports = {};
|
|
711
|
+
for (const portName in app.portBindings) {
|
|
712
|
+
ports[portName] = app.portBindings[portName].hostPort;
|
|
713
|
+
}
|
|
714
|
+
|
|
710
715
|
const data = {
|
|
711
716
|
location: domainObject.subdomain, // LEGACY
|
|
712
717
|
subdomain: domainObject.subdomain,
|
|
713
718
|
domain: domainObject.domain,
|
|
714
|
-
|
|
719
|
+
ports,
|
|
715
720
|
secondaryDomains,
|
|
716
721
|
aliasDomains
|
|
717
722
|
};
|
|
@@ -734,24 +739,24 @@ async function configure(localOptions, cmd) {
|
|
|
734
739
|
|
|
735
740
|
// port bindings
|
|
736
741
|
if (options.portBindings) {
|
|
737
|
-
let
|
|
742
|
+
let ports = app.portBindings;
|
|
738
743
|
// ask the user for port values if the ports are different in the app and the manifest
|
|
739
744
|
if (typeof options.portBindings === 'string') {
|
|
740
|
-
|
|
745
|
+
ports = {};
|
|
741
746
|
options.portBindings.split(',').forEach(function (kv) {
|
|
742
747
|
const tmp = kv.split('=');
|
|
743
748
|
if (isNaN(parseInt(tmp[1], 10))) return; // disable the port
|
|
744
|
-
|
|
749
|
+
ports[tmp[0]] = parseInt(tmp[1], 10);
|
|
745
750
|
});
|
|
746
751
|
} else {
|
|
747
|
-
|
|
752
|
+
ports = queryPortBindings(app, app.manifest);
|
|
748
753
|
}
|
|
749
754
|
|
|
750
|
-
for (const
|
|
751
|
-
console.log('%s: %s',
|
|
755
|
+
for (const port in ports) {
|
|
756
|
+
console.log('%s: %s', port, ports[port]);
|
|
752
757
|
}
|
|
753
758
|
|
|
754
|
-
data.
|
|
759
|
+
data.ports = portBindings;
|
|
755
760
|
}
|
|
756
761
|
|
|
757
762
|
const request = createRequest('POST', `/api/v1/apps/${app.id}/configure/location`, options);
|
|
@@ -1258,7 +1263,7 @@ async function clone(localOptions, cmd) {
|
|
|
1258
1263
|
|
|
1259
1264
|
const location = options.location || readlineSync.question('Cloned app location: ', {});
|
|
1260
1265
|
const secondaryDomains = await querySecondaryDomains(app, app.manifest, options);
|
|
1261
|
-
const
|
|
1266
|
+
const ports = queryPortBindings(app, app.manifest);
|
|
1262
1267
|
const backupId = options.backup;
|
|
1263
1268
|
|
|
1264
1269
|
const domainObject = await selectDomain(location, options);
|
|
@@ -1268,7 +1273,7 @@ async function clone(localOptions, cmd) {
|
|
|
1268
1273
|
subdomain: domainObject.subdomain,
|
|
1269
1274
|
domain: domainObject.domain,
|
|
1270
1275
|
secondaryDomains,
|
|
1271
|
-
|
|
1276
|
+
ports
|
|
1272
1277
|
};
|
|
1273
1278
|
const request = createRequest('POST', `/api/v1/apps/${app.id}/clone`, options);
|
|
1274
1279
|
const response = await request.send(data);
|