Skip to content

build: Release beta #2397

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 35 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fb0e79c
fix: Text selection not visible in modal dialog header (#2340)
jadsonlourenco Nov 5, 2022
9a3804e
chore(release): 5.1.0-alpha.1 [skip ci]
semantic-release-bot Nov 5, 2022
97eb077
docs: add CI badges to README
mtrezza Nov 5, 2022
0a5b547
refactor: bump loader-utils from 2.0.0 to 2.0.3 (#2341)
dependabot[bot] Nov 8, 2022
b26496d
docs: update PR template
mtrezza Nov 16, 2022
600854b
refactor: Bump loader-utils from 2.0.3 to 2.0.4 (#2343)
dependabot[bot] Nov 18, 2022
1809f85
refactor: Bump qs from 6.5.2 to 6.5.3 (#2347)
dependabot[bot] Dec 6, 2022
9843022
refactor: Bump minimatch from 3.0.4 to 3.1.2 (#2348)
dependabot[bot] Dec 6, 2022
070f649
refactor: Bump json5 from 2.2.0 to 2.2.3 (#2357)
dependabot[bot] Jan 7, 2023
9855258
fix: Blank screen shown if server is unreachable; unsupported pages a…
dblythy Jan 20, 2023
7180e9c
chore(release): 5.1.0-alpha.2 [skip ci]
semantic-release-bot Jan 20, 2023
33df049
feat: Add schema export (#2362)
dblythy Jan 20, 2023
9d5c72c
chore(release): 5.1.0-alpha.3 [skip ci]
semantic-release-bot Jan 20, 2023
7fa5a7f
ci: Fix timeout of circular dependency check (#2371)
mtrezza Jan 25, 2023
9ea95fc
fix: Add dashboard option `cookieSessionMaxAge` to keep user logged i…
zivchen Jan 25, 2023
d9105e7
chore(release): 5.1.0-alpha.4 [skip ci]
semantic-release-bot Jan 25, 2023
9eb36a1
feat: Add export all rows of a class and export in JSON format (#2361)
dblythy Jan 25, 2023
181be84
chore(release): 5.1.0-alpha.5 [skip ci]
semantic-release-bot Jan 25, 2023
2e65067
refactor: Bump ua-parser-js from 0.7.28 to 0.7.33 (#2372)
dependabot[bot] Jan 25, 2023
0db6f55
fix: Navigation to page fails if user re-login is required (#2369)
dblythy Jan 25, 2023
2238887
chore(release): 5.1.0-alpha.6 [skip ci]
semantic-release-bot Jan 25, 2023
4062054
ci: Add deployment preview to pull requests via Uffizzi integration (…
ShrutiC-git Jan 27, 2023
f399b91
fix: Dashboard may display blank page when selecting an app after log…
dblythy Jan 28, 2023
0f52d0c
chore(release): 5.1.0-alpha.7 [skip ci]
semantic-release-bot Jan 28, 2023
a843ff5
ci: Restyle preview html (#2377)
mtrezza Jan 28, 2023
3c8b67e
refactor: Remove warnings in Docker build (#2350)
cbaker6 Jan 28, 2023
9a6a31f
fix: Internal error message on login with missing credential (#2370)
dblythy Jan 29, 2023
abc0cc8
chore(release): 5.1.0-alpha.8 [skip ci]
semantic-release-bot Jan 29, 2023
fef02d7
refactor: Bump http-cache-semantics from 4.1.0 to 4.1.1 (#2381)
dependabot[bot] Feb 3, 2023
0886386
fix: Screen goes blank when trying to add column of type `Object` or …
Feb 11, 2023
dc18f7e
chore(release): 5.1.0-alpha.9 [skip ci]
semantic-release-bot Feb 11, 2023
52bba62
fix: Data browser dialog "No data to display" may be outside of visib…
Feb 13, 2023
6a63fb9
chore(release): 5.1.0-alpha.10 [skip ci]
semantic-release-bot Feb 13, 2023
d8468ae
refactor: Upgrade various dependencies (#2388)
Feb 15, 2023
17b4f67
ci: Skip unnecessary builds (#2389)
Feb 18, 2023
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
3 changes: 1 addition & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
### Issue Description
<!-- Add a brief description of the issue this PR solves. -->

Related issue: #`FILL_THIS_OUT`
Closes: FILL_THIS_OUT

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

- [ ] Add tests
- [ ] Add changes to documentation (guides, repository pages, in-code descriptions)
- [x] A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)
14 changes: 5 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
- name: Install dependencies
run: npm ci
run: npm ci --ignore-scripts
- name: CI Node Engine Check
run: npm run ci:checkNodeEngine
check-lint:
Expand All @@ -47,11 +47,11 @@ jobs:
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
- name: Install dependencies
run: npm ci
run: npm ci --ignore-scripts
- run: npm run lint
check-circular:
name: Circular Dependencies
timeout-minutes: 5
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -67,7 +67,7 @@ jobs:
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
- name: Install dependencies
run: npm ci
run: npm ci --ignore-scripts
- name: Scan for circular dependencies
run: npm run madge:circular
check-docker:
Expand Down Expand Up @@ -143,12 +143,8 @@ jobs:
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
- name: Install dependencies (Node < 10)
run: npm install
if: ${{ steps.node.outputs.node_major < 10 }}
- name: Install dependencies (Node >= 10)
- name: Install dependencies
run: npm ci
if: ${{ steps.node.outputs.node_major >= 10 }}
- name: Tests
run: npm test
- name: Test bundles
Expand Down
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
############################################################
# Build stage
############################################################
FROM node:lts-alpine AS base
FROM node:lts-alpine AS build

RUN apk update; \
apk add git;
RUN apk --no-cache add git
WORKDIR /src

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

# Install without scripts otherwise webpack will fail
RUN npm ci --production --ignore-scripts
RUN npm ci --omit=dev --ignore-scripts

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

# Copy production node_modules
COPY --from=base /src/prod_node_modules /src/node_modules
COPY --from=base /src/package*.json /src/
COPY --from=build /src/prod_node_modules /src/node_modules
COPY --from=build /src/package*.json /src/

# Copy compiled src dirs
COPY --from=base /src/Parse-Dashboard/ /src/Parse-Dashboard/
COPY --from=build /src/Parse-Dashboard/ /src/Parse-Dashboard/

USER node

Expand Down
21 changes: 13 additions & 8 deletions Parse-Dashboard/Authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,30 @@ function initialize(app, options) {
});

var cookieSessionSecret = options.cookieSessionSecret || require('crypto').randomBytes(64).toString('hex');
const cookieSessionMaxAge = options.cookieSessionMaxAge;
app.use(require('connect-flash')());
app.use(require('body-parser').urlencoded({ extended: true }));
app.use(require('cookie-session')({
key : 'parse_dash',
secret : cookieSessionSecret,
cookie : {
maxAge: (2 * 7 * 24 * 60 * 60 * 1000) // 2 weeks
}
maxAge : cookieSessionMaxAge
}));
app.use(passport.initialize());
app.use(passport.session());

app.post('/login',
csrf(),
passport.authenticate('local', {
successRedirect: `${self.mountPath}apps`,
failureRedirect: `${self.mountPath}login`,
failureFlash : true
})
(req,res,next) => {
let redirect = 'apps';
if (req.body.redirect) {
redirect = req.body.redirect.charAt(0) === '/' ? req.body.redirect.substring(1) : req.body.redirect
}
return passport.authenticate('local', {
successRedirect: `${self.mountPath}${redirect}`,
failureRedirect: `${self.mountPath}login${req.body.redirect ? `?redirect=${req.body.redirect}` : ''}`,
failureFlash : true
})(req, res, next)
},
);

app.get('/logout', function(req, res){
Expand Down
9 changes: 7 additions & 2 deletions Parse-Dashboard/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = function(config, options) {
const users = config.users;
const useEncryptedPasswords = config.useEncryptedPasswords ? true : false;
const authInstance = new Authentication(users, useEncryptedPasswords, mountPath);
authInstance.initialize(app, { cookieSessionSecret: options.cookieSessionSecret });
authInstance.initialize(app, { cookieSessionSecret: options.cookieSessionSecret, cookieSessionMaxAge: options.cookieSessionMaxAge });

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

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

let errors = req.flash('error');
Expand Down Expand Up @@ -206,6 +207,10 @@ module.exports = function(config, options) {
// For every other request, go to index.html. Let client-side handle the rest.
app.get('/*', function(req, res) {
if (users && (!req.user || !req.user.isAuthenticated)) {
const redirect = req.url.replace('/login', '');
if (redirect.length > 1) {
return res.redirect(`${mountPath}login?redirect=${redirect}`);
}
return res.redirect(`${mountPath}login`);
}
if (users && req.user && req.user.matchingUsername ) {
Expand Down
2 changes: 2 additions & 0 deletions Parse-Dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ program.option('--trustProxy [trustProxy]', 'set this flag when you are behind a
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');
program.option('--createUser', 'helper tool to allow you to generate secure user passwords and secrets. Use this on trusted devices only.');
program.option('--createMFA', 'helper tool to allow you to generate multi-factor authentication secrets.');
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.');

program.action(async (options) => {
for (const key in options) {
const func = CLIHelper[key];
Expand Down
3 changes: 2 additions & 1 deletion Parse-Dashboard/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = (options) => {
const allowInsecureHTTP = options.allowInsecureHTTP || process.env.PARSE_DASHBOARD_ALLOW_INSECURE_HTTP;
const cookieSessionSecret = options.cookieSessionSecret || process.env.PARSE_DASHBOARD_COOKIE_SESSION_SECRET;
const trustProxy = options.trustProxy || process.env.PARSE_DASHBOARD_TRUST_PROXY;
const cookieSessionMaxAge = options.cookieSessionMaxAge || process.env.PARSE_DASHBOARD_COOKIE_SESSION_MAX_AGE;
const dev = options.dev;

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

config.data.trustProxy = trustProxy;
let dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev };
let dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev, cookieSessionMaxAge };
app.use(mountPath, parseDashboard(config.data, dashboardOptions));
let server;
if(!configSSLKey || !configSSLCert){
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
---

[![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)
[![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)
[![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)
[![Snyk Badge](https://snyk.io/test/github/parse-community/parse-dashboard/badge.svg)](https://snyk.io/test/github/parse-community/parse-dashboard)

[![Node Version](https://img.shields.io/badge/nodejs-14,_16,_18-green.svg?logo=node.js&style=flat)](https://nodejs.org/)
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module.exports = {
],
presets: [
'@babel/preset-react',
['@babel/preset-env', { corejs: '3.25', useBuiltIns: 'entry' }],
['@babel/preset-env', { corejs: '3.28', useBuiltIns: 'entry' }],
],
};
74 changes: 74 additions & 0 deletions changelogs/CHANGELOG_alpha.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
# [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)


### Bug Fixes

* 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))

# [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)


### Bug Fixes

* 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))

# [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)


### Bug Fixes

* 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))

# [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)


### Bug Fixes

* 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))

# [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)


### Bug Fixes

* 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))

# [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)


### Features

* 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))

# [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)


### Bug Fixes

* 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))

# [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)


### Features

* Add schema export ([#2362](https://github.com/ParsePlatform/parse-dashboard/issues/2362)) ([33df049](https://github.com/ParsePlatform/parse-dashboard/commit/33df0495a02c4e77f48b3566032bf5686227cce7))

# [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)


### Bug Fixes

* 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))

# [5.1.0-alpha.1](https://github.com/ParsePlatform/parse-dashboard/compare/5.0.0...5.1.0-alpha.1) (2022-11-05)


### Bug Fixes

* 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))

### Features

* 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))

# [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)


Expand Down
75 changes: 75 additions & 0 deletions docker-compose.uffizzi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
version: '3'

# uffizzi integration
x-uffizzi:
ingress:
service: nginx
port: 8081
continuous_previews:
deploy_preview_when_pull_request_is_opened: true
delete_preview_when_pull_request_is_closed: true
share_to_github: true

services:

postgres:
image: postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgres
ports:
- "5432:5432"
deploy:
resources:
limits:
memory: 1000M
volumes:
- postgres_data:/var/lib/postgresql

parse:
image: parseplatform/parse-server:latest
environment:
- PARSE_SERVER_APPLICATION_ID=parse
- PARSE_SERVER_MASTER_KEY=parse@master123!
- PARSE_SERVER_DATABASE_URI=postgresql://postgres:password@localhost:5432/postgres
- PARSE_SERVER_MOUNT_PATH=/parse
- PORT=1337
ports:
- '1337:1337'
deploy:
resources:
limits:
memory: 1000M

dashboard:
build:
context: .
dockerfile: ./Dockerfile
ports:
- "4040:4040"
environment:
- PARSE_DASHBOARD_MASTER_KEY=parse@master123!
- PARSE_DASHBOARD_APP_ID=parse
- PARSE_DASHBOARD_APP_NAME=PreviewApp
- PARSE_DASHBOARD_USER_ID=user
- PARSE_DASHBOARD_USER_PASSWORD=pass
- MOUNT_PATH=/dashboard
- PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1
entrypoint: /bin/sh
command:
- "-c"
- "PARSE_DASHBOARD_SERVER_URL=$$UFFIZZI_URL/parse node Parse-Dashboard/index.js"
deploy:
resources:
limits:
memory: 1000M

nginx:
image: nginx:alpine
volumes:
- ./nginx-uffizzi:/etc/nginx
- ./nginx-uffizzi/html:/usr/share/nginx/html

volumes:
postgres_data:
Loading