Skip to content

Commit 89e59f4

Browse files
author
Daniel Borkan
committed
Update installer to read return invite object instead of URL
1 parent e15f080 commit 89e59f4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/cloud/install/freedom-module.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"install": {
1414
"type": "method",
1515
"value": ["string", "number", "string", "string"],
16-
"ret": "string"
16+
"ret": "object"
1717
},
1818
"err": {
1919
"message": "string"

src/cloud/install/installer.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var log: logging.Log = new logging.Log('cloud installer');
1818
const INSTALL_COMMAND = 'curl -sSL https://raw.githubusercontent.com/uProxy/uproxy-docker/master/install-cloud.sh | sh';
1919

2020
// Prefix for invitation URLs.
21-
const INVITATION_URL_PREFIX = 'https://www.uproxy.org/invite/';
21+
const INVITATION_PREFIX = 'CLOUD_INSTANCE_DETAILS_JSON:';
2222

2323
// Installs uProxy on a server, via SSH.
2424
// The process is as close as possible to a manual install
@@ -31,7 +31,7 @@ class CloudInstaller {
3131
host:string,
3232
port:number,
3333
username:string,
34-
key:string) : Promise<string> => {
34+
key:string) : Promise<Object> => {
3535
log.debug('installing uproxy on %1:%2 as %3', host, port, username);
3636

3737
const connectConfig: ssh2.ConnectConfig = {
@@ -55,8 +55,9 @@ class CloudInstaller {
5555
// Search for the URL anywhere in the line so we will
5656
// continue to work in the face of minor changes
5757
// to the install script.
58-
if (line.indexOf(INVITATION_URL_PREFIX) === 0) {
59-
F(line.substring(INVITATION_URL_PREFIX.length));
58+
if (line.indexOf(INVITATION_PREFIX) === 0) {
59+
const inviteJson = line.substring(INVITATION_PREFIX.length);
60+
F(JSON.parse(inviteJson));
6061
}
6162
});
6263

0 commit comments

Comments
 (0)