Skip to content

Commit 74d4ac1

Browse files
authored
Merge ffb7edc into 826aa79
2 parents 826aa79 + ffb7edc commit 74d4ac1

File tree

75 files changed

+908
-903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+908
-903
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ jobs:
142142
MONGODB_TOPOLOGY: standalone
143143
MONGODB_STORAGE_ENGINE: wiredTiger
144144
NODE_VERSION: 14.18.1
145+
- name: Node 17
146+
MONGODB_VERSION: 4.4.10
147+
MONGODB_TOPOLOGY: standalone
148+
MONGODB_STORAGE_ENGINE: wiredTiger
149+
NODE_VERSION: 17.2.0
145150
fail-fast: false
146151
name: ${{ matrix.name }}
147152
timeout-minutes: 15
@@ -221,7 +226,7 @@ jobs:
221226
--health-retries 5
222227
env:
223228
PARSE_SERVER_TEST_DB: postgres
224-
PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@localhost:5432/parse_server_postgres_adapter_test_database
229+
PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@127.0.0.1:5432/parse_server_postgres_adapter_test_database
225230
NODE_VERSION: ${{ matrix.NODE_VERSION }}
226231
steps:
227232
- uses: actions/checkout@v2

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Once you have babel running in watch mode, you can start making changes to parse
129129

130130
If your pull request introduces a change that may affect the storage or retrieval of objects, you may want to make sure it plays nice with Postgres.
131131

132-
* Run the tests against the postgres database with `PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@localhost:5432/parse_server_postgres_adapter_test_database npm run testonly`. You'll need to have postgres running on your machine and setup [appropriately](https://github.com/parse-community/parse-server/blob/master/scripts/before_script_postgres.sh) or use [`Docker`](#run-a-parse-postgres-with-docker).
132+
* Run the tests against the postgres database with `PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@127.0.0.1:5432/parse_server_postgres_adapter_test_database npm run testonly`. You'll need to have postgres running on your machine and setup [appropriately](https://github.com/parse-community/parse-server/blob/master/scripts/before_script_postgres.sh) or use [`Docker`](#run-a-parse-postgres-with-docker).
133133
* The Postgres adapter has a special debugger that traces all the sql commands. You can enable it with setting the environment variable `PARSE_SERVER_LOG_LEVEL=debug`
134134
* If your feature is intended to only work with MongoDB, you should disable PostgreSQL-specific tests with:
135135

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Coverage](https://img.shields.io/codecov/c/github/parse-community/parse-server/alpha.svg)](https://codecov.io/github/parse-community/parse-server?branch=alpha)
88
[![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases)
99

10-
[![Node Version](https://img.shields.io/badge/nodejs-12,_14,_16-green.svg?logo=node.js&style=flat)](https://nodejs.org)
10+
[![Node Version](https://img.shields.io/badge/nodejs-12,_14,_16,_17-green.svg?logo=node.js&style=flat)](https://nodejs.org)
1111
[![MongoDB Version](https://img.shields.io/badge/mongodb-4.0,_4.2,_4.4,_5.0-green.svg?logo=mongodb&style=flat)](https://www.mongodb.com)
1212
[![Postgres Version](https://img.shields.io/badge/postgresql-11,_12,_13,_14-green.svg?logo=postgresql&style=flat)](https://www.postgresql.org)
1313

@@ -117,7 +117,7 @@ Parse Server is continuously tested with the most recent releases of Node.js to
117117
| Node.js 12 | 12.22.7 | April 2022 | ✅ Yes |
118118
| Node.js 14 | 14.18.1 | April 2023 | ✅ Yes |
119119
| Node.js 16 | 16.13.0 | April 2024 | ✅ Yes |
120-
| Node.js 17 | 17.x | June 2022 | ❌ Not tested |
120+
| Node.js 17 | 17.2.0 | June 2022 | ✅ Yes |
121121

122122
#### MongoDB
123123
Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and only test against versions that are officially supported and have not reached their end-of-life date.
@@ -143,7 +143,7 @@ Parse Server is continuously tested with the most recent releases of PostgreSQL
143143
```bash
144144
$ npm install -g parse-server mongodb-runner
145145
$ mongodb-runner start
146-
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
146+
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://127.0.0.1/test
147147
```
148148
***Note:*** *If installation with* `-g` *fails due to permission problems* (`npm ERR! code 'EACCES'`), *please refer to [this link](https://docs.npmjs.com/getting-started/fixing-npm-permissions).*
149149

@@ -180,7 +180,7 @@ $ curl -X POST \
180180
-H "X-Parse-Application-Id: APPLICATION_ID" \
181181
-H "Content-Type: application/json" \
182182
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
183-
http://localhost:1337/parse/classes/GameScore
183+
http://127.0.0.1:1337/parse/classes/GameScore
184184
```
185185

186186
You should get a response similar to this:
@@ -197,7 +197,7 @@ You can now retrieve this object directly (make sure to replace `2ntvSpRGIK` wit
197197
```bash
198198
$ curl -X GET \
199199
-H "X-Parse-Application-Id: APPLICATION_ID" \
200-
http://localhost:1337/parse/classes/GameScore/2ntvSpRGIK
200+
http://127.0.0.1:1337/parse/classes/GameScore/2ntvSpRGIK
201201
```
202202
```json
203203
// Response
@@ -216,7 +216,7 @@ Keeping tracks of individual object ids is not ideal, however. In most cases you
216216
```bash
217217
$ curl -X GET \
218218
-H "X-Parse-Application-Id: APPLICATION_ID" \
219-
http://localhost:1337/parse/classes/GameScore
219+
http://127.0.0.1:1337/parse/classes/GameScore
220220
```
221221
```json
222222
// The response will provide all the matching objects within the `results` array:
@@ -270,12 +270,12 @@ var ParseServer = require('parse-server').ParseServer;
270270
var app = express();
271271

272272
var api = new ParseServer({
273-
databaseURI: 'mongodb://localhost:27017/dev', // Connection string for your MongoDB database
273+
databaseURI: 'mongodb://127.0.0.1:27017/dev', // Connection string for your MongoDB database
274274
cloud: './cloud/main.js', // Path to your Cloud Code
275275
appId: 'myAppId',
276276
masterKey: 'myMasterKey', // Keep this key secret!
277277
fileKey: 'optionalFileKey',
278-
serverURL: 'http://localhost:1337/parse' // Don't forget to change to https if needed
278+
serverURL: 'http://127.0.0.1:1337/parse' // Don't forget to change to https if needed
279279
});
280280

281281
// Serve the Parse API on the /parse URL prefix
@@ -783,10 +783,10 @@ The easiest way to run the Parse GraphQL API is through the CLI:
783783
```bash
784784
$ npm install -g parse-server mongodb-runner
785785
$ mongodb-runner start
786-
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground
786+
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://127.0.0.1/test --publicServerURL http://127.0.0.1:1337/parse --mountGraphQL --mountPlayground
787787
```
788788
789-
After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
789+
After starting the server, you can visit http://127.0.0.1:1337/playground in your browser to start playing with your GraphQL API.
790790
791791
***Note:*** Do ***NOT*** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.
792792
@@ -804,12 +804,12 @@ $ docker run --name my-mongo -d mongo
804804
#### Running the Parse Server Image <!-- omit in toc -->
805805
806806
```bash
807-
$ docker run --name my-parse-server --link my-mongo:mongo -v config-vol:/parse-server/config -p 1337:1337 -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground
807+
$ docker run --name my-parse-server --link my-mongo:mongo -v config-vol:/parse-server/config -p 1337:1337 -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --publicServerURL http://127.0.0.1:1337/parse --mountGraphQL --mountPlayground
808808
```
809809
810810
***Note:*** *If you want to use [Cloud Code](https://docs.parseplatform.org/cloudcode/guide/), add `-v cloud-code-vol:/parse-server/cloud --cloud /parse-server/cloud/main.js` to the command above. Make sure `main.js` is in the `cloud-code-vol` directory before starting Parse Server.*
811811
812-
After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
812+
After starting the server, you can visit http://127.0.0.1:1337/playground in your browser to start playing with your GraphQL API.
813813
814814
***Note:*** Do ***NOT*** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.
815815
@@ -832,11 +832,11 @@ const { default: ParseServer, ParseGraphQLServer } = require('parse-server');
832832
const app = express();
833833

834834
const parseServer = new ParseServer({
835-
databaseURI: 'mongodb://localhost:27017/test',
835+
databaseURI: 'mongodb://127.0.0.1:27017/test',
836836
appId: 'APPLICATION_ID',
837837
masterKey: 'MASTER_KEY',
838-
serverURL: 'http://localhost:1337/parse',
839-
publicServerURL: 'http://localhost:1337/parse'
838+
serverURL: 'http://127.0.0.1:1337/parse',
839+
publicServerURL: 'http://127.0.0.1:1337/parse'
840840
});
841841

842842
const parseGraphQLServer = new ParseGraphQLServer(
@@ -852,9 +852,9 @@ parseGraphQLServer.applyGraphQL(app); // Mounts the GraphQL API
852852
parseGraphQLServer.applyPlayground(app); // (Optional) Mounts the GraphQL Playground - do NOT use in Production
853853

854854
app.listen(1337, function() {
855-
console.log('REST API running on http://localhost:1337/parse');
856-
console.log('GraphQL API running on http://localhost:1337/graphql');
857-
console.log('GraphQL Playground running on http://localhost:1337/playground');
855+
console.log('REST API running on http://127.0.0.1:1337/parse');
856+
console.log('GraphQL API running on http://127.0.0.1:1337/graphql');
857+
console.log('GraphQL Playground running on http://127.0.0.1:1337/playground');
858858
});
859859
```
860860
@@ -865,7 +865,7 @@ $ npx mongodb-runner start
865865
$ node index.js
866866
```
867867
868-
After starting the app, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
868+
After starting the app, you can visit http://127.0.0.1:1337/playground in your browser to start playing with your GraphQL API.
869869
870870
***Note:*** Do ***NOT*** mount the GraphQL Playground in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.
871871
@@ -1045,7 +1045,7 @@ Parse GraphQL Server allows you to create a custom GraphQL schema with own queri
10451045
To start creating your custom schema, you need to code a `schema.graphql` file and initialize Parse Server with `--graphQLSchema` and `--cloud` options:
10461046
10471047
```bash
1048-
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://localhost:1337/parse --cloud ./cloud/main.js --graphQLSchema ./cloud/schema.graphql --mountGraphQL --mountPlayground
1048+
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://127.0.0.1/test --publicServerURL http://127.0.0.1:1337/parse --cloud ./cloud/main.js --graphQLSchema ./cloud/schema.graphql --mountGraphQL --mountPlayground
10491049
```
10501050
10511051
### Creating your first custom query <!-- omit in toc -->

bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ npm install -s
200200
CURL_CMD=$(cat << EOF
201201
curl -X POST -H 'X-Parse-Application-Id: ${APP_ID}' \\
202202
-H 'Content-Type: application/json' \\
203-
-d '{"foo":"bar"}' http://localhost:1337/parse/classes/TestObject
203+
-d '{"foo":"bar"}' http://127.0.0.1:1337/parse/classes/TestObject
204204
EOF)
205205
206206
echo "\n${CHECK} Happy Parsing!\n\n"

ci/ciCheck.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async function checkNodeVersions() {
6161
'<12.0.0', // These versions have reached their end-of-life support date
6262
'>=13.0.0 <14.0.0', // These versions have reached their end-of-life support date
6363
'>=15.0.0 <16.0.0', // These versions have reached their end-of-life support date
64-
'>=17.0.0', // These versions are not officially supported yet
64+
'>=18.0.0', // These versions are not officially supported yet
6565
],
6666
}).check();
6767
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
"madge:circular": "node_modules/.bin/madge ./src --circular"
132132
},
133133
"engines": {
134-
"node": ">=12.20.0 <17"
134+
"node": ">=12.20.0 <18"
135135
},
136136
"bin": {
137137
"parse-server": "bin/parse-server"

scripts/before_script_postgres.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44

55
echo "[SCRIPT] Before Script :: Setup Parse DB for Postgres"
66

7-
PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h localhost -U postgres <<-EOSQL
7+
PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h 127.0.0.1 -U postgres <<-EOSQL
88
CREATE DATABASE parse_server_postgres_adapter_test_database;
99
\c parse_server_postgres_adapter_test_database;
1010
CREATE EXTENSION pgcrypto;

scripts/before_script_postgres_conf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ echo "[SCRIPT] Before Script :: Setup Parse Postgres configuration file"
1111
# CPUs num: 1
1212
# Data Storage: ssd
1313

14-
PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h localhost -U postgres <<-EOSQL
14+
PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h 127.0.0.1 -U postgres <<-EOSQL
1515
ALTER SYSTEM SET max_connections TO '200';
1616
ALTER SYSTEM SET shared_buffers TO '1536MB';
1717
ALTER SYSTEM SET effective_cache_size TO '4608MB';

spec/AccountLockoutPolicy.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('Account Lockout Policy: ', () => {
4343
it('account should not be locked even after failed login attempts if account lockout policy is not set', done => {
4444
reconfigureServer({
4545
appName: 'unlimited',
46-
publicServerURL: 'http://localhost:1337/1',
46+
publicServerURL: 'http://127.0.0.1:1337/1',
4747
})
4848
.then(() => {
4949
const user = new Parse.User();
@@ -236,7 +236,7 @@ describe('Account Lockout Policy: ', () => {
236236
duration: 1,
237237
threshold: 2,
238238
},
239-
publicServerURL: 'http://localhost:8378/1',
239+
publicServerURL: 'http://127.0.0.1:8378/1',
240240
})
241241
.then(() => {
242242
const user = new Parse.User();
@@ -269,7 +269,7 @@ describe('Account Lockout Policy: ', () => {
269269
duration: 0.05, // 0.05*60 = 3 secs
270270
threshold: 2,
271271
},
272-
publicServerURL: 'http://localhost:8378/1',
272+
publicServerURL: 'http://127.0.0.1:8378/1',
273273
})
274274
.then(() => {
275275
const user = new Parse.User();
@@ -306,7 +306,7 @@ describe('Account Lockout Policy: ', () => {
306306
duration: 0.05, // 0.05*60 = 3 secs
307307
threshold: 2,
308308
},
309-
publicServerURL: 'http://localhost:8378/1',
309+
publicServerURL: 'http://127.0.0.1:8378/1',
310310
})
311311
.then(() => {
312312
const user = new Parse.User();
@@ -357,7 +357,7 @@ describe('lockout with password reset option', () => {
357357
const config = {
358358
appName: 'exampleApp',
359359
accountLockout: accountLockout,
360-
publicServerURL: 'http://localhost:8378/1',
360+
publicServerURL: 'http://127.0.0.1:8378/1',
361361
emailAdapter: {
362362
sendVerificationEmail: () => Promise.resolve(),
363363
sendPasswordResetEmail: () => Promise.resolve(),

spec/AudienceRouter.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,12 @@ describe('AudiencesRouter', () => {
399399
await reconfigureServer({
400400
appId: 'test',
401401
restAPIKey: 'test',
402-
publicServerURL: 'http://localhost:8378/1',
402+
publicServerURL: 'http://127.0.0.1:8378/1',
403403
});
404404
try {
405405
await request({
406406
method: 'POST',
407-
url: 'http://localhost:8378/1/classes/_Audience',
407+
url: 'http://127.0.0.1:8378/1/classes/_Audience',
408408
body: { lorem: 'ipsum', _method: 'POST' },
409409
headers: {
410410
'X-Parse-Application-Id': 'test',

spec/AuthenticationAdapters.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ describe('AuthenticationProviders', function () {
166166
'X-Parse-Session-Token': token,
167167
'Content-Type': 'application/json',
168168
},
169-
url: 'http://localhost:8378/1/users',
169+
url: 'http://127.0.0.1:8378/1/users',
170170
body: jsonBody,
171171
};
172172
return request(options)
@@ -1722,7 +1722,9 @@ describe('Apple Game Center Auth adapter', () => {
17221722
await gcenter.validateAuthData(authData);
17231723
fail();
17241724
} catch (e) {
1725-
expect(e.message).toBe('Apple Game Center - invalid publicKeyUrl: http://static.gc.apple.com/public-key/gc-prod-4.cer');
1725+
expect(e.message).toBe(
1726+
'Apple Game Center - invalid publicKeyUrl: http://static.gc.apple.com/public-key/gc-prod-4.cer'
1727+
);
17261728
}
17271729
});
17281730
});

spec/CLI.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ describe('execution', () => {
226226
'--masterKey',
227227
'test',
228228
'--databaseURI',
229-
'mongodb://localhost/test',
229+
'mongodb://127.0.0.1/test',
230230
'--port',
231231
'1339',
232232
]);
@@ -248,7 +248,7 @@ describe('execution', () => {
248248
'--masterKey',
249249
'test',
250250
'--databaseURI',
251-
'mongodb://localhost/test',
251+
'mongodb://127.0.0.1/test',
252252
'--port',
253253
'1340',
254254
'--mountGraphQL',
@@ -274,7 +274,7 @@ describe('execution', () => {
274274
'--masterKey',
275275
'test',
276276
'--databaseURI',
277-
'mongodb://localhost/test',
277+
'mongodb://127.0.0.1/test',
278278
'--port',
279279
'1341',
280280
'--mountGraphQL',

0 commit comments

Comments
 (0)