parse-dashboard 5.0.0-alpha.2 → 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/public/bundles/sprites.svg +5 -0
- package/Parse-Dashboard/server.js +169 -0
- package/package.json +30 -34
|
@@ -241,6 +241,11 @@
|
|
|
241
241
|
<symbol id="locked-solid" viewBox="0 0 100 100">
|
|
242
242
|
<path d="M19.096 71.097v21.885c0 3.876 3.143 7.02 7.02 7.02h47.77c3.875 0 7.018-3.143 7.018-7.02V71.097H19.096zM80.904 66V51.055H73.29V29.6C73.287 16.76 62.84 6.314 50 6.314S26.712 16.76 26.712 29.6v21.454h-7.616V66h61.808zm-42.36-36.4c0-6.317 5.138-11.456 11.456-11.456s11.457 5.14 11.457 11.457V51.06H38.543V29.6z"/>
|
|
243
243
|
</symbol>
|
|
244
|
+
<symbol id="logout" viewBox="0 0 34 30">
|
|
245
|
+
<g transform="matrix(0.8248,0,0,0.8248,-2.79521,-4.64161)">
|
|
246
|
+
<path d="M9,42C8.2,42 7.5,41.7 6.9,41.1C6.3,40.5 6,39.8 6,39L6,9C6,8.2 6.3,7.5 6.9,6.9C7.5,6.3 8.2,6 9,6L23.55,6L23.55,9L9,9L9,39L23.55,39L23.55,42L9,42ZM33.3,32.75L31.15,30.6L36.25,25.5L18.75,25.5L18.75,22.5L36.15,22.5L31.05,17.4L33.2,15.25L42,24.05L33.3,32.75Z"/>
|
|
247
|
+
</g>
|
|
248
|
+
</symbol>
|
|
244
249
|
<symbol id="mail-outline" viewBox="0 0 100 100">
|
|
245
250
|
<path d="M0 14.04v61.72c0 5.624 4.575 10.2 10.2 10.2h79.6c5.624 0 10.2-4.576 10.2-10.2V14.04H0zm65.32 31.846L91 25.76v42.05L65.32 45.887zM8 68.716V25.76l27.244 20.558L8 68.715zM15.277 22h69.446L50 49.123 15.277 22zM89.8 78H10.2c-.46 0-.868-.672-1.18-.96l31.717-26.508L50 57.638l9.826-7.538L91.39 76.48c-.275.606-.88 1.52-1.59 1.52z"/>
|
|
246
251
|
</symbol>
|
|
@@ -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": "
|
|
94
|
-
"all-node-versions": "
|
|
95
|
-
"babel-
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"eslint": "
|
|
100
|
-
"eslint-plugin-jest": "23.8.2",
|
|
101
|
-
"eslint-plugin-react": "7.19.0",
|
|
91
|
+
"@types/jest": "29.1.1",
|
|
92
|
+
"all-node-versions": "11.0.1",
|
|
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",
|