Skip to content

Commit 43acc81

Browse files
Merge commit '5bb5683d614e280b85487b02db8f3ba2655d1850'
* commit '5bb5683d614e280b85487b02db8f3ba2655d1850': (119 commits) Release notes 1.3.0 (parse-community#1042) Update commander to the latest version 🚀 (parse-community#1044) Update react-dnd to the latest version 🚀 (parse-community#1043) Update babel7 to the latest version 🚀 (parse-community#1041) Update history to the latest version 🚀 (parse-community#1021) Update react to the latest version 🚀 (parse-community#1029) Remove CLA & bounty program references (parse-community#1026) Add badges to README (parse-community#1040) Remove references to parse.com (parse-community#1027) Update parse to the latest version 🚀 (parse-community#1039) Create CODE_OF_CONDUCT.md (parse-community#1028) Update react-dnd to the latest version 🚀 (parse-community#1036) Update query-string to the latest version 🚀 (parse-community#1035) Update react-dnd to the latest version 🚀 (parse-community#1034) Update react-dnd to the latest version 🚀 (parse-community#1033) Update js-beautify to the latest version 🚀 (parse-community#1032) Update prismjs to the latest version 🚀 (parse-community#1030) Update babel7 to the latest version 🚀 (parse-community#1025) Update babel7 to the latest version 🚀 (parse-community#1024) Update react-router-dom to the latest version 🚀 (parse-community#1023) ...
2 parents 3c4fcfa + 5bb5683 commit 43acc81

File tree

70 files changed

+5381
-3532
lines changed

Some content is hidden

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

70 files changed

+5381
-3532
lines changed

.github/stale.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 45
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 7
5+
# Issues with these labels will never be considered stale
6+
exemptLabels:
7+
- pinned
8+
- security
9+
- good-first-pr
10+
- up-for-grabs
11+
- enhancement
12+
- help wanted
13+
- bug
14+
# Label to use when marking an issue as stale
15+
staleLabel: wontfix
16+
# Comment to post when marking an issue as stale. Set to `false` to disable
17+
markComment: >
18+
This issue has been automatically marked as stale because it has not had
19+
recent activity. It will be closed if no further activity occurs. Thank you
20+
for your contributions.
21+
# Comment to post when closing a stale issue. Set to `false` to disable
22+
closeComment: false

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.11

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
language: node_js
22
node_js:
3-
- '6.11'
4-
- '8.8'
3+
- '10.14'
54
before_install:
65
- npm install -g greenkeeper-lockfile@1
76
before_script:
87
- ./scripts/before_script.sh
98
- greenkeeper-lockfile-update
109
after_script:
1110
- greenkeeper-lockfile-upload
12-
cache:
13-
directories:
14-
- node_modules
1511
deploy:
1612
provider: npm
1713
on:

CHANGELOG.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
## Parse Dashboard Changelog
2+
* _Contributing to this repo? Add info about your change here to be included in next release_
23

3-
### NEXT RELEASE
4+
### master
5+
[Full Changelog](https://github.com/parse-community/parse-dashboard/compare/1.3.0...master)
6+
7+
### 1.3.0
8+
[Full Changelog](https://github.com/parse-community/parse-dashboard/compare/1.2.0...1.3.0)
9+
10+
* Node 10 Support, thanks [Florent Vilmart](https://github.com/flovilmart)
11+
* Fix: Remove column dialog default values (#969), thanks to [Jonas Stendahl](https://github.com/JStonevalley)
12+
* Fix: Handle case of null in array (#922), thanks to [Abdullah Alsigar](https://github.com/agent3bood)
13+
* Fix: JSON file upload (#935), thanks to [joshuadiezmo](https://github.com/joshuadiezmo)
14+
* Fix: Set initial audience null (#910), thanks to [Paulo Reis](https://github.com/paulovitin)
15+
* Fix: Ensure we traverse the payloadJSON properly (#861), thanks [Florent Vilmart](https://github.com/flovilmart)
16+
* Improvements: Push Audiences (#813), thanks [Florent Vilmart](https://github.com/flovilmart)
17+
* Improvements: Docker Build
18+
* Feature: `preventSchemaEdits` option (#960), thanks to [Cyril Chandelier](https://github.com/cyrilchandelier)
19+
* Feature: Redirect to the first app browser when only a single app is registered (#958), thanks to [Cyril Chandelier](https://github.com/cyrilchandelier)
20+
* Feature: Add classname to browser title (#913), thanks to [Paulo Reis](https://github.com/paulovitin)
21+
* Feature: Support for Clone Object (#946), thanks to [Diamond Lewis](https://github.com/dplewis)
22+
* Feature: Add tvOS support to push targeting (#936), thanks to [Thomas Kollbach](https://github.com/toto)
23+
* Feature: When using username to login, display dashboard username (#800), thanks to [Abdullah Alsigar](https://github.com/agent3bood)
424

5-
* _Contributing to this repo? Add info about your change here to be included in next release_
625

726
### 1.2.0
827
* Fix: Filtering with a 1-digit number (#831), thanks to [Pascal Giguère](https://github.com/pgiguere1)

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,11 @@ We actively welcome your pull requests.
1818
4. If you've updated/added an UI component, please add a screenshot.
1919
5. If you've fixed an issue or added features, add what you've changed to the CHANGELOG.
2020
6. Ensure the test suite passes.
21-
7. If you haven't already, complete the Contributor License Agreement ("CLA").
22-
23-
## Contributor License Agreement ("CLA")
24-
In order to accept your pull request, we need you to submit a CLA. You only need
25-
to do this once to work on any of Facebook's open source projects.
26-
27-
Complete your CLA here: <https://code.facebook.com/cla>
2821

2922
## Issues
3023
We use GitHub issues to track public bugs. Please ensure your description is
3124
clear and has sufficient instructions to be able to reproduce the issue.
3225

33-
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
34-
disclosure of security bugs. In those cases, please go through the process
35-
outlined on that page and do not file a public issue.
36-
3726
## License
3827
By contributing to Parse Dashboard, you agree that your contributions will be licensed
3928
under its license.

Dockerfile

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
1-
FROM node:8-slim
2-
ENV NPM_CONFIG_LOGLEVEL error
1+
#
2+
# --- Base Node Image ---
3+
FROM node:8-alpine AS base
4+
35
WORKDIR /src
4-
ADD . /src
5-
RUN cd /src \
6-
&& npm install \
7-
&& npm run build \
8-
&& npm cache clear --force \
9-
&& rm -rf ~/.npm \
10-
&& rm -rf /var/lib/apt/lists/*
11-
ENTRYPOINT ["npm", "run", "dashboard"]
6+
7+
# Copy package.json first to benefit from layer caching
8+
COPY package*.json ./
9+
RUN npm install --only=production
10+
# Copy production node_modules aside for later
11+
RUN cp -R node_modules prod_node_modules
12+
# Install remaining dev dependencies
13+
RUN npm install
14+
15+
COPY . /src
16+
17+
# Run all webpack build steps
18+
RUN npm run prepublish && npm run build
19+
20+
21+
#
22+
# --- Production Image ---
23+
FROM node:8-alpine AS release
24+
WORKDIR /src
25+
26+
# Copy production node_modules
27+
COPY --from=base /src/prod_node_modules /src/node_modules
28+
COPY --from=base /src/package*.json /src/
29+
30+
# Copy compiled src dirs
31+
COPY --from=base /src/Parse-Dashboard/ /src/Parse-Dashboard/
32+
33+
USER node
34+
35+
ENTRYPOINT ["node", "Parse-Dashboard/index.js"]

Parse-Dashboard/app.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,17 @@ module.exports = function(config, options) {
8888
req.connection.remoteAddress === '127.0.0.1' ||
8989
req.connection.remoteAddress === '::ffff:127.0.0.1' ||
9090
req.connection.remoteAddress === '::1';
91-
if (!requestIsLocal && !req.secure && !options.allowInsecureHTTP) {
92-
//Disallow HTTP requests except on localhost, to prevent the master key from being transmitted in cleartext
93-
return res.send({ success: false, error: 'Parse Dashboard can only be remotely accessed via HTTPS' });
94-
}
91+
if (!options.dev && !requestIsLocal) {
92+
if (!req.secure && !options.allowInsecureHTTP) {
93+
//Disallow HTTP requests except on localhost, to prevent the master key from being transmitted in cleartext
94+
return res.send({ success: false, error: 'Parse Dashboard can only be remotely accessed via HTTPS' });
95+
}
9596

96-
if (!requestIsLocal && !users) {
97-
//Accessing the dashboard over the internet can only be done with username and password
98-
return res.send({ success: false, error: 'Configure a user to access Parse Dashboard remotely' });
97+
if (!users) {
98+
//Accessing the dashboard over the internet can only be done with username and password
99+
return res.send({ success: false, error: 'Configure a user to access Parse Dashboard remotely' });
100+
}
99101
}
100-
101102
const authentication = req.user;
102103

103104
const successfulAuth = authentication && authentication.isAuthenticated;
@@ -139,7 +140,7 @@ module.exports = function(config, options) {
139140

140141
//They didn't provide auth, and have configured the dashboard to not need auth
141142
//(ie. didn't supply usernames and passwords)
142-
if (requestIsLocal) {
143+
if (requestIsLocal || options.dev) {
143144
//Allow no-auth access on localhost only, if they have configured the dashboard to not need auth
144145
return res.json(response);
145146
}
@@ -202,6 +203,9 @@ module.exports = function(config, options) {
202203
if (users && (!req.user || !req.user.isAuthenticated)) {
203204
return res.redirect(`${mountPath}login`);
204205
}
206+
if (users && req.user && req.user.matchingUsername ) {
207+
res.append('username', req.user.matchingUsername);
208+
}
205209
res.send(`<!DOCTYPE html>
206210
<head>
207211
<link rel="shortcut icon" type="image/x-icon" href="${mountPath}favicon.ico" />

Parse-Dashboard/index.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const program = require('commander');
1616
program.option('--appId [appId]', 'the app Id of the app you would like to manage.');
1717
program.option('--masterKey [masterKey]', 'the master key of the app you would like to manage.');
1818
program.option('--serverURL [serverURL]', 'the server url of the app you would like to manage.');
19+
program.option('--dev', 'Enable development mode. This will disable authentication and allow non HTTPS connections. DO NOT ENABLE IN PRODUCTION SERVERS');
1920
program.option('--appName [appName]', 'the name of the app you would like to manage. Optional.');
2021
program.option('--config [config]', 'the path to the configuration file');
2122
program.option('--host [host]', 'the host to run parse-dashboard');
@@ -35,6 +36,7 @@ const mountPath = program.mountPath || process.env.MOUNT_PATH || '/';
3536
const allowInsecureHTTP = program.allowInsecureHTTP || process.env.PARSE_DASHBOARD_ALLOW_INSECURE_HTTP;
3637
const cookieSessionSecret = program.cookieSessionSecret || process.env.PARSE_DASHBOARD_COOKIE_SESSION_SECRET;
3738
const trustProxy = program.trustProxy || process.env.PARSE_DASHBOARD_TRUST_PROXY;
39+
const dev = program.dev;
3840

3941
if (trustProxy && allowInsecureHTTP) {
4042
console.log("Set only trustProxy *or* allowInsecureHTTP, not both. Only one is needed to handle being behind a proxy.");
@@ -52,6 +54,25 @@ let configUserId = program.userId || process.env.PARSE_DASHBOARD_USER_ID;
5254
let configUserPassword = program.userPassword || process.env.PARSE_DASHBOARD_USER_PASSWORD;
5355
let configSSLKey = program.sslKey || process.env.PARSE_DASHBOARD_SSL_KEY;
5456
let configSSLCert = program.sslCert || process.env.PARSE_DASHBOARD_SSL_CERT;
57+
58+
function handleSIGs(server) {
59+
const signals = {
60+
'SIGINT': 2,
61+
'SIGTERM': 15
62+
};
63+
function shutdown(signal, value) {
64+
server.close(function () {
65+
console.log('server stopped by ' + signal);
66+
process.exit(128 + value);
67+
});
68+
}
69+
Object.keys(signals).forEach(function (signal) {
70+
process.on(signal, function () {
71+
shutdown(signal, signals[signal]);
72+
});
73+
});
74+
}
75+
5576
if (!program.config && !process.env.PARSE_DASHBOARD_CONFIG) {
5677
if (configServerURL && configMasterKey && configAppId) {
5778
configFromCLI = {
@@ -114,14 +135,15 @@ p.then(config => {
114135

115136
const app = express();
116137

117-
if (allowInsecureHTTP || trustProxy) app.enable('trust proxy');
138+
if (allowInsecureHTTP || trustProxy || dev) app.enable('trust proxy');
118139

119140
config.data.trustProxy = trustProxy;
120-
let dashboardOptions = { allowInsecureHTTP: allowInsecureHTTP, cookieSessionSecret: cookieSessionSecret };
141+
let dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev };
121142
app.use(mountPath, parseDashboard(config.data, dashboardOptions));
143+
let server;
122144
if(!configSSLKey || !configSSLCert){
123145
// Start the server.
124-
const server = app.listen(port, host, function () {
146+
server = app.listen(port, host, function () {
125147
console.log(`The dashboard is now available at http://${server.address().address}:${server.address().port}${mountPath}`);
126148
});
127149
} else {
@@ -130,13 +152,14 @@ p.then(config => {
130152
var privateKey = fs.readFileSync(configSSLKey);
131153
var certificate = fs.readFileSync(configSSLCert);
132154

133-
const server = require('https').createServer({
155+
server = require('https').createServer({
134156
key: privateKey,
135157
cert: certificate
136158
}, app).listen(port, host, function () {
137159
console.log(`The dashboard is now available at https://${server.address().address}:${server.address().port}${mountPath}`);
138160
});
139161
}
162+
handleSIGs(server);
140163
}, error => {
141164
if (error instanceof SyntaxError) {
142165
console.log('Your config file contains invalid JSON. Exiting.');

Parse-Dashboard/parse-dashboard-config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"apps": [{
3-
"serverURL": "",
4-
"appId": "",
5-
"masterKey": "",
3+
"serverURL": "http://localhost:1337/parse",
4+
"appId": "hello",
5+
"masterKey": "world",
66
"appName": "",
77
"iconName": "",
88
"primaryBackgroundColor": "",

0 commit comments

Comments
 (0)