Skip to content
This repository has been archived by the owner on Sep 4, 2018. It is now read-only.

Add proxy support and "Force HTTPS for GitHub" setting #272

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

gmdfalk
Copy link

@gmdfalk gmdfalk commented May 10, 2015

I use XCode with Alcatraz at work. My work environment requires a proxy for HTTP(s) connections.
Without a proxy, I cannot install plugins with Alcatraz.

This change fixes that by adding a new Alcatraz preference "Set HTTP Proxy". The value will be saved as a NSUserDefault and set as environment variable for both http_proxy and HTTPS_PROXY on shell subprocesses within Alcatraz (i.e. currently /usr/bin/git and (negligable) /usr/bin/xcodebuild).

The input for the preference can be any valid proxy host with an optional port, e.g. proxy.mydomain.com:9999.

This pull request also adds a second new Alcatraz preference "Force HTTPS for GitHub" to adress issue #214, although I have yet to see a plugin that uses the git protocol for the clone command. I've tried around 10 and they were all HTTPS.

screen shot 2015-05-10 at 21 18 44

Those preferences together with the packageRepo NSUserDefaults are now handled in a new utility class ATZConfig.

I'm sorry about the messy commits, I forgot to turn off auto-formatting.

Regards

@jurre
Copy link
Collaborator

jurre commented May 19, 2015

Thanks @mikar, the PR is quite big so we'll need to find some time to review/test it, apologies for the slow response.

Max Demian and others added 14 commits May 20, 2015 12:49
* 'master' of https://github.com/mikar/Alcatraz:
  Add 6.3.2 compatibility UUID
  Remove Keybind for newly added proxy options
  Restore connection to forceHttpsForGitHub outlet
  Slight cleanup/refactoring
  Correctly restore NSMenuItem state for Force HTTPS option
  Don't force https for github by default
  GUI Update: Add proxy localization title and enable state for Preference Menu Items
  Use Environment variables instead of git config to set proxy
  Add settings for HTTP proxy and forced HTTPS instead of GIT for github
* upstream/master:
  update changelog
  updated install script for version 1.1.6
  bump version to 1.1.6
  seems like aligning is hard
  Add Xcode 6.4 support
  Fix typo s/proggress/progress/
  Update install.sh
  Added Xcode 7 UUID
  Smooths ATZFillableButton's text color change
  Fixes package thumnails mixups on cell reusal and started sharing the same image cache for both thumbnails and screenshots.
  updated install script for version 1.1.5
  bump version to 1.1.5
  update changelog
  extract string constants
  clean the build directory when executing xcodebuild for issue alcatraz#250
@jeeftor
Copy link

jeeftor commented Apr 20, 2016

This would be great if it works!

@hefgi
Copy link

hefgi commented May 19, 2016

Any updates on this ?

@guillaumealgis
Copy link
Member

I haven't looked at the code yet, but my first thoughts on the proxy thing are that if possible we should use the proxy settings defined at the OS level (in System Preferences). I don't remember having ever used an app where you could set custom proxy settings instead of relying on the system settings.
But then I don't use proxies that often, so I might be mistaken.

@gmdfalk
Copy link
Author

gmdfalk commented May 19, 2016

@guillaume-algis
I have had to specify the proxy deliberately for many applications, despite setting the appropriate environment variables.
Examples: gpg (when fetching from a keyserver), maven (in settings.xml), IntelliJ, Eclipse, pretty much all Browsers, ...
It can be a drag.

Most command-line interfaces tend to work fine since they appropriately use the environment of the terminal, which can be adjusted on-the-fly.
But once a GUI application like XCode has inherited the environment from its parent process those it can't be changed as easily. The GUI has to explicitly expose the environment variables, usually via a Settings menu.

I think there are a lot of benefits to having an interface like this one (IntelliJ IDEA):
ScreenShot

However, I haven't had access to an OS X system in almost a year and probably won't for another 3-6 months. I'd be happy to look into this issue again in a couple of months to solve this problem more appropriately via an Interface like above. This pull request was more of a quick fix, really.

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.

None yet

5 participants