Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds setup scripts #430

Merged
merged 3 commits into from
Dec 18, 2023
Merged

Conversation

waldekmastykarz
Copy link
Collaborator

@waldekmastykarz waldekmastykarz commented Dec 15, 2023

Adds setup scripts for bash (macOS and Linux) and PowerShell (Windows, macOS and Linux)

To test, run:

curl -sL https://raw.githubusercontent.com/waldekmastykarz/dev-proxy/setup-script/scripts/setup.sh | bash

or

(invoke-webrequest https://raw.githubusercontent.com/waldekmastykarz/dev-proxy/setup-script/scripts/setup.ps1).Content | Invoke-Expression

@waldekmastykarz waldekmastykarz requested a review from a team as a code owner December 15, 2023 16:00
Copy link
Contributor

@garrytrinder garrytrinder left a comment

Choose a reason for hiding this comment

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

I tested the PS1 setup script, but dot sourcing my profile does not enable my to run proxy from any folder.

image

image

I can run proxy fine from the installation directory however.

I also noticed that we automatically change directory for the user to the devproxy directory, I wonder if we should do that and instead keep them in their current directory and provide the location to the devproxy installation files in the output.

Tested on Windows 11 Insider Preview and PowerShell 7.4.0

Copy link
Contributor

@garrytrinder garrytrinder left a comment

Choose a reason for hiding this comment

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

Tested the bash script, that works well.

As it's possible for mac users to use either the bash or PS1 script, we should consider outputting the below instructions to update the network adaptor, or provide a short link to a page in docs with these instructions documented.

Configure your network device.
Open Network settings.
Select the device to configure and select the Advanced... button.
Go to the Proxies tab.
Check Secure Web Proxy (HTTPS) in the list of configurable proxies.
Enter 127.0.0.1:8000 in the Secure Web Proxy Server field.
Select OK and then Apply to confirm the changes.

scripts/setup.ps1 Outdated Show resolved Hide resolved
@waldekmastykarz
Copy link
Collaborator Author

Tested the bash script, that works well.

As it's possible for mac users to use either the bash or PS1 script, we should consider outputting the below instructions to update the network adaptor, or provide a short link to a page in docs with these instructions documented.

Configure your network device.
Open Network settings.
Select the device to configure and select the Advanced... button.
Go to the Proxies tab.
Check Secure Web Proxy (HTTPS) in the list of configurable proxies.
Enter 127.0.0.1:8000 in the Secure Web Proxy Server field.
Select OK and then Apply to confirm the changes.

When we merge #429, these manual steps would be unnecessary though

Copy link
Contributor

@garrytrinder garrytrinder left a comment

Choose a reason for hiding this comment

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

The scripts are working fine, but I think we should reconsider some of the locations used and behaviours. These are all non-blocking comments.

  • Rather than downloading the ZIP file to the current directory, we should consider using the users local temp directory in which to download the ZIP file to.
  • Rather than creating the devproxy folder in the current directory, we should consider creating the devproxy folder in the users home directory as a default location.
  • Rather than changing into the directory to unzip the file, we should consider using a full path with the Expand-Archive cmdlet, which means that we don't have to change the directory on the users behalf. The Windows script changes the user directory, whereas the bash script doesn't.
  • We should consider outputting the full path the devproxy folder so that users know what this script has just done on their behalf. It's not obvious where files have been installed to from the current console output.

scripts/setup.ps1 Show resolved Hide resolved
@garrytrinder garrytrinder merged commit e141d5c into microsoft:main Dec 18, 2023
4 checks passed
@waldekmastykarz waldekmastykarz deleted the setup-script branch December 18, 2023 14:21
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.

2 participants