Skip to content

Add a configuration option to preserve shared storage permissions #252

Description

@Cyantix

Short description

Please add an option in magic-context.jsonc to disable automatic permission enforcement.

What problem does this solve?

The current behavior prevents intentional multi-user Unix deployments where several trusted users in the same group share one Magic Context database.

Our environment manages the storage permissions externally:

  • Storage directory: 2770
  • Database and sidecar files: 0660
  • All intended users belong to the same Unix group

When Magic Context starts, it changes these permissions back to 0700/0600. Other group members can then no longer access the shared database.

A system job later restores the group permissions, but this creates a race condition where another OpenCode instance may fail to start before the permissions are repaired.

Proposed solution

Add an opt-out setting such as:

{
  "storage": {
    "enforce_private_permissions": false
  }
}

The exact setting name is flexible.

Expected behavior:

  • The default remains enabled, preserving the current secure 0700/0600 behavior.
  • When disabled, Magic Context does not run chmod on the storage directory, database files, WAL/SHM sidecars, or model cache.
  • Existing Unix permissions and ACLs remain unchanged.
  • Missing directories and files may still be created normally.
  • Magic Context may log a warning that storage permissions are managed externally.

Alternatives considered

No response

Area

OpenCode plugin

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or capability request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions