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

Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
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
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
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
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement