coder / sshcode

Run VS Code on any server over SSH.
MIT License
5.74k stars 216 forks source link

How to pass custom flags to the code-server instance? #177

Closed gyzerok closed 3 years ago

gyzerok commented 4 years ago

Hello there!

First of all let me say that you are doing amazing job making this project and keeping it open-source. Thank you!

I was wondering how can I pass additional flags to the code-server instance which sshcode will start. For example, let's say I want to use --disable-telemetry flag.

My apologies if this is a dumb question, but it isn't obvious to me from sshcode --help.

Merith-TK commented 4 years ago

Wow, i didnt realize that this project didnt have that the related code for this is in sshcode.go:L147

adding a flag for this would be good, feel free to make a fork for this! I am going to look into it

gyzerok commented 4 years ago

@Merith-TK nice, thanks for pointing out the code line!

Mostly I was interested in being able to specify concrete port on the remote host on which I would like to run code-server. From the code it looks like that sshCode accepts remotePort as a parameter, but it's not made configurable in main.go.

I have almost 0 experience with Go, however I'll try to fork and fix my specific use cases for myself as you suggested. Would you like me to make a PR with that (possibly of low quality due to my lack of Go knowledge 😅 )?

Merith-TK commented 4 years ago

devs pardon my language in this

I didnt know shit about any programming lang other than shell scripting, (check out akg-git,) until i saw a feature i wanted, and dove headfirst and made the patch that allows this program to run on windows under msys2

My recomended setup for golang (because i use it, it may not be the best for you) is VScode, with the golang extension (offical MS extension)

But in theory, it looks like you can just add a variable in there in that line i posted, and have in the code earlier, check to see if you passed a flag, and set that car to the contents of that flag,

if you want, i am on Discord as Merith#5829 and Coder has a Discord, and golang has a semi-official discord server that is great for getting help in, (you will see me frequent it often)