Skip to content

fix: allow setting the data directroy for non docker installs#2931

Open
kmendell wants to merge 1 commit into
mainfrom
fix/identity-standalone
Open

fix: allow setting the data directroy for non docker installs#2931
kmendell wants to merge 1 commit into
mainfrom
fix/identity-standalone

Conversation

@kmendell

@kmendell kmendell commented Jun 13, 2026

Copy link
Copy Markdown
Member

Checklist

  • This PR is not opened from my fork’s main branch

What This PR Implements

Fixes: #2883

Changes Made

Testing Done

AI Tool Used (if applicable)

Additional Context

Disclaimer Greptiles Reviews use AI, make sure to check over its work.

To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike

To have Greptile Re-Review the changes, mention greptileai.

Greptile Summary

This PR fixes runtime identity behavior for non-Docker (bare-metal or standalone) installs by introducing container detection logic. Previously, the app always defaulted to a non-root UID/GID switch and mountpoint preparation, which was only meaningful inside a container. Now it checks for container signals (ARCANE_IN_CONTAINER env var, container env var, /.dockerenv, /run/.containerenv) before enabling that behavior.

  • runningInContainerInternal is added to detect container environments; all three Dockerfiles are updated to set ARCANE_IN_CONTAINER=true so existing container builds keep their current behavior.
  • When running outside a container without explicit PUID/PGID, runtime identity is disabled and only ensureSQLiteFilesExistInternal is called — ensuring the database file is created without attempting any UID switching or mountpoint chowning.
  • Test coverage is comprehensive: all new branches, the new container-detection function, and the previously missing partial-config/non-container warning path are all exercised.

Confidence Score: 5/5

Safe to merge — the container detection is additive and well-guarded by explicit env vars in every Dockerfile, so existing container deployments are unaffected.

The logic is straightforward: container installs opt-in via ARCANE_IN_CONTAINER=true (set in all three Dockerfiles) and continue working exactly as before, while non-container installs now correctly skip UID switching and mountpoint preparation. The new runningInContainerInternal function is fully unit-tested across all four detection paths, and the !req.Enabled branch correctly falls through to ensureSQLiteFilesExistInternal so database initialization still happens on bare-metal installs.

No files require special attention.

Reviews (2): Last reviewed commit: "fix: allow setting the data directroy fo..." | Re-trigger Greptile

@kmendell kmendell marked this pull request as ready for review June 13, 2026 01:36
@kmendell kmendell requested a review from a team June 13, 2026 01:36

kmendell commented Jun 13, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment thread backend/pkg/libarcane/startup/runtime_identity_test.go
@getarcaneappbot

getarcaneappbot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Container images for this PR have been built successfully!

  • Manager: ghcr.io/getarcaneapp/manager:pr-2931
  • Agent: ghcr.io/getarcaneapp/agent:pr-2931

Built from commit 89cf4d1

@kmendell kmendell force-pushed the fix/identity-standalone branch from 5b56cf1 to 89cf4d1 Compare June 13, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞 Bug: Arcane Agent 2.0/2.0.1 Single Binary Operation fails on read-only root filesystem: runtime_identity hardcodes /app

2 participants