Skip to content
This repository was archived by the owner on Jun 30, 2026. It is now read-only.

Add SSH wrapper for macOS - #13

Merged
sergiou87 merged 6 commits into
mainfrom
ssh-wrapper
Aug 16, 2021
Merged

sergiou87 merged 6 commits into
mainfrom
ssh-wrapper

Conversation

@sergiou87

@sergiou87 sergiou87 commented Aug 16, 2021 •

Copy link
Copy Markdown
Member

This PR adds the SSH wrapper needed on macOS for Desktop to intercept prompts from SSH via the askpass trampoline.

Since it's only required on macOS, I've tried to disable Windows builds… but that can't be easily done via the binding.gyp file. Instead I would need to do something to exclude the new ssh-wrapper target before running node-gyp rebuild. For now, I just made a dummy exe file on Windows that does nothing.

Something similar happened with the tests, since don't want them to run on Windows. I didn't see a way of excluding certain test suites in certain platforms, so I had to keep one test case that checks ssh-wrapper.exe exists and ignore the rest 😢  EDIT: and after having some issues with the ssh-wrapper tests on Linux, I disabled them there 😅

I'm not proud of this, and definitely open to suggestions!!

Comment thread .github/workflows/ci.yml
name: Install Windows arm64 node.lib

- name: Install and build
run: yarn

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was installing prebuilt binaries of the trampoline and wrapper 🤯

Comment thread test/ssh-wrapper.test.js
Comment on lines +14 to +19
// On Windows, the binary generated is just useless, so no point to test it.
// Also, this won't be used on Linux (for now at least), so don't bother to
// run the tests there.
if (process.platform !== 'darwin') {
return
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not proud of this 😆

Comment thread src/ssh-wrapper.c
Comment on lines +1 to +6
#ifdef WINDOWS

int main(int argc, char **argv) {
// Not needed on Windows, this will just create a dummy executable
return -1;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not proud of this 😆

@sergiou87
sergiou87 requested a review from tidy-dev August 16, 2021 10:36

@tidy-dev tidy-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ Makes sense to me.. and I don't have any suggestions for another approach for being os specific. :/

@sergiou87
sergiou87 merged commit 8b38cd5 into main Aug 16, 2021
@sergiou87
sergiou87 deleted the ssh-wrapper branch August 16, 2021 13:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants