fix: Start SFTP sessions in user home (working directory)#4420
fix: Start SFTP sessions in user home (working directory)#4420mafredri wants to merge 3 commits into
Conversation
This is a simple fix for #3620 by changing the working directory of `coder agent` at runtime. Since the agent doesn't write files to it's working directory, I can't think of any downsides to this method. It does not, however, exclude that we rewrite the SFTP implementation to use the modernized `RequestServer` sometime in the future. Opted to place this in agent init vs `cli/agent` because of portability of fix, tests don't usually use `cli/agent`. Fixes #3620
Yeah, the alternative is discussed in #3620. But like Kyle mentions it's a quite involved. This would allow us to fix it immediately whereas if we go the alternative approach not sure when we'd get around to it. Are there any relative paths used by the agent? I for one can't find any. The only file we write (to my knowledge) is a log file and that one is opened earlier and uses an absolute path. |
|
@deansheather thinking about this some more, I failed to consider the effect this will have on tests. Even if nothing breaks today, there's bound to be some breakage (e.g. looking up Because of that, I would consider:
|
|
We could also contribute it upstream |
This commit switches to our fork of `pkg/sftp` which includes a Server option for changing the current working directory. Attempt to upstream: pkg/sftp#528 Supercedes and closes #4420 Fixes #3620
This commit switches to our fork of `pkg/sftp` which includes a Server option for changing the current working directory. Attempt to upstream: pkg/sftp#528 Supercedes and closes #4420 Fixes #3620
* fix: Start SFTP sessions in user home (working directory) This commit switches to our fork of `pkg/sftp` which includes a Server option for changing the current working directory. Attempt to upstream: pkg/sftp#528 Supercedes and closes #4420 Fixes #3620 * Update fork
This is a simple fix for #3620 by changing the working directory of
coder agentat runtime.Since the agent doesn't write files to it's working directory, I can't
think of any downsides to this method. It does not, however, exclude
that we rewrite the SFTP implementation to use the modernized
RequestServersometime in the future.Opted to place this in agent init vs
cli/agentbecause of portabilityof fix, tests don't usually use
cli/agent.Fixes #3620