diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-21 20:51:35 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-21 20:51:35 +0000 |
| commit | 30bb8b45ea515c40da4d46ee12a20f2c7ae75e62 (patch) | |
| tree | 99939cdd365fd021ca87d1ae9e9a987ab69cb0f2 /internal | |
| parent | b547a2f13a8416c09937f18afdfcfd8e80102f7c (diff) | |
fix: use configured claude_config_dir for container credentials
The server runs as www-data whose HOME is /var/www — deriving
credentials from $HOME/.claude always produced an empty path.
Now reads from ClaudeConfigDir (default: /workspace/claudomator/credentials/claude),
which sync-credentials keeps populated with fresh OAuth tokens.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/cli/serve.go | 4 | ||||
| -rw-r--r-- | internal/config/config.go | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/internal/cli/serve.go b/internal/cli/serve.go index 98e7524..1d0de21 100644 --- a/internal/cli/serve.go +++ b/internal/cli/serve.go @@ -75,8 +75,8 @@ func serve(addr string) error { apiURL = "http://" + addr } - // Resolve the claude config dir from HOME so the container can mount credentials. - claudeConfigDir := filepath.Join(os.Getenv("HOME"), ".claude") + // Use configured credentials dir; sync-credentials keeps this populated. + claudeConfigDir := cfg.ClaudeConfigDir runners := map[string]executor.Runner{ // ContainerRunner: binaries are resolved via PATH inside the container image, diff --git a/internal/config/config.go b/internal/config/config.go index fa76b1b..428712f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -35,6 +35,7 @@ type Config struct { VAPIDPublicKey string `toml:"vapid_public_key"` VAPIDPrivateKey string `toml:"vapid_private_key"` VAPIDEmail string `toml:"vapid_email"` + ClaudeConfigDir string `toml:"claude_config_dir"` } func Default() (*Config, error) { @@ -60,6 +61,7 @@ func Default() (*Config, error) { DefaultTimeout: "15m", ServerAddr: ":8484", WorkspaceRoot: "/workspace", + ClaudeConfigDir: "/workspace/claudomator/credentials/claude", }, nil } |
