Commit 5bafcbe
fix: create host directories before mounting to devcontainer (#442)
* fix: add automatic permission fixing to coder startup script
Add sudo chown command to fix workspace ownership before git operations.
This prevents 'insufficient permission' errors when running as vscode user
after switching from root user in existing workspaces.
* fix: comprehensive permission fixing for all bind-mounted directories
Expand permission fixing in startup script to cover:
- Workspace directory (/workspaces/SimpleAccounts-UAE)
- All config directories (.claude, .gemini, .config/gh, etc.)
- SSH directory with proper key permissions (700/600/644)
This ensures future workspaces will have correct permissions for all
bind-mounted host directories when running as vscode user.
* fix: create host directories and files before mounting to devcontainer
- Add null_resource provisioner to create host directories before container starts
- Create .claude.json and .gemini/config.json files on host if they don't exist
- Mount both .claude.json (file) and .claude/ (directory) for Claude CLI
- Mount .gemini/ directory containing config.json (simplified from separate file mount)
- Update startup script to fix permissions for both files and directories
- Add dependency on host_directories resource to ensure proper mount order
This ensures files exist on the Coder host before Docker mounts them,
preventing permission issues and enabling proper persistence of config
between container rebuilds.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Mohsin Hashmi <mhashmi@wiser.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 8741845 commit 5bafcbe
1 file changed
Lines changed: 85 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
48 | 115 | | |
49 | 116 | | |
50 | 117 | | |
| |||
162 | 229 | | |
163 | 230 | | |
164 | 231 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
171 | 238 | | |
172 | 239 | | |
173 | 240 | | |
| |||
342 | 409 | | |
343 | 410 | | |
344 | 411 | | |
345 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
346 | 420 | | |
347 | 421 | | |
348 | 422 | | |
349 | 423 | | |
350 | 424 | | |
| 425 | + | |
351 | 426 | | |
352 | 427 | | |
353 | 428 | | |
| |||
432 | 507 | | |
433 | 508 | | |
434 | 509 | | |
435 | | - | |
| 510 | + | |
436 | 511 | | |
437 | 512 | | |
438 | | - | |
| 513 | + | |
| 514 | + | |
439 | 515 | | |
440 | 516 | | |
441 | 517 | | |
| |||
0 commit comments