Skip to content

Commit 6c676b6

Browse files
authored
build: Release beta (#2397)
2 parents 106fc74 + 17b4f67 commit 6c676b6

30 files changed

+1815
-1739
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
### Issue Description
1212
<!-- Add a brief description of the issue this PR solves. -->
1313

14-
Related issue: #`FILL_THIS_OUT`
14+
Closes: FILL_THIS_OUT
1515

1616
### Approach
1717
<!-- Add a description of the approach in this PR. -->
@@ -24,4 +24,3 @@ Related issue: #`FILL_THIS_OUT`
2424

2525
- [ ] Add tests
2626
- [ ] Add changes to documentation (guides, repository pages, in-code descriptions)
27-
- [x] A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

.github/workflows/ci.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
restore-keys: |
2727
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
2828
- name: Install dependencies
29-
run: npm ci
29+
run: npm ci --ignore-scripts
3030
- name: CI Node Engine Check
3131
run: npm run ci:checkNodeEngine
3232
check-lint:
@@ -47,11 +47,11 @@ jobs:
4747
restore-keys: |
4848
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
4949
- name: Install dependencies
50-
run: npm ci
50+
run: npm ci --ignore-scripts
5151
- run: npm run lint
5252
check-circular:
5353
name: Circular Dependencies
54-
timeout-minutes: 5
54+
timeout-minutes: 15
5555
runs-on: ubuntu-latest
5656
steps:
5757
- uses: actions/checkout@v2
@@ -67,7 +67,7 @@ jobs:
6767
restore-keys: |
6868
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
6969
- name: Install dependencies
70-
run: npm ci
70+
run: npm ci --ignore-scripts
7171
- name: Scan for circular dependencies
7272
run: npm run madge:circular
7373
check-docker:
@@ -143,12 +143,8 @@ jobs:
143143
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
144144
restore-keys: |
145145
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
146-
- name: Install dependencies (Node < 10)
147-
run: npm install
148-
if: ${{ steps.node.outputs.node_major < 10 }}
149-
- name: Install dependencies (Node >= 10)
146+
- name: Install dependencies
150147
run: npm ci
151-
if: ${{ steps.node.outputs.node_major >= 10 }}
152148
- name: Tests
153149
run: npm test
154150
- name: Test bundles

Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
############################################################
22
# Build stage
33
############################################################
4-
FROM node:lts-alpine AS base
4+
FROM node:lts-alpine AS build
55

6-
RUN apk update; \
7-
apk add git;
6+
RUN apk --no-cache add git
87
WORKDIR /src
98

109
# Copy package.json first to benefit from layer caching
1110
COPY package*.json ./
1211

1312
# Install without scripts otherwise webpack will fail
14-
RUN npm ci --production --ignore-scripts
13+
RUN npm ci --omit=dev --ignore-scripts
1514

1615
# Copy production node_modules aside for later
1716
RUN cp -R node_modules prod_node_modules
@@ -32,11 +31,11 @@ FROM node:lts-alpine AS release
3231
WORKDIR /src
3332

3433
# Copy production node_modules
35-
COPY --from=base /src/prod_node_modules /src/node_modules
36-
COPY --from=base /src/package*.json /src/
34+
COPY --from=build /src/prod_node_modules /src/node_modules
35+
COPY --from=build /src/package*.json /src/
3736

3837
# Copy compiled src dirs
39-
COPY --from=base /src/Parse-Dashboard/ /src/Parse-Dashboard/
38+
COPY --from=build /src/Parse-Dashboard/ /src/Parse-Dashboard/
4039

4140
USER node
4241

Parse-Dashboard/Authentication.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,30 @@ function initialize(app, options) {
5454
});
5555

5656
var cookieSessionSecret = options.cookieSessionSecret || require('crypto').randomBytes(64).toString('hex');
57+
const cookieSessionMaxAge = options.cookieSessionMaxAge;
5758
app.use(require('connect-flash')());
5859
app.use(require('body-parser').urlencoded({ extended: true }));
5960
app.use(require('cookie-session')({
6061
key : 'parse_dash',
6162
secret : cookieSessionSecret,
62-
cookie : {
63-
maxAge: (2 * 7 * 24 * 60 * 60 * 1000) // 2 weeks
64-
}
63+
maxAge : cookieSessionMaxAge
6564
}));
6665
app.use(passport.initialize());
6766
app.use(passport.session());
6867

6968
app.post('/login',
7069
csrf(),
71-
passport.authenticate('local', {
72-
successRedirect: `${self.mountPath}apps`,
73-
failureRedirect: `${self.mountPath}login`,
74-
failureFlash : true
75-
})
70+
(req,res,next) => {
71+
let redirect = 'apps';
72+
if (req.body.redirect) {
73+
redirect = req.body.redirect.charAt(0) === '/' ? req.body.redirect.substring(1) : req.body.redirect
74+
}
75+
return passport.authenticate('local', {
76+
successRedirect: `${self.mountPath}${redirect}`,
77+
failureRedirect: `${self.mountPath}login${req.body.redirect ? `?redirect=${req.body.redirect}` : ''}`,
78+
failureFlash : true
79+
})(req, res, next)
80+
},
7681
);
7782

7883
app.get('/logout', function(req, res){

Parse-Dashboard/app.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = function(config, options) {
6868
const users = config.users;
6969
const useEncryptedPasswords = config.useEncryptedPasswords ? true : false;
7070
const authInstance = new Authentication(users, useEncryptedPasswords, mountPath);
71-
authInstance.initialize(app, { cookieSessionSecret: options.cookieSessionSecret });
71+
authInstance.initialize(app, { cookieSessionSecret: options.cookieSessionSecret, cookieSessionMaxAge: options.cookieSessionMaxAge });
7272

7373
// CSRF error handler
7474
app.use(function (err, req, res, next) {
@@ -173,8 +173,9 @@ module.exports = function(config, options) {
173173
}
174174

175175
app.get('/login', csrf(), function(req, res) {
176+
const redirectURL = req.url.includes('?redirect=') && req.url.split('?redirect=')[1].length > 1 && req.url.split('?redirect=')[1];
176177
if (!users || (req.user && req.user.isAuthenticated)) {
177-
return res.redirect(`${mountPath}apps`);
178+
return res.redirect(`${mountPath}${redirectURL || 'apps'}`);
178179
}
179180

180181
let errors = req.flash('error');
@@ -206,6 +207,10 @@ module.exports = function(config, options) {
206207
// For every other request, go to index.html. Let client-side handle the rest.
207208
app.get('/*', function(req, res) {
208209
if (users && (!req.user || !req.user.isAuthenticated)) {
210+
const redirect = req.url.replace('/login', '');
211+
if (redirect.length > 1) {
212+
return res.redirect(`${mountPath}login?redirect=${redirect}`);
213+
}
209214
return res.redirect(`${mountPath}login`);
210215
}
211216
if (users && req.user && req.user.matchingUsername ) {

Parse-Dashboard/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ program.option('--trustProxy [trustProxy]', 'set this flag when you are behind a
2828
program.option('--cookieSessionSecret [cookieSessionSecret]', 'set the cookie session secret, defaults to a random string. You should set that value if you want sessions to work across multiple server, or across restarts');
2929
program.option('--createUser', 'helper tool to allow you to generate secure user passwords and secrets. Use this on trusted devices only.');
3030
program.option('--createMFA', 'helper tool to allow you to generate multi-factor authentication secrets.');
31+
program.option('--cookieSessionMaxAge [cookieSessionMaxAge]', '(Optional) Sets the time in seconds for when the session cookie will be deleted and the dashboard user has to re-login; if no value is set then the cookie will be deleted when the browser session ends.');
32+
3133
program.action(async (options) => {
3234
for (const key in options) {
3335
const func = CLIHelper[key];

Parse-Dashboard/server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = (options) => {
1919
const allowInsecureHTTP = options.allowInsecureHTTP || process.env.PARSE_DASHBOARD_ALLOW_INSECURE_HTTP;
2020
const cookieSessionSecret = options.cookieSessionSecret || process.env.PARSE_DASHBOARD_COOKIE_SESSION_SECRET;
2121
const trustProxy = options.trustProxy || process.env.PARSE_DASHBOARD_TRUST_PROXY;
22+
const cookieSessionMaxAge = options.cookieSessionMaxAge || process.env.PARSE_DASHBOARD_COOKIE_SESSION_MAX_AGE;
2223
const dev = options.dev;
2324

2425
if (trustProxy && allowInsecureHTTP) {
@@ -145,7 +146,7 @@ module.exports = (options) => {
145146
if (allowInsecureHTTP || trustProxy || dev) app.enable('trust proxy');
146147

147148
config.data.trustProxy = trustProxy;
148-
let dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev };
149+
let dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev, cookieSessionMaxAge };
149150
app.use(mountPath, parseDashboard(config.data, dashboardOptions));
150151
let server;
151152
if(!configSSLKey || !configSSLCert){

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
---
44

55
[![Build Status](https://github.com/parse-community/parse-dashboard/workflows/ci/badge.svg?branch=alpha)](https://github.com/parse-community/parse-dashboard/actions?query=workflow%3Aci+branch%3Aalpha)
6+
[![Build Status](https://github.com/parse-community/parse-dashboard/workflows/ci/badge.svg?branch=beta)](https://github.com/parse-community/parse-dashboard/actions?query=workflow%3Aci+branch%3Abeta)
7+
[![Build Status](https://github.com/parse-community/parse-dashboard/workflows/ci/badge.svg?branch=release)](https://github.com/parse-community/parse-dashboard/actions?query=workflow%3Aci+branch%3Arelease)
68
[![Snyk Badge](https://snyk.io/test/github/parse-community/parse-dashboard/badge.svg)](https://snyk.io/test/github/parse-community/parse-dashboard)
79

810
[![Node Version](https://img.shields.io/badge/nodejs-14,_16,_18-green.svg?logo=node.js&style=flat)](https://nodejs.org/)

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ module.exports = {
55
],
66
presets: [
77
'@babel/preset-react',
8-
['@babel/preset-env', { corejs: '3.25', useBuiltIns: 'entry' }],
8+
['@babel/preset-env', { corejs: '3.28', useBuiltIns: 'entry' }],
99
],
1010
};

changelogs/CHANGELOG_alpha.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
1+
# [5.1.0-alpha.10](https://github.com/ParsePlatform/parse-dashboard/compare/5.1.0-alpha.9...5.1.0-alpha.10) (2023-02-13)
2+
3+
4+
### Bug Fixes
5+
6+
* Data browser dialog "No data to display" may be outside of visible area in Safari browser ([#2387](https://github.com/ParsePlatform/parse-dashboard/issues/2387)) ([52bba62](https://github.com/ParsePlatform/parse-dashboard/commit/52bba6246cd05c255ca562dcb32da5b104f9908e))
7+
8+
# [5.1.0-alpha.9](https://github.com/ParsePlatform/parse-dashboard/compare/5.1.0-alpha.8...5.1.0-alpha.9) (2023-02-11)
9+
10+
11+
### Bug Fixes
12+
13+
* Screen goes blank when trying to add column of type `Object` or `GeoPoint` ([#2384](https://github.com/ParsePlatform/parse-dashboard/issues/2384)) ([0886386](https://github.com/ParsePlatform/parse-dashboard/commit/08863868b90455116232b2b73a39391ba990c30c))
14+
15+
# [5.1.0-alpha.8](https://github.com/ParsePlatform/parse-dashboard/compare/5.1.0-alpha.7...5.1.0-alpha.8) (2023-01-29)
16+
17+
18+
### Bug Fixes
19+
20+
* Internal error message on login with missing credential ([#2370](https://github.com/ParsePlatform/parse-dashboard/issues/2370)) ([9a6a31f](https://github.com/ParsePlatform/parse-dashboard/commit/9a6a31f7d45d1402bfc3a988bef21c4a5bb1b123))
21+
22+
# [5.1.0-alpha.7](https://github.com/ParsePlatform/parse-dashboard/compare/5.1.0-alpha.6...5.1.0-alpha.7) (2023-01-28)
23+
24+
25+
### Bug Fixes
26+
27+
* Dashboard may display blank page when selecting an app after login ([#2375](https://github.com/ParsePlatform/parse-dashboard/issues/2375)) ([f399b91](https://github.com/ParsePlatform/parse-dashboard/commit/f399b913490f15a0d3be8dde7242dd0b825fa02e))
28+
29+
# [5.1.0-alpha.6](https://github.com/ParsePlatform/parse-dashboard/compare/5.1.0-alpha.5...5.1.0-alpha.6) (2023-01-25)
30+
31+
32+
### Bug Fixes
33+
34+
* Navigation to page fails if user re-login is required ([#2369](https://github.com/ParsePlatform/parse-dashboard/issues/2369)) ([0db6f55](https://github.com/ParsePlatform/parse-dashboard/commit/0db6f5559f9b7bb1f5a282c6182810ca89945032))
35+
36+
# [5.1.0-alpha.5](https://github.com/ParsePlatform/parse-dashboard/compare/5.1.0-alpha.4...5.1.0-alpha.5) (2023-01-25)
37+
38+
39+
### Features
40+
41+
* Add export all rows of a class and export in JSON format ([#2361](https://github.com/ParsePlatform/parse-dashboard/issues/2361)) ([9eb36a1](https://github.com/ParsePlatform/parse-dashboard/commit/9eb36a183b8b337960f6e8563ad686958001a22b))
42+
43+
# [5.1.0-alpha.4](https://github.com/ParsePlatform/parse-dashboard/compare/5.1.0-alpha.3...5.1.0-alpha.4) (2023-01-25)
44+
45+
46+
### Bug Fixes
47+
48+
* Add dashboard option `cookieSessionMaxAge` to keep user logged in across browser sessions ([#2366](https://github.com/ParsePlatform/parse-dashboard/issues/2366)) ([9ea95fc](https://github.com/ParsePlatform/parse-dashboard/commit/9ea95fc62103b52cf4fac1d1b567334b5298b318))
49+
50+
# [5.1.0-alpha.3](https://github.com/ParsePlatform/parse-dashboard/compare/5.1.0-alpha.2...5.1.0-alpha.3) (2023-01-20)
51+
52+
53+
### Features
54+
55+
* Add schema export ([#2362](https://github.com/ParsePlatform/parse-dashboard/issues/2362)) ([33df049](https://github.com/ParsePlatform/parse-dashboard/commit/33df0495a02c4e77f48b3566032bf5686227cce7))
56+
57+
# [5.1.0-alpha.2](https://github.com/ParsePlatform/parse-dashboard/compare/5.1.0-alpha.1...5.1.0-alpha.2) (2023-01-20)
58+
59+
60+
### Bug Fixes
61+
62+
* Blank screen shown if server is unreachable; unsupported pages are accessible via direct URLs ([#2363](https://github.com/ParsePlatform/parse-dashboard/issues/2363)) ([9855258](https://github.com/ParsePlatform/parse-dashboard/commit/98552584df4d8d75d65d3e394b4acad522117a96))
63+
64+
# [5.1.0-alpha.1](https://github.com/ParsePlatform/parse-dashboard/compare/5.0.0...5.1.0-alpha.1) (2022-11-05)
65+
66+
67+
### Bug Fixes
68+
69+
* Text selection not visible in modal dialog header ([#2340](https://github.com/ParsePlatform/parse-dashboard/issues/2340)) ([fb0e79c](https://github.com/ParsePlatform/parse-dashboard/commit/fb0e79c0837c3acce27524e798e02da667cbc5a3))
70+
71+
### Features
72+
73+
* remove limitation to refresh Cloud Jobs list only after 30 seconds ([#2332](https://github.com/ParsePlatform/parse-dashboard/issues/2332)) ([ad1132f](https://github.com/ParsePlatform/parse-dashboard/commit/ad1132fb13e854a030e769fdf7689f35d363031d))
74+
175
# [5.0.0-alpha.8](https://github.com/ParsePlatform/parse-dashboard/compare/5.0.0-alpha.7...5.0.0-alpha.8) (2022-10-24)
276

377

docker-compose.uffizzi.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
version: '3'
2+
3+
# uffizzi integration
4+
x-uffizzi:
5+
ingress:
6+
service: nginx
7+
port: 8081
8+
continuous_previews:
9+
deploy_preview_when_pull_request_is_opened: true
10+
delete_preview_when_pull_request_is_closed: true
11+
share_to_github: true
12+
13+
services:
14+
15+
postgres:
16+
image: postgres
17+
environment:
18+
- POSTGRES_USER=postgres
19+
- POSTGRES_PASSWORD=password
20+
- POSTGRES_DB=postgres
21+
ports:
22+
- "5432:5432"
23+
deploy:
24+
resources:
25+
limits:
26+
memory: 1000M
27+
volumes:
28+
- postgres_data:/var/lib/postgresql
29+
30+
parse:
31+
image: parseplatform/parse-server:latest
32+
environment:
33+
- PARSE_SERVER_APPLICATION_ID=parse
34+
- PARSE_SERVER_MASTER_KEY=parse@master123!
35+
- PARSE_SERVER_DATABASE_URI=postgresql://postgres:password@localhost:5432/postgres
36+
- PARSE_SERVER_MOUNT_PATH=/parse
37+
- PORT=1337
38+
ports:
39+
- '1337:1337'
40+
deploy:
41+
resources:
42+
limits:
43+
memory: 1000M
44+
45+
dashboard:
46+
build:
47+
context: .
48+
dockerfile: ./Dockerfile
49+
ports:
50+
- "4040:4040"
51+
environment:
52+
- PARSE_DASHBOARD_MASTER_KEY=parse@master123!
53+
- PARSE_DASHBOARD_APP_ID=parse
54+
- PARSE_DASHBOARD_APP_NAME=PreviewApp
55+
- PARSE_DASHBOARD_USER_ID=user
56+
- PARSE_DASHBOARD_USER_PASSWORD=pass
57+
- MOUNT_PATH=/dashboard
58+
- PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1
59+
entrypoint: /bin/sh
60+
command:
61+
- "-c"
62+
- "PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js"
63+
deploy:
64+
resources:
65+
limits:
66+
memory: 1000M
67+
68+
nginx:
69+
image: nginx:alpine
70+
volumes:
71+
- ./nginx-uffizzi:/etc/nginx
72+
- ./nginx-uffizzi/html:/usr/share/nginx/html
73+
74+
volumes:
75+
postgres_data:

0 commit comments

Comments
 (0)