Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/Options/Definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ module.exports.ParseServerOptions = {
},
graphQLPath: {
env: 'PARSE_SERVER_GRAPHQL_PATH',
help: 'Mount path for the GraphQL endpoint, defaults to /graphql',
help:
'The mount path for the GraphQL endpoint<br><br>\u26A0\uFE0F File upload inside the GraphQL mutation system requires Parse Server to be able to call itself by making requests to the URL set in `serverURL`.<br><br>Defaults is `/graphql`.',
default: '/graphql',
},
graphQLPublicIntrospection: {
Expand Down Expand Up @@ -579,7 +580,8 @@ module.exports.ParseServerOptions = {
},
serverURL: {
env: 'PARSE_SERVER_URL',
help: 'URL to your parse server with http:// or https://.',
help:
'The URL to Parse Server.<br><br>\u26A0\uFE0F Certain server features or adapters may require Parse Server to be able to call itself by making requests to the URL set in `serverURL`. If a feature requires this, it is mentioned in the documentation. In that case ensure that the URL is accessible from the server itself.',
required: true,
},
sessionLength: {
Expand Down Expand Up @@ -616,6 +618,13 @@ module.exports.ParseServerOptions = {
help: 'Set the logging to verbose',
action: parsers.booleanParser,
},
verifyServerUrl: {
env: 'PARSE_SERVER_VERIFY_SERVER_URL',
help:
'Parse Server makes a HTTP request to the URL set in `serverURL` at the end of its launch routine to verify that the launch succeeded. If this option is set to `false`, the verification will be skipped. This can be useful in environments where the server URL is not accessible from the server itself, such as when running behind a firewall or in certain containerized environments.<br><br>\u26A0\uFE0F Server URL verification requires Parse Server to be able to call itself by making requests to the URL set in `serverURL`.<br><br>Default is `true`.',
action: parsers.booleanParser,
default: true,
},
verifyUserEmails: {
env: 'PARSE_SERVER_VERIFY_USER_EMAILS',
help:
Expand Down
5 changes: 3 additions & 2 deletions src/Options/docs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/Options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ export interface ParseServerOptions {
masterKeyTtl: ?number;
/* (Optional) The maintenance key is used for modifying internal and read-only fields of Parse Server.<br><br>⚠️ This key is not intended to be used as part of a regular operation of Parse Server. This key is intended to conduct out-of-band changes such as one-time migrations or data correction tasks. Internal fields are not officially documented and may change at any time without publication in release changelogs. We strongly advice not to rely on internal fields as part of your regular operation and to investigate the implications of any planned changes *directly in the source code* of your current version of Parse Server. */
maintenanceKey: string;
/* URL to your parse server with http:// or https://.
/* The URL to Parse Server.<br><br>⚠️ Certain server features or adapters may require Parse Server to be able to call itself by making requests to the URL set in `serverURL`. If a feature requires this, it is mentioned in the documentation. In that case ensure that the URL is accessible from the server itself.
:ENV: PARSE_SERVER_URL */
serverURL: string;
/* Parse Server makes a HTTP request to the URL set in `serverURL` at the end of its launch routine to verify that the launch succeeded. If this option is set to `false`, the verification will be skipped. This can be useful in environments where the server URL is not accessible from the server itself, such as when running behind a firewall or in certain containerized environments.<br><br>⚠️ Server URL verification requires Parse Server to be able to call itself by making requests to the URL set in `serverURL`.<br><br>Default is `true`.
:DEFAULT: true */
verifyServerUrl: ?boolean;
/* (Optional) Restricts the use of master key permissions to a list of IP addresses or ranges.<br><br>This option accepts a list of single IP addresses, for example `['10.0.0.1', '10.0.0.2']`. You can also use CIDR notation to specify an IP address range, for example `['10.0.1.0/24']`.<br><br><b>Special scenarios:</b><br>- Setting an empty array `[]` means that the master key cannot be used even in Parse Server Cloud Code. This value cannot be set via an environment variable as there is no way to pass an empty array to Parse Server via an environment variable.<br>- Setting `['0.0.0.0/0', '::0']` means to allow any IPv4 and IPv6 address to use the master key and effectively disables the IP filter.<br><br><b>Considerations:</b><br>- IPv4 and IPv6 addresses are not compared against each other. Each IP version (IPv4 and IPv6) needs to be considered separately. For example, `['0.0.0.0/0']` allows any IPv4 address and blocks every IPv6 address. Conversely, `['::0']` allows any IPv6 address and blocks every IPv4 address.<br>- Keep in mind that the IP version in use depends on the network stack of the environment in which Parse Server runs. A local environment may use a different IP version than a remote environment. For example, it's possible that locally the value `['0.0.0.0/0']` allows the request IP because the environment is using IPv4, but when Parse Server is deployed remotely the request IP is blocked because the remote environment is using IPv6.<br>- When setting the option via an environment variable the notation is a comma-separated string, for example `"0.0.0.0/0,::0"`.<br>- IPv6 zone indices (`%` suffix) are not supported, for example `fe80::1%eth0`, `fe80::1%1` or `::1%lo`.<br><br>Defaults to `['127.0.0.1', '::1']` which means that only `localhost`, the server instance on which Parse Server runs, is allowed to use the master key.
:DEFAULT: ["127.0.0.1","::1"] */
masterKeyIps: ?(string[]);
Expand Down Expand Up @@ -305,7 +308,7 @@ export interface ParseServerOptions {
:ENV: PARSE_SERVER_MOUNT_GRAPHQL
:DEFAULT: false */
mountGraphQL: ?boolean;
/* Mount path for the GraphQL endpoint, defaults to /graphql
/* The mount path for the GraphQL endpoint<br><br>⚠️ File upload inside the GraphQL mutation system requires Parse Server to be able to call itself by making requests to the URL set in `serverURL`.<br><br>Defaults is `/graphql`.
:ENV: PARSE_SERVER_GRAPHQL_PATH
:DEFAULT: /graphql */
graphQLPath: ?string;
Expand Down
12 changes: 10 additions & 2 deletions src/ParseServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,13 @@ class ParseServer {
* Create an express app for the parse server
* @param {Object} options let you specify the maxUploadSize when creating the express app */
static app(options) {
const { maxUploadSize = '20mb', appId, directAccess, pages, rateLimit = [] } = options;
const {
maxUploadSize = '20mb',
appId,
directAccess,
pages,
rateLimit = [],
} = options;
// This app serves the Parse API directly.
// It's the equivalent of https://api.parse.com/1 in the hosted Parse API.
var api = express();
Expand Down Expand Up @@ -481,7 +487,9 @@ class ParseServer {
/* istanbul ignore next */
if (!process.env.TESTING) {
configureListeners(this);
await ParseServer.verifyServerUrl();
if (options.verifyServerUrl !== false) {
await ParseServer.verifyServerUrl();
}
}
this.expressApp = app;
return this;
Expand Down
1 change: 1 addition & 0 deletions types/Options/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export interface ParseServerOptions {
allowExpiredAuthDataToken?: boolean;
requestKeywordDenylist?: (RequestKeywordDenylist[]);
rateLimit?: (RateLimitOptions[]);
verifyServerUrl?: boolean;
}
export interface RateLimitOptions {
requestPath: string;
Expand Down
Loading