Running a local Hex repo with pass-thru?

1,020 views
Skip to first unread message

Deven Phillips

unread,
Aug 3, 2015, 9:15:06 AM8/3/15
to elixir-lang-talk
Hi all,

    We are starting to use Elixir more in our private cloud at work, but dependency management is a pain. Ideally, we would like to run an instance of Hex inside of our network for our private packages and have it act as a pass-thru for public packages. We have a similar setup for our Maven/pypi/npm repositories. Is this possible with Hex? Or is there a better option?

Thanks in advance!

Deven Phillips

Onorio Catenacci

unread,
Aug 3, 2015, 11:36:05 AM8/3/15
to elixir-lang-talk
I expect that Eric or someone with much deeper knowledge of Hex will reply but my naive guess would be that you need to modify this file:


in the Elixir source and then build your own local variation of mix.  Or perhaps you could pull your custom packages from Github instead?  I'd think that passing through to public Hex if it's not found locally would require a lot more work. Maybe you could figure out how to do that and then submit a PR?

--
Onorio

Jason M Barnes

unread,
Aug 3, 2015, 12:13:01 PM8/3/15
to elixir-l...@googlegroups.com
On Mon, Aug 3, 2015 at 11:36 AM, Onorio Catenacci <cate...@gmail.com> wrote:
I expect that Eric or someone with much deeper knowledge of Hex will reply but my naive guess would be that you need to modify this file:


in the Elixir source and then build your own local variation of mix.  Or perhaps you could pull your custom packages from Github instead?  I'd think that passing through to public Hex if it's not found locally would require a lot more work. Maybe you could figure out how to do that and then submit a PR?


Custom packages also don’t *have* to be on Github:  git: “http://path/to/file” works just as well.

Jason
 
--
Onorio
 

On Monday, August 3, 2015 at 9:15:06 AM UTC-4, Deven Phillips wrote:
Hi all,

    We are starting to use Elixir more in our private cloud at work, but dependency management is a pain. Ideally, we would like to run an instance of Hex inside of our network for our private packages and have it act as a pass-thru for public packages. We have a similar setup for our Maven/pypi/npm repositories. Is this possible with Hex? Or is there a better option?

Thanks in advance!

Deven Phillips

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/df1aa840-f03a-4dcf-a91e-1ec5894eda85%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Onorio Catenacci

unread,
Aug 4, 2015, 9:10:30 AM8/4/15
to Elixir Lang Talk
I didn't know that Jason.  Thanks for the tip!


Eric Meadows-Jönsson

unread,
Aug 5, 2015, 3:16:56 PM8/5/15
to elixir-l...@googlegroups.com
We support this in some ways today, but we are working on workflow improvements.

You can change the default repository Hex uses from hex.pm to something internal by changing the `HEX_CDN` environment variable, this wont pass-through or default back to hex.pm. I am currently working on multiple repository support so a project can use packages from an internal repository and hex.pm at the same time and internal packages can depend on packages from hex.pm. This features requires rebuilding large parts of the current application so it's a longer task and I work on it between my other open source work, so it's still quite a bit away. As always, contributions to Hex are very welcome to help off-load me :).

To run a Hex repository you can use the application we use for hex.pmhttps://github.com/hexpm/hex_web. This might be overkill for something internal and may require some changes (AFAIK it is only used by hex.pm so far). A Hex repository can also be ran by a simple HTTP server, you just need to serve files as specified under CDN here: https://github.com/hexpm/hex_web/blob/master/specifications/endpoints.md#cdn. To make this even easier in the future we will be adding an alternative, simpler, but less optimized registry format that can be easily built by some task you can run. We will also add the ability to build a package without publishing it to hex.pm.

As Jason said you can of course host your private dependencies on git.

We have also outlined the requirements for vendoring dependencies in this issue: https://github.com/hexpm/hex/issues/119. As it turned it just requires some small changes and it's a great task if someone wants to jump into the Hex codebase.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Eric Meadows-Jönsson
Reply all
Reply to author
Forward
0 new messages