parse-dashboard 8.0.0 → 8.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -162,7 +162,13 @@ module.exports = (options) => {
|
|
|
162
162
|
if (allowInsecureHTTP || trustProxy || dev) {app.enable('trust proxy');}
|
|
163
163
|
|
|
164
164
|
config.data.trustProxy = trustProxy;
|
|
165
|
-
const dashboardOptions = {
|
|
165
|
+
const dashboardOptions = {
|
|
166
|
+
allowInsecureHTTP,
|
|
167
|
+
cookieSessionSecret,
|
|
168
|
+
dev,
|
|
169
|
+
cookieSessionMaxAge,
|
|
170
|
+
cookieSessionStore: config.data.cookieSessionStore
|
|
171
|
+
};
|
|
166
172
|
app.use(mountPath, parseDashboard(config.data, dashboardOptions));
|
|
167
173
|
let server;
|
|
168
174
|
if(!configSSLKey || !configSSLCert){
|
package/README.md
CHANGED
|
@@ -803,6 +803,55 @@ If you create a new user by running `parse-dashboard --createUser`, you will be
|
|
|
803
803
|
|
|
804
804
|
Parse Dashboard follows the industry standard and supports the common OTP algorithm `SHA-1` by default, to be compatible with most authenticator apps. If you have specific security requirements regarding TOTP characteristics (algorithm, digit length, time period) you can customize them by using the guided configuration mentioned above.
|
|
805
805
|
|
|
806
|
+
### Running Multiple Dashboard Replicas
|
|
807
|
+
|
|
808
|
+
When deploying Parse Dashboard with multiple replicas behind a load balancer, you need to use a shared session store to ensure that CSRF tokens and user sessions work correctly across all replicas. Without a shared session store, login attempts may fail with "CSRF token validation failed" errors when requests are distributed across different replicas.
|
|
809
|
+
|
|
810
|
+
#### Using a Custom Session Store
|
|
811
|
+
|
|
812
|
+
Parse Dashboard supports using any session store compatible with [express-session](https://github.com/expressjs/session). The `sessionStore` option must be configured programmatically when initializing the dashboard.
|
|
813
|
+
|
|
814
|
+
**Suggested Session Stores:**
|
|
815
|
+
|
|
816
|
+
- [connect-redis](https://www.npmjs.com/package/connect-redis) - Redis session store
|
|
817
|
+
- [connect-mongo](https://www.npmjs.com/package/connect-mongo) - MongoDB session store
|
|
818
|
+
- [connect-pg-simple](https://www.npmjs.com/package/connect-pg-simple) - PostgreSQL session store
|
|
819
|
+
- [memorystore](https://www.npmjs.com/package/memorystore) - Memory session store with TTL support
|
|
820
|
+
|
|
821
|
+
**Example using connect-redis:**
|
|
822
|
+
|
|
823
|
+
```js
|
|
824
|
+
const express = require('express');
|
|
825
|
+
const ParseDashboard = require('parse-dashboard');
|
|
826
|
+
const { createClient } = require('redis');
|
|
827
|
+
const RedisStore = require('connect-redis').default;
|
|
828
|
+
|
|
829
|
+
// Instantiate Redis client
|
|
830
|
+
const redisClient = createClient({ url: 'redis://localhost:6379' });
|
|
831
|
+
redisClient.connect();
|
|
832
|
+
|
|
833
|
+
// Instantiate Redis session store
|
|
834
|
+
const cookieSessionStore = new RedisStore({ client: redisClient });
|
|
835
|
+
|
|
836
|
+
// Configure dashboard with session store
|
|
837
|
+
const dashboard = new ParseDashboard({
|
|
838
|
+
apps: [...],
|
|
839
|
+
users: [...],
|
|
840
|
+
}, {
|
|
841
|
+
cookieSessionStore,
|
|
842
|
+
cookieSessionSecret: 'your-secret-key',
|
|
843
|
+
});
|
|
844
|
+
|
|
845
|
+
**Important Notes:**
|
|
846
|
+
|
|
847
|
+
- The `cookieSessionSecret` option must be set to the same value across all replicas to ensure session cookies work correctly.
|
|
848
|
+
- If `cookieSessionStore` is not provided, Parse Dashboard will use the default in-memory session store, which only works for single-instance deployments.
|
|
849
|
+
- For production deployments with multiple replicas, always configure a shared session store.
|
|
850
|
+
|
|
851
|
+
#### Alternative: Using Sticky Sessions
|
|
852
|
+
|
|
853
|
+
If you cannot use a shared session store, you can configure your load balancer to use sticky sessions (session affinity), which ensures that requests from the same user are always routed to the same replica. However, using a shared session store is the recommended approach as it provides better reliability and scalability.
|
|
854
|
+
|
|
806
855
|
### Separating App Access Based on User Identity
|
|
807
856
|
If you have configured your dashboard to manage multiple applications, you can restrict the management of apps based on user identity.
|
|
808
857
|
|
|
@@ -1329,7 +1378,7 @@ To reduce the time for info panel data to appear, data can be prefetched.
|
|
|
1329
1378
|
|
|
1330
1379
|
| Parameter | Type | Optional | Default | Example | Description |
|
|
1331
1380
|
|--------------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------|
|
|
1332
|
-
| `infoPanel[*].prefetchObjects` | Number | yes | `0` | `2` | Number of
|
|
1381
|
+
| `infoPanel[*].prefetchObjects` | Number | yes | `0` | `2` | Number of navigation steps to prefetch ahead when browsing sequential rows. For example, `2` means data for the next 2 navigation steps will be fetched in advance. When using multi-panel mode with batch navigation enabled, each navigation step corresponds to a full batch of panels, so the total number of prefetched objects will be `prefetchObjects × panelCount`. |
|
|
1333
1382
|
| `infoPanel[*].prefetchStale` | Number | yes | `0` | `10` | Duration in seconds after which prefetched data is discarded as stale. |
|
|
1334
1383
|
| `infoPanel[*].prefetchImage` | Boolean | yes | `true` | `false` | Whether to prefetch image content when prefetching objects. Only applies when `prefetchObjects` is enabled. |
|
|
1335
1384
|
| `infoPanel[*].prefetchVideo` | Boolean | yes | `true` | `false` | Whether to prefetch video content when prefetching objects. Only applies when `prefetchObjects` is enabled. |
|