Skip to content
Open
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
22 changes: 22 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Graph Explorer Change Log

## Release 2.5.2

This release adds automatic loading of backup configuration files on startup,
enabling infrastructure-as-code deployments and simplifying Docker-based setups.

### New Features

- **Auto-Load Backup Configuration**: Graph Explorer now automatically loads
`graph-explorer-config.json` backup file on startup when IndexedDB is empty,
similar to how `defaultConnection.json` is auto-loaded. This enables
infrastructure-as-code deployments and simplifies Docker-based setups. An
optional `GRAPH_EXP_FORCE_LOAD_BACKUP_CONFIG` environment variable allows
forcing the backup config to always load, overriding IndexedDB data.

### All Changes

- Add automatic loading of backup configuration file on startup by @jeremy-london
in https://github.com/aws/graph-explorer/pull/1453

**Full Changelog**:
https://github.com/aws/graph-explorer/compare/v2.5.1...v2.5.2

## Release 2.5.1

This release includes a fix for a regression that caused neighbor expansion in
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ defaults, and their descriptions.
minutes).
- `GRAPH_EXP_NODE_EXPANSION_LIMIT` - `None` - Controls the limit for node
counts and expansion queries.
- `GRAPH_EXP_FORCE_LOAD_BACKUP_CONFIG` - `false` - When set to `"true"`,
always loads the backup configuration file (`graph-explorer-config.json`) on
startup, overriding any existing IndexedDB data. Useful for Docker
deployments where you want the mounted config file to always take
precedence.
- Conditionally Required:
- Required if `USING_PROXY_SERVER=True`
- `GRAPH_CONNECTION_URL` - `None` - See
Expand Down
5 changes: 4 additions & 1 deletion additionaldocs/features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ out our [roadmap](../../ROADMAP.md) and participate in the discussions.
- **Save Configuration:** This action will export all the configuration data
within the Graph Explorer local database. This will not store any data from
the connected graph databases. However, the export may contain the shape of
the schema for your databases and the connection URL.
the schema for your databases and the connection URL. The exported file is
named `graph-explorer-config.json` and can be used for automatic loading on
startup (see
[Auto-Load Backup Configuration](../troubleshooting.md#auto-load-backup-configuration)).
- **Load Configuration:** This action will replace all the Graph Explorer
configuration data you currently have with the data in the provided
configuration file. This is a destructive act and can not be undone. It is
Expand Down
5 changes: 5 additions & 0 deletions additionaldocs/getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ Docker image. You can find the latest version of the image on
you should now see the Connections UI. See below description on Connections
UI to configure your first connection to Amazon Neptune.

<!-- prettier-ignore -->
> [!TIP]
>
> You can automatically load a backup configuration file (`graph-explorer-config.json`) on startup by mounting it as a volume. See [Auto-Load Backup Configuration](../troubleshooting.md#auto-load-backup-configuration) for details.

#### Gremlin Server Database

Gremlin Server is an easy way to get started with graph databases. This example
Expand Down
57 changes: 52 additions & 5 deletions additionaldocs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,68 @@ may receive 404 not found responses or get connection refused errors.
## Backup Graph Explorer Data

Inside of Graph Explorer there is an option to export all the configuration data
that Graph Explorer uses. This data is local to the users browser and does not
that Graph Explorer uses. This data is local to the user's browser and does not
exist on the server.

To gather the config data:

1. Launch Graph Explorer
2. Navigate to the connections screen
3. Press the Settings button in the navigation bar
4. Select the General page within settings
5. Press the Save Configuration button
3. Press the "Settings" button in the navigation bar
4. Select the "General" page within settings
5. Press the "Save Configuration" button
6. Choose where to save the exported file

This backup can be restored using the Load Configuration button in the same
This backup can be restored using the "Load Configuration" button in the same
settings page.

### Auto-Load Backup Configuration

Graph Explorer can automatically load a backup configuration file
(`graph-explorer-config.json`) on startup, similar to how
`defaultConnection.json` is auto-loaded. This is useful for Docker deployments
and infrastructure-as-code scenarios.

**How it works:**

- The backup config file (`graph-explorer-config.json`) should be placed in the
`CONFIGURATION_FOLDER_PATH` directory (same location as
`defaultConnection.json`)
- On startup, Graph Explorer checks if IndexedDB is empty
- If empty, it automatically fetches and restores the backup config file
- This ensures connections, styles, schemas, and other customizations are loaded
automatically

**Docker Setup:**

```yaml
services:
graph-explorer:
volumes:
- ./config/graph-explorer:/graph-explorer-config
environment:
- CONFIGURATION_FOLDER_PATH=/graph-explorer-config
```

**Force Load Option:**

By default, the backup config only loads when IndexedDB is empty (to prevent
overwriting existing user data). To always load the backup config file,
regardless of IndexedDB contents, set:

```yaml
environment:
- GRAPH_EXP_FORCE_LOAD_BACKUP_CONFIG=true
```

**Behavior:**

- `defaultConnection.json` → ✅ Auto-loads (connections only) - always works
- `graph-explorer-config.json` → ✅ Auto-loads (full config) when IndexedDB is
empty - default behavior
- `graph-explorer-config.json` → ✅ Always loads when
`GRAPH_EXP_FORCE_LOAD_BACKUP_CONFIG=true` - override behavior

## Gathering SageMaker Logs

The Graph Explorer proxy server outputs log statements to standard out. By
Expand Down
25 changes: 25 additions & 0 deletions packages/graph-explorer-proxy-server/src/node-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,31 @@ app.use(
),
);

// Serve the backup config file if it exists
const backupConfigPath = path.resolve(
defaultConnectionFolderPath,
"graph-explorer-config.json",
);
app.get("/graph-explorer-config.json", (_req, res) => {
// Check if file exists before attempting to send it
if (!fs.existsSync(backupConfigPath)) {
res.status(404).send("Backup config file not found");
return;
}
// Send file and handle any errors gracefully
res.sendFile(backupConfigPath, err => {
if (err) {
// File was deleted or became inaccessible after the exists check
if (!res.headersSent) {
res.status(404).send("Backup config file not found");
}
}
});
});
if (fs.existsSync(backupConfigPath)) {
proxyLogger.info("Serving backup config file from: %s", backupConfigPath);
}

// Host the Graph Explorer UI static files
const staticFilesVirtualPath = "/explorer";
const staticFilesPath = path.join(clientRoot, "dist");
Expand Down
Loading