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 GitHub - hexpm/hex_core: Reference implementation of Hex specifications. · GitHub 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

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
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
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41539 114
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

We're in Beta

About us Mission Statement