Repository navigation
fix(gateway): keep embedded gateway data in the server workspace - #6064
Open
ZaynJarvis wants to merge 1 commit into
Open
ZaynJarvis wants to merge 1 commit into
ZaynJarvis wants to merge 1 commit into
Conversation
The embedded gateway stored its databases in ~/.openviking/gateway, outside
storage.workspace. A container that mounts its volume only on the workspace
(Railway with ov.conf on /app/mnt, for example) lost every upstream, profile
and gateway key on each redeploy, while OpenViking's own data survived.
Without an explicit gateway.storage_path (ov.conf or
OPENVIKING_GATEWAY_STORAGE_PATH), the embedded gateway now uses
{storage.workspace}/gateway. A server whose gateway already wrote to
~/.openviking/gateway keeps using that directory and logs a warning, so an
upgrade never hides existing data. Standalone gateways are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The embedded gateway (#5960) stores
management.sqlite3andkernel.sqlite3ingateway.storage_path, which defaults to~/.openviking/gateway. That is outsidestorage.workspace. When a container mounts its persistent volume on the workspace but not on$HOME, every redeploy loses all gateway upstreams, context profiles and gateway keys, while OpenViking's own data survives.Seen on a Railway deployment:
OPENVIKING_CONFIG_FILE=/app/mnt/ov.conf,storage.workspace=/app/mnt/data, volume on/app/mnt/,HOME=/app. The gateway wrote to/app/.openviking/gateway(container filesystem), and an Ark upstream disappeared after the next deploy. Studio's "Enable gateway" flow writes only{"enabled": true}, so it hits this default.Fix
create_embedded_gatewaynow resolves the storage directory:gateway.storage_path(ov.conf orOPENVIKING_GATEWAY_STORAGE_PATH) always wins.~/.openviking/gatewayalready holds gateway databases, keep using it and log a warning, so upgrading never hides existing data (the stock Docker layout,HOME=/appwith the volume on/app/.openviking, keeps working as before).{storage.workspace}/gateway.Standalone gateways are unchanged. The zh/en operations guides describe the new default.
Tests
test_embedded_gateway_stores_data_in_the_server_workspace,test_embedded_gateway_keeps_data_already_in_the_home_directory,test_explicit_gateway_storage_path_wins(ov.conf value and environment variable).tests/server/test_gateway_embedded.py: 8 passed.tests/gateway: no gateway code changed.🤖 Generated with Claude Code