parse-dashboard 5.0.0-alpha.3 → 5.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Parse-Dashboard/index.js +13 -163
- package/Parse-Dashboard/public/bundles/128.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/269.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/290.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/31.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/339.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/341.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/410.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/550.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/65.bundle.js +1 -0
- package/Parse-Dashboard/public/bundles/688.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/722.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/725.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/732.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/772.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/773.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/783.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/817.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/820.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/829.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/906.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/974.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/977.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/dashboard.bundle.js +1 -1
- package/Parse-Dashboard/public/bundles/dashboard.bundle.js.LICENSE.txt +33 -8
- package/Parse-Dashboard/public/bundles/login.bundle.js +1 -1
- package/Parse-Dashboard/server.js +169 -0
- package/package.json +29 -33
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016-present, Parse, LLC
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the LICENSE file in
|
|
6
|
+
* the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
// Command line tool for npm start
|
|
9
|
+
'use strict'
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const express = require('express');
|
|
13
|
+
const parseDashboard = require('./app');
|
|
14
|
+
|
|
15
|
+
module.exports = (options) => {
|
|
16
|
+
const host = options.host || process.env.HOST || '0.0.0.0';
|
|
17
|
+
const port = options.port || process.env.PORT || 4040;
|
|
18
|
+
const mountPath = options.mountPath || process.env.MOUNT_PATH || '/';
|
|
19
|
+
const allowInsecureHTTP = options.allowInsecureHTTP || process.env.PARSE_DASHBOARD_ALLOW_INSECURE_HTTP;
|
|
20
|
+
const cookieSessionSecret = options.cookieSessionSecret || process.env.PARSE_DASHBOARD_COOKIE_SESSION_SECRET;
|
|
21
|
+
const trustProxy = options.trustProxy || process.env.PARSE_DASHBOARD_TRUST_PROXY;
|
|
22
|
+
const dev = options.dev;
|
|
23
|
+
|
|
24
|
+
if (trustProxy && allowInsecureHTTP) {
|
|
25
|
+
console.log('Set only trustProxy *or* allowInsecureHTTP, not both. Only one is needed to handle being behind a proxy.');
|
|
26
|
+
process.exit(-1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let explicitConfigFileProvided = !!options.config;
|
|
30
|
+
let configFile = null;
|
|
31
|
+
let configFromCLI = null;
|
|
32
|
+
let configServerURL = options.serverURL || process.env.PARSE_DASHBOARD_SERVER_URL;
|
|
33
|
+
let configGraphQLServerURL = options.graphQLServerURL || process.env.PARSE_DASHBOARD_GRAPHQL_SERVER_URL;
|
|
34
|
+
let configMasterKey = options.masterKey || process.env.PARSE_DASHBOARD_MASTER_KEY;
|
|
35
|
+
let configAppId = options.appId || process.env.PARSE_DASHBOARD_APP_ID;
|
|
36
|
+
let configAppName = options.appName || process.env.PARSE_DASHBOARD_APP_NAME;
|
|
37
|
+
let configUserId = options.userId || process.env.PARSE_DASHBOARD_USER_ID;
|
|
38
|
+
let configUserPassword = options.userPassword || process.env.PARSE_DASHBOARD_USER_PASSWORD;
|
|
39
|
+
let configSSLKey = options.sslKey || process.env.PARSE_DASHBOARD_SSL_KEY;
|
|
40
|
+
let configSSLCert = options.sslCert || process.env.PARSE_DASHBOARD_SSL_CERT;
|
|
41
|
+
|
|
42
|
+
function handleSIGs(server) {
|
|
43
|
+
const signals = {
|
|
44
|
+
'SIGINT': 2,
|
|
45
|
+
'SIGTERM': 15
|
|
46
|
+
};
|
|
47
|
+
function shutdown(signal, value) {
|
|
48
|
+
server.close(function () {
|
|
49
|
+
console.log('server stopped by ' + signal);
|
|
50
|
+
process.exit(128 + value);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
Object.keys(signals).forEach(function (signal) {
|
|
54
|
+
process.on(signal, function () {
|
|
55
|
+
shutdown(signal, signals[signal]);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!options.config && !process.env.PARSE_DASHBOARD_CONFIG) {
|
|
61
|
+
if (configServerURL && configMasterKey && configAppId) {
|
|
62
|
+
configFromCLI = {
|
|
63
|
+
data: {
|
|
64
|
+
apps: [
|
|
65
|
+
{
|
|
66
|
+
appId: configAppId,
|
|
67
|
+
serverURL: configServerURL,
|
|
68
|
+
masterKey: configMasterKey,
|
|
69
|
+
appName: configAppName,
|
|
70
|
+
},
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
if (configGraphQLServerURL) {
|
|
75
|
+
configFromCLI.data.apps[0].graphQLServerURL = configGraphQLServerURL;
|
|
76
|
+
}
|
|
77
|
+
if (configUserId && configUserPassword) {
|
|
78
|
+
configFromCLI.data.users = [
|
|
79
|
+
{
|
|
80
|
+
user: configUserId,
|
|
81
|
+
pass: configUserPassword,
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
} else if (!configServerURL && !configMasterKey && !configAppName) {
|
|
86
|
+
configFile = path.join(__dirname, 'parse-dashboard-config.json');
|
|
87
|
+
}
|
|
88
|
+
} else if (!options.config && process.env.PARSE_DASHBOARD_CONFIG) {
|
|
89
|
+
configFromCLI = {
|
|
90
|
+
data: JSON.parse(process.env.PARSE_DASHBOARD_CONFIG)
|
|
91
|
+
};
|
|
92
|
+
} else {
|
|
93
|
+
configFile = options.config;
|
|
94
|
+
if (options.appId || options.serverURL || options.masterKey || options.appName || options.graphQLServerURL) {
|
|
95
|
+
console.log('You must provide either a config file or other CLI options (appName, appId, masterKey, serverURL, and graphQLServerURL); not both.');
|
|
96
|
+
process.exit(3);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
let config = null;
|
|
101
|
+
let configFilePath = null;
|
|
102
|
+
if (configFile) {
|
|
103
|
+
try {
|
|
104
|
+
config = {
|
|
105
|
+
data: JSON.parse(fs.readFileSync(configFile, 'utf8'))
|
|
106
|
+
};
|
|
107
|
+
configFilePath = path.dirname(configFile);
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (error instanceof SyntaxError) {
|
|
110
|
+
console.log('Your config file contains invalid JSON. Exiting.');
|
|
111
|
+
process.exit(1);
|
|
112
|
+
} else if (error.code === 'ENOENT') {
|
|
113
|
+
if (explicitConfigFileProvided) {
|
|
114
|
+
console.log('Your config file is missing. Exiting.');
|
|
115
|
+
process.exit(2);
|
|
116
|
+
} else {
|
|
117
|
+
console.log('You must provide either a config file or required CLI options (app ID, Master Key, and server URL); not both.');
|
|
118
|
+
process.exit(3);
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
console.log('There was a problem with your config. Exiting.');
|
|
122
|
+
process.exit(-1);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
} else if (configFromCLI) {
|
|
126
|
+
config = configFromCLI;
|
|
127
|
+
} else {
|
|
128
|
+
//Failed to load default config file.
|
|
129
|
+
console.log('You must provide either a config file or an app ID, Master Key, and server URL. See parse-dashboard --help for details.');
|
|
130
|
+
process.exit(4);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
config.data.apps.forEach(app => {
|
|
134
|
+
if (!app.appName) {
|
|
135
|
+
app.appName = app.appId;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
if (config.data.iconsFolder && configFilePath) {
|
|
140
|
+
config.data.iconsFolder = path.join(configFilePath, config.data.iconsFolder);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const app = express();
|
|
144
|
+
|
|
145
|
+
if (allowInsecureHTTP || trustProxy || dev) app.enable('trust proxy');
|
|
146
|
+
|
|
147
|
+
config.data.trustProxy = trustProxy;
|
|
148
|
+
let dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev };
|
|
149
|
+
app.use(mountPath, parseDashboard(config.data, dashboardOptions));
|
|
150
|
+
let server;
|
|
151
|
+
if(!configSSLKey || !configSSLCert){
|
|
152
|
+
// Start the server.
|
|
153
|
+
server = app.listen(port, host, function () {
|
|
154
|
+
console.log(`The dashboard is now available at http://${server.address().address}:${server.address().port}${mountPath}`);
|
|
155
|
+
});
|
|
156
|
+
} else {
|
|
157
|
+
// Start the server using SSL.
|
|
158
|
+
var privateKey = fs.readFileSync(configSSLKey);
|
|
159
|
+
var certificate = fs.readFileSync(configSSLCert);
|
|
160
|
+
|
|
161
|
+
server = require('https').createServer({
|
|
162
|
+
key: privateKey,
|
|
163
|
+
cert: certificate
|
|
164
|
+
}, app).listen(port, host, function () {
|
|
165
|
+
console.log(`The dashboard is now available at https://${server.address().address}:${server.address().port}${mountPath}`);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
handleSIGs(server);
|
|
169
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse-dashboard",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/ParsePlatform/parse-dashboard"
|
|
@@ -35,29 +35,29 @@
|
|
|
35
35
|
"LICENSE"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@babel/runtime": "7.
|
|
38
|
+
"@babel/runtime": "7.19.0",
|
|
39
|
+
"@babel/runtime-corejs3": "7.19.1",
|
|
39
40
|
"bcryptjs": "2.3.0",
|
|
40
41
|
"body-parser": "1.20.0",
|
|
41
42
|
"commander": "9.4.0",
|
|
42
43
|
"connect-flash": "0.1.1",
|
|
43
44
|
"cookie-session": "2.0.0",
|
|
44
|
-
"copy-to-clipboard": "3.3.
|
|
45
|
-
"core-js": "3.
|
|
45
|
+
"copy-to-clipboard": "3.3.2",
|
|
46
|
+
"core-js": "3.25.3",
|
|
46
47
|
"csurf": "1.11.0",
|
|
47
48
|
"express": "4.18.1",
|
|
48
|
-
"graphiql": "
|
|
49
|
-
"graphql": "16.
|
|
50
|
-
"history": "4.10.1",
|
|
49
|
+
"graphiql": "2.0.7",
|
|
50
|
+
"graphql": "16.6.0",
|
|
51
51
|
"immutable": "4.1.0",
|
|
52
52
|
"immutable-devtools": "0.1.5",
|
|
53
53
|
"inquirer": "8.2.4",
|
|
54
|
-
"js-beautify": "1.14.
|
|
55
|
-
"otpauth": "8.0.
|
|
54
|
+
"js-beautify": "1.14.6",
|
|
55
|
+
"otpauth": "8.0.2",
|
|
56
56
|
"package-json": "7.0.0",
|
|
57
57
|
"parse": "3.4.2",
|
|
58
58
|
"passport": "0.5.3",
|
|
59
59
|
"passport-local": "1.0.0",
|
|
60
|
-
"prismjs": "1.
|
|
60
|
+
"prismjs": "1.29.0",
|
|
61
61
|
"prop-types": "15.8.1",
|
|
62
62
|
"qrcode": "1.5.1",
|
|
63
63
|
"react": "16.14.0",
|
|
@@ -68,21 +68,19 @@
|
|
|
68
68
|
"react-helmet": "6.1.0",
|
|
69
69
|
"react-json-view": "1.21.3",
|
|
70
70
|
"react-popper-tooltip": "4.4.2",
|
|
71
|
-
"react-
|
|
72
|
-
"react-router": "5.2.1",
|
|
73
|
-
"react-router-dom": "5.3.0",
|
|
71
|
+
"react-router-dom": "6.4.1",
|
|
74
72
|
"regenerator-runtime": "0.13.9",
|
|
75
73
|
"semver": "7.3.7",
|
|
76
|
-
"typescript": "4.
|
|
74
|
+
"typescript": "4.8.3"
|
|
77
75
|
},
|
|
78
76
|
"devDependencies": {
|
|
79
77
|
"@actions/core": "1.9.1",
|
|
80
|
-
"@babel/core": "7.
|
|
81
|
-
"@babel/
|
|
82
|
-
"@babel/plugin-
|
|
83
|
-
"@babel/plugin-transform-runtime": "7.
|
|
84
|
-
"@babel/preset-env": "7.
|
|
85
|
-
"@babel/preset-react": "7.
|
|
78
|
+
"@babel/core": "7.19.3",
|
|
79
|
+
"@babel/eslint-parser": "7.19.1",
|
|
80
|
+
"@babel/plugin-proposal-decorators": "7.19.3",
|
|
81
|
+
"@babel/plugin-transform-runtime": "7.19.1",
|
|
82
|
+
"@babel/preset-env": "7.19.3",
|
|
83
|
+
"@babel/preset-react": "7.18.6",
|
|
86
84
|
"@saithodev/semantic-release-backmerge": "2.1.2",
|
|
87
85
|
"@semantic-release/changelog": "5.0.1",
|
|
88
86
|
"@semantic-release/commit-analyzer": "8.0.1",
|
|
@@ -90,27 +88,25 @@
|
|
|
90
88
|
"@semantic-release/github": "7.2.3",
|
|
91
89
|
"@semantic-release/npm": "7.1.3",
|
|
92
90
|
"@semantic-release/release-notes-generator": "9.0.3",
|
|
93
|
-
"@types/jest": "
|
|
91
|
+
"@types/jest": "29.1.1",
|
|
94
92
|
"all-node-versions": "11.0.1",
|
|
95
|
-
"babel-
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"eslint": "
|
|
100
|
-
"eslint-plugin-jest": "23.8.2",
|
|
101
|
-
"eslint-plugin-react": "7.19.0",
|
|
93
|
+
"babel-loader": "8.2.5",
|
|
94
|
+
"css-loader": "6.7.1",
|
|
95
|
+
"eslint": "8.24.0",
|
|
96
|
+
"eslint-plugin-jest": "27.0.4",
|
|
97
|
+
"eslint-plugin-react": "7.31.8",
|
|
102
98
|
"http-server": "14.0.0",
|
|
103
|
-
"jest": "
|
|
99
|
+
"jest": "29.1.2",
|
|
100
|
+
"jest-environment-jsdom": "29.1.2",
|
|
104
101
|
"madge": "5.0.1",
|
|
105
102
|
"marked": "4.0.10",
|
|
106
|
-
"node-sass": "7.0.3",
|
|
107
103
|
"null-loader": "4.0.1",
|
|
108
|
-
"
|
|
109
|
-
"puppeteer": "3.0.0",
|
|
104
|
+
"puppeteer": "18.0.5",
|
|
110
105
|
"react-test-renderer": "16.13.1",
|
|
111
106
|
"request": "2.88.2",
|
|
112
107
|
"request-promise": "4.2.5",
|
|
113
|
-
"sass
|
|
108
|
+
"sass": "1.55.0",
|
|
109
|
+
"sass-loader": "13.0.2",
|
|
114
110
|
"semantic-release": "17.4.6",
|
|
115
111
|
"style-loader": "3.3.1",
|
|
116
112
|
"svg-prep": "1.0.4",
|