Sorry for that my PR #765 does't fix bug #763 perfectly.
The code I wrote in /lib/config/environment.js :
port: parseInt(process.env.HMD_MINIO_PORT)
Cause another bug which make config.minio.port neither default value nor value in config.json while HMD_MINIO_PORT hasn't been defined .
The reason is environment.js is merged after than config.json in /lib/config/index.js .
In addition , lodash.merge only skip undefined value .
However using port: parseInt(process.env.HMD_MINIO_PORT) make value of port isn't undefined but NaN whileprocess.env.HMD_MINIO_PORT is undefined .
And It makes config.minio.port overwrite with NaN even though HMD_MINIO_PORT hasn't been set in env .
Value of port should be undefined when HMD_MINIO_PORT isn't set in ENV to prevent original value be overwrote . And I rewrite code into this to fix it :
port: (process.env.HMD_MINIO_PORT == undefined) ? undefined : parseInt(process.env.HMD_MINIO_PORT)
Sorry for that my PR #765 does't fix bug #763 perfectly.
The code I wrote in
/lib/config/environment.js:Cause another bug which make
config.minio.portneither default value nor value in config.json while HMD_MINIO_PORT hasn't been defined .The reason is environment.js is merged after than config.json in
/lib/config/index.js.In addition ,
lodash.mergeonly skip undefined value .However using
port: parseInt(process.env.HMD_MINIO_PORT)make value of port isn't undefined but NaN whileprocess.env.HMD_MINIO_PORTis undefined .And It makes
config.minio.portoverwrite with NaN even though HMD_MINIO_PORT hasn't been set in env .Value of port should be undefined when HMD_MINIO_PORT isn't set in ENV to prevent original value be overwrote . And I rewrite code into this to fix it :