Skip to content

Commit

Permalink
Fixes:
Browse files Browse the repository at this point in the history
1. To accept passphrase with spaces
2. To successfully reconfigure the gateway even when the gateway is running
  • Loading branch information
nxtautomation committed Jun 11, 2020
1 parent 7c824a8 commit 27f9a9c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions shared/web/interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
$apiKey = $data['apiKey'];
$passphrase = $data['passphrase'];
$port = "127.0.0.1:7777:7777";

stopGateway();
configureGateway($port,$satellite,$apiKey,$passphrase);

}
Expand Down Expand Up @@ -149,18 +149,18 @@ function stopGateway() {
}

// Restart Gateway
function restartGateway() {
global $stopScript;
global $startScript;
global $file;
// Excute shell script for stoping gateway process
logMessage("Interface called to restart Gateway ");

logEnvironment() ;
stopGateway() ;
runGateway() ;
function restartGateway() {
global $stopScript;
global $startScript;
global $file;
// Excute shell script for stoping gateway process
logMessage("Interface called to restart Gateway ");

logEnvironment() ;
stopGateway() ;
runGateway() ;

return status();
return status();
}

// Configure Geteway
Expand All @@ -179,7 +179,7 @@ function configureGateway($port,$satellite,$apiKey,$passphrase){
file_put_contents($file, $newJsonString);

logMessage("Interface called to save parameters and configure Gateway ");
$output = shell_exec("/bin/bash $configureScript $port $satellite $apiKey $passphrase $moduleBase 2>&1 ");
$output = shell_exec("/bin/bash $configureScript $port $satellite $apiKey '$passphrase' $moduleBase 2>&1 ");



Expand Down
2 changes: 1 addition & 1 deletion shared/web/scripts/gatewayconfigure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ docker run --rm -v $(pwd)/gateway:/root/.local/share/storj/gateway --entrypoint

echo `date` " Saving Configuration of ${CONTAINER_NAME} ---> " >> $LOG
docker ps -a >> $LOG
cmd="docker run --rm --name ${CONTAINER_NAME} -p ${1} -v ${5}/gateway:/root/.local/share/storj/gateway storjlabs/gateway:latest setup --satellite-address ${2} --api-key ${3} --passphrase ${4} --non-interactive"
cmd="docker run --rm --name ${CONTAINER_NAME} -p ${1} -v ${5}/gateway:/root/.local/share/storj/gateway storjlabs/gateway:latest setup --satellite-address ${2} --api-key ${3} --passphrase '${4}' --non-interactive"

echo "RUNNING ----------- $cmd ------------- " >> $LOG
output=`$cmd 2>&1 `
Expand Down

0 comments on commit 27f9a9c

Please sign in to comment.