Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properties config on OSX resolving booleans as strings #9

Open
bitt-john opened this issue Aug 21, 2017 · 0 comments
Open

properties config on OSX resolving booleans as strings #9

bitt-john opened this issue Aug 21, 2017 · 0 comments

Comments

@bitt-john
Copy link

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)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant