Search Unity

Question How to set proxy server for auto-update?

Discussion in 'Unity Accelerator' started by Kichang-Kim, Jun 11, 2020.

  1. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,011
    Hi. I installed accelerator to Linux and its machine has private IP and must be connected to public network by using proxy server.

    Is there any method for settings proxy server for accelerator's auto-update?
     
  2. bradunity

    bradunity

    Joined:
    Nov 12, 2013
    Posts:
    195
    Most proxies I'm familiar with will automatically reconnect if they lose connection with the upstream host (the Accelerator, in your case, when it restarts). You'd likely want to refer to the proxy's own documentation for how to configure that. Often it involves setting a check of some kind, which is one reason the Accelerator provides its own health endpoint ([AcceleratorIP]:[AcceleratorPort]/api/agent-health).

    One other thing to take note: it is not recommended by Unity that you allow unprotected connections to an Accelerator that transit the public Internet as the protocol used between the Unity Editor and the Accelerator is not encrypted.
     
    Kichang-Kim likes this.
  3. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,011
    @bradunity Thanks for reply. So you mean that Unity Accelerator does not have its own proxy setting and I should set system-wide proxy setting for it, right? if it is true, I'll turn off auto-update for security reason.
     
  4. bradunity

    bradunity

    Joined:
    Nov 12, 2013
    Posts:
    195
    Hmm. I'm not sure what you mean by "its own proxy setting". Can you give me an example of another product you've used that has need of a "proxy setting"?
     
  5. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,011
    My server can't download Unity Accelerator's binary without proxy. So I used like this:
    wget -e https_proxy=MY_PROXY_URL UNITY_ACCELERATOR_DOWNLOAD_URL

    Also wget has its own proxy settings via /etc/wgetrc instead of commandline parameters.

    So I expected that Unity Accelerator's settings has "https_proxy" for downloading binary for auto-updating.

    Other many linux products has similar configuration property for this.
     
    Last edited: Jun 12, 2020
  6. bradunity

    bradunity

    Joined:
    Nov 12, 2013
    Posts:
    195
    I see what you're after. No, we don't support outbound HTTP proxies, but I've opened an internal ticket to address this ([COL-1663]).
     
    Kichang-Kim likes this.
  7. bradunity

    bradunity

    Joined:
    Nov 12, 2013
    Posts:
    195
    Kichang-Kim likes this.
  8. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,011
    I modified /etc/init.d/unity-accelerator for setting environment variables for service, but when I re-install Unity Accelerator, it reverted /etc/init.d/unity-accelerator every time. (I don't know auto-upgrade will makes same effect)

    General unix (linux) init.d services can't see system's environment variables except when it is set on its init.d scripts. So I want to know how to safely set HTTP proxy settings for accelerator service.

    I think that more good place for this settings is unity-accelerator.cfg and environment variables should only be used when this settings is not found in cfg file.
     
  9. gregoryh_unity

    gregoryh_unity

    Unity Technologies

    Joined:
    Oct 1, 2018
    Posts:
    50
    Ah, thank you for your feedback on this. The environment variables were the "standard" way to set up proxy servers, so we added that capability. We'll add a change request to get it into the config as well and just fallback to the env if empty/missing.

    Until then, altering the init.d script is fine and it will NOT be changed by auto-updating. The way auto-update works is that a parent unity-accelerator process, which is the version installed with the installer, will launch a child unity-accelerator process. The child process is just an updated unity-accelerator executable stored in the persist directory, alongside the unity-accelerator.cfg file for example. So, when an auto-upgrade is activated, it will just download a new unity-accelerator executable that the parent process will relaunch during the maintenance window.

    That was a long way of stating that the only thing that will update the /etc/init.d script is the installer. :)
     
    Kichang-Kim likes this.
  10. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,011
    I confirmed that modifying /etc/init.d for settings system environment variables works without any problem. Thanks.
     
  11. gregoryh_unity

    gregoryh_unity

    Unity Technologies

    Joined:
    Oct 1, 2018
    Posts:
    50
    Hi! I'm so glad you posted that reply because somehow we completely forgot to notify everyone of one of our minor releases that improved this a bit, per your earlier request.

    As of version v1.0.524+g96c5e18 you can use HTTPProxy and HTTPSProxy in your unity-accelerator.cfg file in place of the environment variables. See "unity-accelerator config help HTTPProxy" or HTTPSProxy:

    HTTPProxy string Equivalent of the HTTP_PROXY environment variable, used to direct all outgoing HTTP traffic through an HTTP proxy server. If set, this will overwrite any HTTP_PROXY environment variable.

    HTTPSProxy string Equivalent of the HTTPS_PROXY environment variable, used to direct all outgoing HTTPS traffic through an HTTPS proxy server. If set, this will overwrite any HTTPS_PROXY environment variable.
     
    Kichang-Kim likes this.