Skip to content

build: Release #2664

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 32 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
54bf0af
fix: Security upgrade express from 4.21.0 to 4.21.1 (#2607)
parseplatformorg Oct 9, 2024
af52142
chore(release): 6.0.0-alpha.17 [skip ci]
semantic-release-bot Oct 9, 2024
8c07284
fix: Node 22 support missing in package.json (#2617)
TomKremer Oct 16, 2024
811a8a3
chore(release): 6.0.0-alpha.18 [skip ci]
semantic-release-bot Oct 16, 2024
bab71dc
fix: Security upgrade ws, parse and puppeteer (#2618)
dependabot[bot] Oct 16, 2024
6c4d392
chore(release): 6.0.0-alpha.19 [skip ci]
semantic-release-bot Oct 16, 2024
47a43e0
fix: Security upgrade cross-spawn from 7.0.3 to 7.0.6 (#2629)
dependabot[bot] Nov 19, 2024
e9c93b0
chore(release): 6.0.0-alpha.20 [skip ci]
semantic-release-bot Nov 19, 2024
c2728f2
refactor: Bump path-to-regexp and express (#2630)
dependabot[bot] Dec 8, 2024
539e883
fix: Info panel not showing when some apps miss infoPanel config (#2627)
vardhan0604 Jan 23, 2025
fc02897
chore(release): 6.0.0-alpha.21 [skip ci]
semantic-release-bot Jan 24, 2025
a9b8cd4
fix: Info panel not configurable via `new ParseDashboard()` when runn…
vardhan0604 Jan 29, 2025
e06e577
chore(release): 6.0.0-alpha.22 [skip ci]
semantic-release-bot Jan 29, 2025
e879e4f
fix: Info panel Cloud Code call is unauthenticated without using mast…
mtrezza Jan 29, 2025
b1bf4e4
chore(release): 6.0.0-alpha.23 [skip ci]
semantic-release-bot Jan 29, 2025
a4bcabc
fix: Info panel Cloud Code call sends `objectId` instead of `Parse.Ob…
mtrezza Jan 29, 2025
aa73757
chore(release): 6.0.0-alpha.24 [skip ci]
semantic-release-bot Jan 29, 2025
8e5741d
feat: Add info panel item `panel` to load and display data on demand …
vardhan0604 Jan 30, 2025
243e92c
chore(release): 6.0.0-alpha.25 [skip ci]
semantic-release-bot Jan 30, 2025
6389fc6
feat: Add info panel `keyValue` item parameter `isRelativeUrl` to lin…
mtrezza Jan 31, 2025
a568e56
chore(release): 6.0.0-alpha.26 [skip ci]
semantic-release-bot Jan 31, 2025
44df723
fix: Security upgrade node from 20.17.0-alpine3.20 to 20.18.2-alpine3…
parseplatformorg Feb 1, 2025
b523e00
chore(release): 6.0.0-alpha.27 [skip ci]
semantic-release-bot Feb 1, 2025
81c9c77
docs: Fix incorrect info panel docs (#2648)
mtrezza Feb 1, 2025
884ff70
fix: Info panel item `panel` calls Cloud Code with parameter `objectI…
mtrezza Feb 1, 2025
3862c32
chore(release): 6.0.0-alpha.28 [skip ci]
semantic-release-bot Feb 1, 2025
9025ed0
feat: Add dynamic master key by allowing to set option `masterKey` to…
dblythy Feb 14, 2025
58b38f8
chore(release): 6.0.0-alpha.29 [skip ci]
semantic-release-bot Feb 14, 2025
9d623a9
feat: Add cell selection in data browser on space bar touch down (#2661)
dblythy Mar 3, 2025
135f5b6
chore(release): 6.0.0-alpha.30 [skip ci]
semantic-release-bot Mar 3, 2025
ec94e7b
ci: Remove beta releases (#2663)
mtrezza Mar 4, 2025
0393a4b
Merge branch 'release' into build/release
mtrezza Mar 4, 2025
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
15 changes: 0 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@ Details:
- Purpose: official release
- Suitable environment: production

## ⚠️ [Beta Releases][log_beta]

These are releases that are pretty stable, but may have still some bugs to be fixed before official release.

> ### “Please try out, we’d love your feedback!”

Details:
- Stability: *pretty stable*
- NPM channel: `@beta`
- Branch: [beta][branch_beta]
- Purpose: feature maturation
- Suitable environment: development

## 🔥 [Alpha Releases][log_alpha]

> ### “If you are curious to see what's next!”
Expand All @@ -43,8 +30,6 @@ Details:


[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_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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
############################################################
# Build stage
############################################################
FROM node:20.17.0-alpine3.20 AS build
FROM node:20.18.2-alpine3.20 AS build

RUN apk --no-cache add git
WORKDIR /src
Expand All @@ -27,7 +27,7 @@ RUN npm run prepare && npm run build
############################################################
# Release stage
############################################################
FROM node:20.17.0-alpine3.20 AS release
FROM node:20.18.2-alpine3.20 AS release
WORKDIR /src

# Copy production node_modules
Expand Down
44 changes: 32 additions & 12 deletions Parse-Dashboard/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const packageJson = require('package-json');
const csrf = require('csurf');
const Authentication = require('./Authentication.js');
const fs = require('fs');
const ConfigKeyCache = require('./configKeyCache.js');

const currentVersionFeatures = require('../package.json').parseDashboardFeatures;

Expand Down Expand Up @@ -80,11 +81,11 @@ module.exports = function(config, options) {
});

// Serve the configuration.
app.get('/parse-dashboard-config.json', function(req, res) {
app.get('/parse-dashboard-config.json', async (req, res) => {
const apps = config.apps.map((app) => Object.assign({}, app)); // make a copy
const response = {
apps: apps,
newFeaturesInLatestVersion: newFeaturesInLatestVersion,
apps,
newFeaturesInLatestVersion,
};

//Based on advice from Doug Wilson here:
Expand Down Expand Up @@ -119,20 +120,31 @@ module.exports = function(config, options) {
return app;
});
}

if (successfulAuth) {
if (appsUserHasAccess) {
// Restric access to apps defined in user dictionary
// If they didn't supply any app id, user will access all apps
response.apps = response.apps.filter(function (app) {
return appsUserHasAccess.find(appUserHasAccess => {
const isSame = app.appId === appUserHasAccess.appId;
if (isSame && appUserHasAccess.readOnly) {
const processedApps = await Promise.all(
response.apps.map(async (app) => {
const matchingAccess = appsUserHasAccess.find(
(access) => access.appId === app.appId
);

if (!matchingAccess) {
return null;
}

if (matchingAccess.readOnly) {
app.masterKey = app.readOnlyMasterKey;
}
return isSame;

if (typeof app.masterKey === 'function') {
app.masterKey = await ConfigKeyCache.get(app.appId, 'masterKey', app.masterKeyTtl, app.masterKey);
}

return app;
})
});
);

response.apps = processedApps.filter((app) => app !== null);
}
// They provided correct auth
return res.json(response);
Expand All @@ -147,6 +159,14 @@ module.exports = function(config, options) {
//(ie. didn't supply usernames and passwords)
if (requestIsLocal || options.dev) {
//Allow no-auth access on localhost only, if they have configured the dashboard to not need auth
await Promise.all(
response.apps.map(async (app) => {
if (typeof app.masterKey === 'function') {
app.masterKey = await ConfigKeyCache.get(app.appId, 'masterKey', app.masterKeyTtl, app.masterKey);
}
})
);

return res.json(response);
}
//We shouldn't get here. Fail closed.
Expand Down
22 changes: 22 additions & 0 deletions Parse-Dashboard/configKeyCache.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class KeyCache {
constructor() {
this.cache = {};
}

async get(appId, key, ttl, callback) {
key = `${appId}:${key}`;
const cached = this.cache[key];
if (cached && cached.expiry > Date.now()) {
return cached.value;
}

const value = await Promise.resolve(callback());
this.cache[key] = {
value,
expiry: Date.now() + ttl,
};
return value;
}
}

module.exports = new KeyCache();
1 change: 1 addition & 0 deletions Parse-Dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const startServer = require('./server');
const program = require('commander');
program.option('--appId [appId]', 'the app Id of the app you would like to manage.');
program.option('--masterKey [masterKey]', 'the master key of the app you would like to manage.');
program.option('--masterKeyTtl [masterKeyTtl]', 'the master key ttl of the app you would like to manage.');
program.option('--serverURL [serverURL]', 'the server url of the app you would like to manage.');
program.option('--graphQLServerURL [graphQLServerURL]', 'the GraphQL server url of the app you would like to manage.');
program.option('--dev', 'Enable development mode. This will disable authentication and allow non HTTPS connections. DO NOT ENABLE IN PRODUCTION SERVERS');
Expand Down
69 changes: 60 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
---

[![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-18,_20-green.svg?logo=node.js&style=flat)](https://nodejs.org/)
[![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases)

[![npm latest version](https://img.shields.io/npm/v/parse-dashboard/latest.svg)](https://www.npmjs.com/package/parse-dashboard)
[![npm beta version](https://img.shields.io/npm/v/parse-dashboard/beta.svg)](https://www.npmjs.com/package/parse-dashboard)
[![npm alpha version](https://img.shields.io/npm/v/parse-dashboard/alpha.svg)](https://www.npmjs.com/package/parse-dashboard)

[![Backers on Open Collective](https://opencollective.com/parse-server/backers/badge.svg)][open-collective-link]
Expand Down Expand Up @@ -71,6 +69,7 @@ Parse Dashboard is a standalone dashboard for managing your [Parse Server](https
- [Video Item](#video-item)
- [Audio Item](#audio-item)
- [Button Item](#button-item)
- [Panel Item](#panel-item)
- [Browse as User](#browse-as-user)
- [Change Pointer Key](#change-pointer-key)
- [Limitations](#limitations)
Expand Down Expand Up @@ -130,6 +129,11 @@ Parse Dashboard is continuously tested with the most recent releases of Node.js
| Parameter | Type | Optional | Default | Example | Description |
|----------------------------------------|---------------------|----------|---------|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `apps` | Array<Object> | no | - | `[{ ... }, { ... }]` | The apps that are configured for the dashboard. |
| `apps.appId` | String | yes | - | `"myAppId"` | The Application ID for your Parse Server instance. |
| `apps.masterKey` | String \| Function | yes | - | `"exampleMasterKey"`, `() => "exampleMasterKey"` | The master key for full access to Parse Server. It can be provided directly as a String or as a Function returning a String. |
| `apps.masterKeyTtl` | Number | no | - | `3600` | Time-to-live (TTL) for the master key in seconds. This defines how long the master key is cached before the `masterKey` function is re-triggered. |
| `apps.serverURL` | String | yes | - | `"http://localhost:1337/parse"` | The URL where your Parse Server is running. |
| `apps.appName` | String | no | - | `"MyApp"` | The display name of the app in the dashboard. |
| `infoPanel` | Array<Object> | yes | - | `[{ ... }, { ... }]` | The [info panel](#info-panel) configuration. |
| `infoPanel[*].title` | String | no | - | `User Details` | The panel title. |
| `infoPanel[*].classes` | Array<String> | no | - | `["_User"]` | The classes for which the info panel should be displayed. |
Expand Down Expand Up @@ -929,12 +933,13 @@ Example:

A text item that consists of a key and a value. The value can optionally be linked to a URL.

| Parameter | Value | Optional | Description |
|-----------|--------|----------|-----------------------------------------------------------------------------------|
| `type` | String | No | Must be `"keyValue"`. |
| `key` | String | No | The key text to display. |
| `value` | String | No | The value text to display. |
| `url` | String | Yes | The URL that will be opened in a new browser tab when clicking on the value text. |
| Parameter | Value | Default | Optional | Description |
|-----------------|---------|-------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | String | - | No | Must be `"keyValue"`. |
| `key` | String | - | No | The key text to display. |
| `value` | String | - | No | The value text to display. |
| `url` | String | `undefined` | Yes | The URL that will be opened in a new browser tab when clicking on the value text. It can be set to an absolute URL or a relative URL in which case the base URL is `<PROTOCOL>://<HOST>/<MOUNT_PATH>/`. |
| `isRelativeUrl` | Boolean | `false` | Yes | Set this to `true` when linking to another dashboard page, in which case the base URL for the relative URL will be `<PROTOCOL>://<HOST>/<MOUNT_PATH>/apps/<APP_NAME>/`. |

Examples:

Expand All @@ -951,7 +956,33 @@ Examples:
"type": "keyValue",
"key": "Last purchase ID",
"value": "123",
"url": "https://example.com/purchaseDetails?purchaseId=012345"
"url": "https://example.com/purchaseDetails?purchaseId=123"
}
```

```json
{
"type": "keyValue",
"key": "Purchase",
"value": "123",
"url": "browser/Purchase",
"isRelativeUrl": true
}
```

To navigate to a specific object using a relative URL, the query parameters must be URL encoded:

```js
const objectId = 'abc123';
const className = 'Purchase';
const query = [{ field: 'objectId', constraint: 'eq', compareTo: objectId }];
const url = `browser/Purchase?filters=${JSON.stringify(query)}`;
const item = {
type: 'keyValue',
key: 'Purchase',
value: objectId,
url,
isRelativeUrl: true
}
```

Expand Down Expand Up @@ -1082,6 +1113,26 @@ Example:
}
```

#### Panel Item

A sub-panel whose data is loaded on-demand by expanding the item.

| Parameter | Value | Optional | Description |
|---------------------|--------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | String | No | Must be `"infoPanel"`. |
| `title` | String | No | The title to display in the expandable headline. |
| `cloudCodeFunction` | String | No | The Cloud Code Function to call which receives the selected object in the data browser and returns the response to be displayed in the sub-panel. |

Example:

```json
{
"type": "panel",
"title": "Purchase History",
"cloudCodeFunction": "getUserPurchaseHistory"
}
```

## Browse as User

▶️ *Core > Browser > Browse*
Expand Down
Loading
Loading