@@ -18,7 +18,7 @@ var log: logging.Log = new logging.Log('cloud installer');
1818const 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,15 @@ 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+ try {
61+ F ( JSON . parse ( inviteJson ) ) ;
62+ } catch ( e ) {
63+ R ( {
64+ message : 'could not parse invite: ' + inviteJson
65+ } ) ;
66+ }
6067 }
6168 } ) ;
6269
0 commit comments