Skip to content

Implement custom remote script support for Linux remotes#132

Open
StarLederer wants to merge 1 commit into
jeanp413:masterfrom
StarLederer:custom-remote-scripts
Open

Implement custom remote script support for Linux remotes#132
StarLederer wants to merge 1 commit into
jeanp413:masterfrom
StarLederer:custom-remote-scripts

Conversation

@StarLederer

Copy link
Copy Markdown

This PR makes it so that server setup scans the remote for known remote installer locations before attempting to use built in scripts.

This allows users to:

@StarLederer

Copy link
Copy Markdown
Author

If this is welcome, we possibly need to document how to write custom scripts or make the default one work the same as custom

@jeanp413

jeanp413 commented Feb 1, 2024

Copy link
Copy Markdown
Owner

Thanks for the PR @StarLederer 🙏 , can we add a extension setting like remote.SSH.customServerInstallScriptPath and use that instead of harcoding it, also a new command like Customize Server Installation Script and then open a vscode document and initialize it with the default script content that the user can edit and save.

@StarLederer

StarLederer commented Feb 11, 2024

Copy link
Copy Markdown
Author

I figured using conventional paths would be best for users so they don't have to think how each remote is configured, just whether it explicitly supports open-remote-ssh or not. It is possibly a good idea allow users to override this per host so that their host providers are able to escape the conventional structure if they really need to but I imagine this being more the exception than the rule.

As per hard-coded paths vs configurable defaults, I see how in the future the MS extension might also adopt this and use different paths than us but I would add an option to change the default paths only when that happens. I think if users identify missing but expected paths, like something for windows hosts, it is better to add these paths to the extension to help users find the conventional way to organize this and use this extension seamlessly across many remotes. Let me know if you agree.

I really like your Customize Server Installation Script idea though, it will give users an example that they can start messing with right away and make it very easy to find where to put the config avoiding the need for extra documentation, but I have no idea how to implement this. VS Code extensions are far from my expertise. Perhaps that could be a separate PR that we collaborate on?

@daiyam

daiyam commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

@StarLederer Hello, I'm worried about the security implication of a script (outside the extension) to be automatically executed.
A reverse shell could be added into that script without the knowledge of the user or extension.

We should at least prompt the user controlled by a new setting of type enum: ['ask', 'off', 'on'].

@lex-ibm

lex-ibm commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

I was thinking of adding something similar, great to see that I'm not the only one thinking of something like this. My idea was to have some sort of install script template that substitutes some of the paths and values expected to be passed. Also, the ability to add pre-install and post-install scripts would be amazing.

@daiyam

daiyam commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

I agree some pre-install, install or post-install scripts would be useful but we need to correctly inform the users before executing them.
Maybe, I'm getting paranoid...

@lex-ibm

lex-ibm commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Oh! I think I did not go through the PR entirely. I was thinking on having those in the host side...

@daiyam

daiyam commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

I was thinking on having those in the host side...

Yes, it is.

@lex-ibm

lex-ibm commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

My approach would be a bit different. I would have these as options in the package.json, and leave it up to the user to specify if they want to run custom install scripts or not.

@daiyam

daiyam commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

My approach would be a bit different. I would have these as options in the package.json, and leave it up to the user to specify if they want to run custom install scripts or not.

Oh, I see. Executing pre-install and post-install scripts when opening the project. They should be in the .vscode/settings.json file.
That is for another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants