ejpcmac

ejpcmac

Hex.pm mirror for isolated environments

Starting November, I will spend one year in Kerguelen Islands as the System Administrator of the scientific base. There, internet access is very low—understand: 100 kb/s for 40 to 100 persons, therefore reserved for professional activities. Provided this constraint, I am currently working on getting my whole development environment offline-ready. I’ve started reasearch about building a local binary cache for Nix and crates.io (the Rust equivalent for hex.pm). Now, I am here for the Elixir part.

I want to be able to start new Elixir projects there. To achieve this, I would like to setup an offline read-only hex.pm mirror. Here are my questions:

  1. How can I get a full copy of the hex.pm repository?
  2. What do I need to use it with Mix, so I can do mix deps.get and my dependencies are fetched from the local cache?
  3. Would it be possible to setup a local copy for the web interface too, so I could search and browse the packages? Otherwise, how to look for packages for a new use case?
  4. Same for Hexdocs, it would be neat to have it offline too.

These options would be interesting for other kind of isolated environments, like restricted networks in some companies for instance.

Marked As Solved

wojtekmach

wojtekmach

Hex Core Team

Yes, you can configure your mirror to fetch all packages. MiniRepo is pretty minimal, it doesn’t mirror docs or allow you to do search and similiar that you mentioned in the initial post. For docs, I’d write a small script that uses https://github.com/hexpm/hex_core to grab package versions and download and unpack relevant docs.

Also Liked

ejpcmac

ejpcmac

For posterity: one neat thing about how the repo is stored is it can be served statically. This way, I can use mini_repo on any server to keep a mirror in sync, replicating it to my laptop through ZFS’s send/recv commands—which will also allow me to send incremental updates through the postal services.

On my laptop side, the repo is served by a simple Apache httpd, which I also use to serve other mirrors. By setting HEX_MIRROR_URL in my global environment, this whole process becomes really transparent and I can work fully offline without any warning. That’s perfect :slight_smile:

OvermindDL1

OvermindDL1

By chance MiniRepo was just released, a mini version of hex. :slight_smile:

As for a duplicate of hex.pm, that sounds large, probably have to ask one of the platformatic people here, @josevalim is one, unsure who else?

You can generate docs from packages in hex too for note. :slight_smile:

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New

Other popular topics Top

William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement