# Elm Alternative Package (Mirror) Live

**URL:** <https://discourse.elm-lang.org/t/elm-alternative-package-mirror-live/8131>\
**Category:** Show and Tell\
**Created:** [February 3, 2022, 12:17pm UTC](https://discourse.elm-lang.org/t/elm-alternative-package-mirror-live/8131 "2022-02-03T12:17:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rupert](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/rupert/32/1775_2.png) [@rupert](https://discourse.elm-lang.org/u/rupert)\
**Post date:** [February 3, 2022, 12:17pm UTC](https://discourse.elm-lang.org/t/elm-alternative-package-mirror-live/8131/1 "2022-02-03T12:17:11Z")

</div>

As part of my work on an alternative package manager for Elm, I have updated its package index.

You should be able to run a build through it by doing the following:

```auto
> mv ~/.elm ~/.elm-old
> mitmdump --ssl-insecure -M '|https://package.elm-lang.org/|https://package.eco-elm.org/v1/'
> https_proxy=http://127.0.0.1:8080 elm make src/Main.elm

```

There is also a step needed to whitelist the mitmdump certificate authority on your local box to allow it to proxy an https endpoint - you can find instructions on how to do that here [https://docs.mitmproxy.org/stable/concepts-certificates/](https://docs.mitmproxy.org/stable/concepts-certificates/). This is not something you should do without considering the security implications - I am ok doing it on my dev box, but not on CI through to production.

Moving your current ELM\_HOME folder `~/.elm` out of the way is recommended (or set a different value for ELM\_HOME), since the .zip files on my package server are different again to the ones GitHub serves. They have been stripped of everything except `src/**/*.elm` + `README.md` + `LICENSE` + `elm.json`. That is why I put (Mirror) in brackets, because it is not an exact mirror.

Currently running on a minimal AWS infrastructure, so it is not very responsive, so don’t hit it too hard.

I would be interested in hearing if anyone else is able to get it to work? or what errors you encounter when trying.

Removing the need to use `mitmdump` would require hacking the Elm compiler, since it hard codes [https://package.elm-lang.org/](https://package.elm-lang.org/). I will try and publish a hacked compiler soon (with the `publish` CLI option disabled), to make reaching this package mirror simpler.

---

<div class="post-metadata">

**Author:** ![lenards](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/lenards/32/820_2.png) [@lenards](https://discourse.elm-lang.org/u/lenards)\
**Post date:** [February 3, 2022, 1:57pm UTC](https://discourse.elm-lang.org/t/elm-alternative-package-mirror-live/8131/2 "2022-02-03T13:57:26Z")

</div>

Thanks for posting this @rupert 🙇‍♂️

---

<div class="post-metadata">

**Author:** ![turboMaCk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/turbomack/32/355_2.png) [@turboMaCk](https://discourse.elm-lang.org/u/turboMaCk)\
**Post date:** [February 3, 2022, 3:56pm UTC](https://discourse.elm-lang.org/t/elm-alternative-package-mirror-live/8131/3 "2022-02-03T15:56:52Z")

</div>

Thanks @rupert

I’m really glad to see this type of solution.

I wonder if your setup also supports routing from `package.elm-lang.org` so it could work even without mitm with something like custom DNS or simple entry in `/etc/hosts` file? I think that might seem to be slightly more user friendly for some users.

UPDATE: actually thinking about this more I think it might not be doable unless you would also have a cert for the domain (because of https) which you can’t have for obvious reasons.

---

<div class="post-metadata">

**Author:** ![rupert](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/rupert/32/1775_2.png) [@rupert](https://discourse.elm-lang.org/u/rupert)\
**Post date:** [February 3, 2022, 4:19pm UTC](https://discourse.elm-lang.org/t/elm-alternative-package-mirror-live/8131/4 "2022-02-03T16:19:25Z")

</div>

> [@turboMaCk](#):
>
> I wonder if your setup also supports routing from `package.elm-lang.org` so it could work even without mitm with something like custom DNS or simple entry in `/etc/hosts` file? I think that might seem to be slightly more user friendly for some users.

Not sure either of those would work. `/etc/hosts` because the elm compiler already has `package.elm-lang.org` hard coded. And DNS because its https and the compiler is checking the certificate is correct.

It has always been the plan to do a modified compiler for this project.

---

<div class="post-metadata">

**Author:** ![turboMaCk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/turbomack/32/355_2.png) [@turboMaCk](https://discourse.elm-lang.org/u/turboMaCk)\
**Post date:** [February 3, 2022, 4:24pm UTC](https://discourse.elm-lang.org/t/elm-alternative-package-mirror-live/8131/5 "2022-02-03T16:24:59Z")

</div>

@rupert elm hardcoding domain would not be a problem. That domain would just got resolved to your IP. But then the certificate for https would be a problem because you can’t have valid one for that url. There would be way around that by installing certs but at that point main complications would be still with installing certs probably making simplifications insignificant.

Anyway I’m happy to say I made it work with mitmproxy as described relatively easily.

---

<div class="post-metadata">

**Author:** ![perty](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/perty/32/4459_2.png) [@perty](https://discourse.elm-lang.org/u/perty)\
**Post date:** [February 5, 2022, 7:15am UTC](https://discourse.elm-lang.org/t/elm-alternative-package-mirror-live/8131/6 "2022-02-05T07:15:47Z")

</div>

This is interesting if this means that we could have in-house packages.

---

<div class="post-metadata">

**Author:** ![rupert](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/rupert/32/1775_2.png) [@rupert](https://discourse.elm-lang.org/u/rupert)\
**Post date:** [February 5, 2022, 12:34pm UTC](https://discourse.elm-lang.org/t/elm-alternative-package-mirror-live/8131/7 "2022-02-05T12:34:55Z")

</div>

That is the main reason for starting this project, as having in-house packages that are managed with semantic versioning is something that I would really like to make possible.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [February 15, 2022, 12:35pm UTC](https://discourse.elm-lang.org/t/elm-alternative-package-mirror-live/8131/8 "2022-02-15T12:35:21Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
