Skip to content

properties config on OSX resolving booleans as strings #9

@bitt-john

Description

@bitt-john

In MacOSX and possibly linux when the properties file is parsed the booleans are converted to strings in the properties object which affects further if statements concerning auto running Redis and Bitcoind as it always evaluates to true.

https://github.com/Colored-Coins/Full-Node/blob/master/utils/config.js#L178

module.exports = function (propertiesFile) {
  var localPropertiesFile = path.join(__dirname ,'/../properties.conf')
  propertiesFile = propertiesFile || localPropertiesFile
  var properties = {}
  try {
    properties = ini.parseSync(propertiesFile)

  } catch (e) {
    console.warn('Can\'t find properties file:', propertiesFile)
    if (propertiesFile !== localPropertiesFile) {
      console.warn('Trying local properties file...')
      try {
        properties = ini.parseSync(localPropertiesFile)
      }
      catch (e) {
        console.warn('Can\'t find local properties file:', localPropertiesFile)
      }
    }
  }
if (properties.bitcoindAutoConf) {
    bitcoindAutoConfSuccess = tryPopulateBitcoinConfAuto(properties)
}
........
........
properties.bitcoindAutoRun = (properties.bitcoindAutoRun || process.env.BITCOIND_AUTO_RUN === 'true')

if (properties.bitcoindAutoRun) {
    tryRunBitcoind(properties)
}
properties.redisAutoRun = (properties.redisAutoRun || process.env.BITCOIND_AUTO_RUN === 'true')

if (properties.redisAutoRun) {
    tryRunRedis(properties)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions