Skip to content

LiveQuery options cannot be set via env variables #4887

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

Closed
alvinthen opened this issue Jul 11, 2018 · 5 comments
Closed

LiveQuery options cannot be set via env variables #4887

alvinthen opened this issue Jul 11, 2018 · 5 comments

Comments

@alvinthen
Copy link
Contributor

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

@flovilmart
Copy link
Contributor

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

@alvinthen
Copy link
Contributor Author

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?

@flovilmart
Copy link
Contributor

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)

@mstephano
Copy link

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

@rommyarb
Copy link

rommyarb commented May 6, 2021

The command to set env variables must begin with --env.
So, your 'run command' should be like this:

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

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

4 participants