Parse-server: LiveQuery options cannot be set via env variables

Created on 11 Jul 2018  Â·  4Comments  Â·  Source: parse-community/parse-server

Issue Description

LiveQuery options cannot be set via env variables, although it is listed in the definition file, the parse-server cli it not picking it up.

In https://github.com/parse-community/parse-server/blob/master/src/cli/definitions/parse-server.js, it's only reading ParseServerOptions.

Steps to reproduce

Run PARSE_SERVER_START_LIVE_QUERY_SERVER=1 PARSE_SERVER_LIVEQUERY_CLASSNAMES=GameScore parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test

Expected Results

The classNames are listed among the other options when starting parse server initially.

Actual Outcome

The classNames are NOT listed among the other options when starting parse server initially.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.8.2 and master branch
    • Operating System: Doesn't matter
    • Hardware: Doesn't matter
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Doesn't matter
  • Database

    • MongoDB version: Doesn't matter
    • Storage engine: Doesn't matter
    • Hardware: Doesn't matter
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): Doesn't matter

Logs/Trace


Using env var

appId: APPLICATION_ID
masterKey: ***REDACTED***
masterKeyIps: []
logsFolder: ./logs
databaseURI: mongodb://localhost/test
userSensitiveFields: ["email"]
enableAnonymousUsers: true
allowClientClassCreation: true
maxUploadSize: 20mb
customPages: {}
sessionLength: 31536000
expireInactiveSessions: true
revokeSessionOnPasswordReset: true
schemaCacheTTL: 5000
cacheTTL: 5000
cacheMaxSize: 10000
objectIdSize: 10
port: 1337
host: 0.0.0.0
mountPath: /parse
startLiveQueryServer: true
scheduledPush: false
collectionPrefix: 
verifyUserEmails: false
preventLoginWithUnverifiedEmail: false
enableSingleSchemaCache: false
jsonLogs: false
verbose: false
level: undefined
serverURL: http://localhost:1337/parse

[29903] parse-server running on http://localhost:1337/parse


Using config file

appId: APPLICATION_ID
masterKey: ***REDACTED***
masterKeyIps: []
logsFolder: ./logs
databaseURI: mongodb://localhost/test
userSensitiveFields: ["email"]
enableAnonymousUsers: true
allowClientClassCreation: true
maxUploadSize: 20mb
customPages: {}
liveQuery: {"classNames":["GameScore"]}
sessionLength: 31536000
expireInactiveSessions: true
revokeSessionOnPasswordReset: true
schemaCacheTTL: 5000
cacheTTL: 5000
cacheMaxSize: 10000
objectIdSize: 10
port: 1337
host: 0.0.0.0
mountPath: /parse
startLiveQueryServer: true
scheduledPush: false
collectionPrefix: 
verifyUserEmails: false
preventLoginWithUnverifiedEmail: false
enableSingleSchemaCache: false
jsonLogs: false
verbose: false
level: undefined
serverURL: http://localhost:1337/parse

[29903] parse-server running on http://localhost:1337/parse

Most helpful comment

you can check my Parse Server Live Query repo to see how to pass LiveQuery env variable to docker run command or docker-compose.

All 4 comments

You can use the PARSE_SERVER_LIVE_QUERY environment variable which expects a JSON serialized object. Did you expect to use the same environment variables as the standalone live query server? This could make sense

I didn't realise those are for the standalone server and the usage of PARSE_SERVER_LIVE_QUERY

I'll send in a PR for the documentation, tho using the same environment variables sounds good too. Any way I can help?

That would be very nice to use the same environment variables and treat the ‘start live query server’ the same way both ways (stand-alone and with server)

you can check my Parse Server Live Query repo to see how to pass LiveQuery env variable to docker run command or docker-compose.

Was this page helpful?
0 / 5 - 0 ratings