Skip to content

Commit e16c51e

Browse files
authored
Update install_server.sh
1 parent 69ce050 commit e16c51e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/server_manager/install_scripts/install_server.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,15 +408,17 @@ function add_api_url_to_config() {
408408
}
409409

410410
function check_firewall() {
411-
# TODO(JonathanDCohen) This is incorrect if access keys are using more than one port.
412-
local -i ACCESS_KEY_PORT
413-
ACCESS_KEY_PORT=$(fetch --insecure "${LOCAL_API_URL}/access-keys" |
411+
local -i ACCESS_KEY_PORT="${FLAGS_KEYS_PORT}"
412+
if [[ -z "${ACCESS_KEY_PORT}" ]]; then
413+
ACCESS_KEY_PORT=$(fetch --insecure "${LOCAL_API_URL}/access-keys" |
414414
docker exec -i "${CONTAINER_NAME}" node -e '
415415
const fs = require("fs");
416416
const accessKeys = JSON.parse(fs.readFileSync(0, {encoding: "utf-8"}));
417417
console.log(accessKeys["accessKeys"][0]["port"]);
418418
') || return
419+
fi
419420
readonly ACCESS_KEY_PORT
421+
420422
if ! fetch --max-time 5 --cacert "${SB_CERTIFICATE_FILE}" "${PUBLIC_API_URL}/access-keys" >/dev/null; then
421423
log_error "BLOCKED"
422424
FIREWALL_STATUS="\

0 commit comments

Comments
 (0)