Skip to content

The REST API key was improperly inferred from environment #4292

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

Merged
merged 1 commit into from
Oct 25, 2017

Conversation

flovilmart
Copy link
Contributor

@flovilmart flovilmart commented Oct 25, 2017

Sorry about that, this only affects CLI users, like myself... Just shot myself in the foot...

@flovilmart flovilmart added the type:bug Impaired feature or lacking behavior that is likely assumed label Oct 25, 2017
@codecov
Copy link

codecov bot commented Oct 25, 2017

Codecov Report

Merging #4292 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4292   +/-   ##
=======================================
  Coverage   92.45%   92.45%           
=======================================
  Files         118      118           
  Lines        8155     8155           
=======================================
  Hits         7540     7540           
  Misses        615      615
Impacted Files Coverage Δ
src/Options/Definitions.js 100% <ø> (ø) ⬆️
src/RestWrite.js 93.34% <0%> (-0.19%) ⬇️
src/Adapters/Auth/meetup.js 89.47% <0%> (+5.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3bb9e0e...4062b0b. Read the comment docs.

Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related question, is there a doc that explains this cli thinggie you're referring too? I looked yesterday as I was setting up a new instance and wanted to try instead of my current method, but couldn't find it.

@flovilmart flovilmart merged commit a185c97 into master Oct 25, 2017
@flovilmart flovilmart deleted the fix/PARSE_SERVER_REST_API_KEY-env-variable branch October 25, 2017 15:46
@flovilmart
Copy link
Contributor Author

It’s in .bin/parse-server you can pass environment variables and options.

@montymxb
Copy link
Contributor

I'm surprised we didn't have a test that caught this :/. Can we add something in the future to prevent this, or something similar, from recurring?

@flovilmart
Copy link
Contributor Author

Yeah, most probably, I could add a test that validates the definition Parse properly

@flovilmart
Copy link
Contributor Author

@acinader for using the CLI, actually, you can try the bootstrap script, it generates everything for you.

at AmpMe, we have start our server with:

$ node node_modules/.bin/parse-server -- config/dev.js

then config/dev.js

const push = {
  'ios': [...],
  'android': {},
  'queueOptions': {
    messageQueueAdapter: 'parse-server-gcloud-pubsub',
    disableFanOut: true,
    disablePushWorker: false,
    channel: 'ampme-parse-push-dev',
  },
};

// hard coded for now
const redisHOST = process.env.REDIS_MASTER_SERVICE_HOST;
const redisPORT = process.env.REDIS_MASTER_SERVICE_PORT;
console.assert(typeof redisHOST !== 'undefined');
console.assert(typeof redisPORT !== 'undefined');
const redisURL = `redis://${redisHOST}:${redisPORT}`;

const RedisCacheAdapter = require('parse-server').RedisCacheAdapter;
const redisOptions = { url: redisURL };
const redisCache = new RedisCacheAdapter(redisOptions, 60000 * 30);

module.exports = {
  cloud: '/opt/parse-server/cloud/main',
  jsonLogs: true,
  logsFolder: null,
  scheduledPush: true,
  appName: '[DEV] AmpMe Parse Server',
  port: 1337,
  push,
  filesAdapter: {
    module: 'parse-server-gcs-adapter',
    options: {
      directAccess: true,
      bucket: 'ampme-dev-storage',
    },
  },
  auth: {
    soundcloud: require('./auth/soundcloud'),
  },
  /* for publishing */
  liveQuery: {
    classNames: [...],
    redisURL,
  },
  /* for the subscriptions */
  liveQueryServerOptions: {
    redisURL,
  },
  startLiveQueryServer: true,
  middleware: './config/datadog',
  schemaCacheTTL: 60000,
  enableSingleSchemaCache: true,
  cacheAdapter: redisCache,
  cacheMaxSize: 1000,
  cacheTTL: 60000 * 30, // 60s
};

The dev.js file is loaded by the CLI and parsed accordingly.

@acinader
Copy link
Contributor

Thanks.

@mtrezza mtrezza removed the type:bug Impaired feature or lacking behavior that is likely assumed label Jul 11, 2021
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

Successfully merging this pull request may close these issues.

4 participants