open-horizon / devops

Devops processes to build and deploy horizon components
Apache License 2.0
10 stars 43 forks source link

deploy-mgmt-hub.sh fails on Intel Mac #176

Open gerardkr opened 2 weeks ago

gerardkr commented 2 weeks ago

I'm trying to install the Open Horizon management hub on my Intel Mac using the command

export HZN_LISTEN_IP=192.168.xxx.xxx # this may be irrelevant curl -sSL https://raw.githubusercontent.com/open-horizon/devops/master/mgmt-hub/deploy-mgmt-hub.sh | bash

It fails with

bash: line 672: ip: command not found

There is no "ip" command on my Mac system, but there are both "ifconfig" and "ipconfig" commands which appears to do the similar things.

Joe Pearson said:
looks like the equivalent on Mac would be ipconfig getifaddr en0 for wireless or ipconfig getifaddr en1 for ethernet

However, I believe the problem is a bit more involved.

So perhaps the best approach is to have users specify which IP address they want to use via HZN_LISTEN_IP. I tried this above but don't think it had any effect. Or perhaps you use HZN_LISTEN_IP if it is set; otherwise fall back to use Joe's suggestion. In any case, "ip" won't work for Mac.

gerardkr commented 2 weeks ago

I've hacked around the "ip" command by loading HZN_LISTEN_IP directly.

The next error is running (slightly modified to run as a single command)

sudo openssl req -newkey rsa:4096 -nodes -sha256 -x509 -days +365 -out /etc/horizon/keys/horizonMgmtHubFDO.crt -subj "/C=US/ST=NY/L=New York/O=allin1@openhorizon.org/CN=tesseract2.local" -extensions san -config openssl-config-crap.txt

where openssl-config-crap.txt contains

[req] distinguished_name=req [san] subjectAltName=192.168.5.19,DNS:localhost,DNS:agbot,DNS:exchange-api,DNS:css-api,DNS:fdo-owner-services

The result is

Error Loading extension section san 140704545656768:error:2207507C:X509 V3 routines:v2i_GENERAL_NAME_ex:missing value:crypto/x509v3/v3_alt.c:533: 140704545656768:error:22098080:X509 V3 routines:X509V3_EXT_nconf:error in extension:crypto/x509v3/v3_conf.c:47:name=subjectAltName, value=192.168.5.19,DNS:localhost,DNS:agbot,DNS:exchange-api,DNS:css-api,DNS:fdo-owner-services

I've tried to debug the issue, but haven't made any notable progress.