Environment variables on Galaxy question

Here are my environment variables:

{
  "facebookAppId": "yyy",
  "facebookAppSecret": "yyy",
  "galaxy.meteor.com": {
    "env": {
      "ROOT_URL": "xxx",
      "MONGO_URL": "xxx",
      "facebookAppId": "xxx",
      "facebookAppSecret": "xxx"
    }
  }
}

And here’s how I configure my OAuth:

ServiceConfiguration.configurations.upsert(
  { service: "facebook" },
  {
    $set: {
      appId: Meteor.settings.facebookAppId,
      secret: Meteor.settings.facebookAppSecret
    }
  }
);

Now, when I deploy to Galaxy the setting yyy is used, instead of xxx for facebookAppId.

My question is, how do I structure this is uses yyy locally, and xxx on production (Galaxy hosting)?

I just tried this as well, and no cigar:

{
  "galaxy.meteor.com": {
    "env": {
      "ROOT_URL": "xxx",
      "MONGO_URL": "xxx",
      "facebookAppId": "xxx",
      "facebookAppSecret": "xxx"
    }
  },
  "localhost:3000": {
    "env": {
      "facebookAppId": "yyy",
      "facebookAppSecret": "yyy"
    }
  }
}

But the value of the facebookAppId is now null locally.

Here’s what I ended up doing:

server/settings/local.json
server/settings/production.json

Then to run locally:

meteor run --settings server/settings/local.json

And to deploy to prod:

$ DEPLOY_HOSTNAME=galaxy.meteor.com meteor deploy app.xx.io --settings server/settings/production.json

Pretty good, I like it.

1 Like

I had this issue as well. I ended up using ‘settings-staging.json’ and ‘settings-production.json’, instead of using in separate folders.