Skip to content

build: merge beta #1841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2021
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
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Changelogs are separated by release type for better overview.

## ✅ [Master Releases][log_master]
## ✅ [Stable Releases][log_release]

These are the official, stable releases that you can use in your production environments.

Expand All @@ -11,7 +11,7 @@ These are the official, stable releases that you can use in your production envi
Details:
- Stability: *stable*
- NPM channel: `@latest`
- Branch: [master][branch_master]
- Branch: [release][branch_release]
- Purpose: official release
- Suitable environment: production

Expand All @@ -30,7 +30,7 @@ Details:

## 🔥 [Alpha Releases][log_alpha]

> ### “Use if you love sudden breaking changes!”
> ### “If you are curious to see what's next!”

These releases contain the latest development changes, but you should be prepared for anything, including sudden breaking changes or code refactoring. Use this branch to contribute to the project and open pull requests.

Expand All @@ -42,9 +42,9 @@ Details:
- Suitable environment: experimental


[log_master]: https://github.com/parse-community/parse-dashboard/blob/master/changelogs/CHANGELOG_master.md
[log_release]: https://github.com/parse-community/parse-dashboard/blob/release/changelogs/CHANGELOG_release.md
[log_beta]: https://github.com/parse-community/parse-dashboard/blob/beta/changelogs/CHANGELOG_beta.md
[log_alpha]: https://github.com/parse-community/parse-dashboard/blob/alpha/changelogs/CHANGELOG_alpha.md
[branch_master]: https://github.com/parse-community/parse-dashboard/tree/master
[branch_release]: https://github.com/parse-community/parse-dashboard/tree/release
[branch_beta]: https://github.com/parse-community/parse-dashboard/tree/beta
[branch_alpha]: https://github.com/parse-community/parse-dashboard/tree/alpha
114 changes: 56 additions & 58 deletions Parse-Dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Command line tool for npm start
'use strict'
const path = require('path');
const jsonFile = require('json-file-plus');
const fs = require('fs');
const express = require('express');
const parseDashboard = require('./app');
const CLIHelper = require('./CLIHelper.js');
Expand Down Expand Up @@ -126,74 +126,72 @@ if (!program.config && !process.env.PARSE_DASHBOARD_CONFIG) {
}
}

let p = null;
let config = null;
let configFilePath = null;
if (configFile) {
p = jsonFile(configFile);
configFilePath = path.dirname(configFile);
try {
config = {
data: JSON.parse(fs.readFileSync(configFile, 'utf8'))
};
configFilePath = path.dirname(configFile);
} catch (error) {
if (error instanceof SyntaxError) {
console.log('Your config file contains invalid JSON. Exiting.');
process.exit(1);
} else if (error.code === 'ENOENT') {
if (explicitConfigFileProvided) {
console.log('Your config file is missing. Exiting.');
process.exit(2);
} else {
console.log('You must provide either a config file or required CLI options (app ID, Master Key, and server URL); not both.');
process.exit(3);
}
} else {
console.log('There was a problem with your config. Exiting.');
process.exit(-1);
}
}
} else if (configFromCLI) {
p = Promise.resolve(configFromCLI);
config = configFromCLI;
} else {
//Failed to load default config file.
console.log('You must provide either a config file or an app ID, Master Key, and server URL. See parse-dashboard --help for details.');
process.exit(4);
}
p.then(config => {
config.data.apps.forEach(app => {
if (!app.appName) {
app.appName = app.appId;
}
});

if (config.data.iconsFolder && configFilePath) {
config.data.iconsFolder = path.join(configFilePath, config.data.iconsFolder);
config.data.apps.forEach(app => {
if (!app.appName) {
app.appName = app.appId;
}
});

const app = express();
if (config.data.iconsFolder && configFilePath) {
config.data.iconsFolder = path.join(configFilePath, config.data.iconsFolder);
}

if (allowInsecureHTTP || trustProxy || dev) app.enable('trust proxy');
const app = express();

config.data.trustProxy = trustProxy;
let dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev };
app.use(mountPath, parseDashboard(config.data, dashboardOptions));
let server;
if(!configSSLKey || !configSSLCert){
// Start the server.
server = app.listen(port, host, function () {
console.log(`The dashboard is now available at http://${server.address().address}:${server.address().port}${mountPath}`);
});
} else {
// Start the server using SSL.
var fs = require('fs');
var privateKey = fs.readFileSync(configSSLKey);
var certificate = fs.readFileSync(configSSLCert);
if (allowInsecureHTTP || trustProxy || dev) app.enable('trust proxy');

server = require('https').createServer({
key: privateKey,
cert: certificate
}, app).listen(port, host, function () {
console.log(`The dashboard is now available at https://${server.address().address}:${server.address().port}${mountPath}`);
});
}
handleSIGs(server);
}, error => {
if (error instanceof SyntaxError) {
console.log('Your config file contains invalid JSON. Exiting.');
process.exit(1);
} else if (error.code === 'ENOENT') {
if (explicitConfigFileProvided) {
console.log('Your config file is missing. Exiting.');
process.exit(2);
} else {
console.log('You must provide either a config file or required CLI options (app ID, Master Key, and server URL); not both.');
process.exit(3);
}
} else {
console.log('There was a problem with your config. Exiting.');
process.exit(-1);
}
})
.catch(error => {
console.log('There was a problem loading the dashboard. Exiting.', error);
process.exit(-1);
});
config.data.trustProxy = trustProxy;
let dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev };
app.use(mountPath, parseDashboard(config.data, dashboardOptions));
let server;
if(!configSSLKey || !configSSLCert){
// Start the server.
server = app.listen(port, host, function () {
console.log(`The dashboard is now available at http://${server.address().address}:${server.address().port}${mountPath}`);
});
} else {
// Start the server using SSL.
var privateKey = fs.readFileSync(configSSLKey);
var certificate = fs.readFileSync(configSSLCert);

server = require('https').createServer({
key: privateKey,
cert: certificate
}, app).listen(port, host, function () {
console.log(`The dashboard is now available at https://${server.address().address}:${server.address().port}${mountPath}`);
});
}
handleSIGs(server);
File renamed without changes.
48 changes: 5 additions & 43 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"immutable-devtools": "0.1.5",
"inquirer": "8.1.3",
"js-beautify": "1.14.0",
"json-file-plus": "3.2.0",
"otpauth": "7.0.6",
"package-json": "6.5.0",
"parse": "3.3.1",
Expand Down