https://github.com/artemeff/hex_mini
Self-hosted minimal hex.pm
https://github.com/artemeff/hex_mini
elixir elixir-lang hexpm package-management
Last synced: 2 months ago
JSON representation
Self-hosted minimal hex.pm
- Host: GitHub
- URL: https://github.com/artemeff/hex_mini
- Owner: artemeff
- Created: 2018-12-25T05:58:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-13T16:21:43.000Z (over 7 years ago)
- Last Synced: 2025-04-05T03:31:53.331Z (about 1 year ago)
- Topics: elixir, elixir-lang, hexpm, package-management
- Language: Elixir
- Homepage: https://github.com/artemeff/hex_mini
- Size: 54.7 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HexMini — self-hosted minimal hex.pm
* [Installation](#Installation)
* [Usage](#Usage)
* [Configuration](#Configuration)
* [Roadmap](https://github.com/artemeff/hex_mini/projects)
* [Contributing](#Contributing)
---
## Installation
### Generate Keypair
```bash
$ openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048
$ openssl rsa -pubout -in private_key.pem -out public_key.pem
```
### Start HexMini using Docker Compose
Copy [`docker-compose.yml`](/docker-compose.yml) from this repo, open, configure with your keys and credentials, then run:
```bash
$ docker-compose up -d
```
---
## Usage
### Register private repo on your machine
```bash
$ curl http:///public_key -so ~/.hex/.pem
$ mix hex.repo add http:// --public-key ~/.hex/.pem --auth-key
```
### Use it to fetch packages
```elixir
defp deps do
[
{:package, "~> 1.0", repo: ""},
]
end
```
### Use it to publish packages
```bash
$ HEX_API_URL=http:// HEX_API_KEY= mix hex.publish package
```
---
## Configuration
You can configure HexMini release with theese env variables:
```bash
HM_PUBLIC_KEY # public key contents or path to file
HM_PRIVATE_KEY # private key contents or path to file
HM_DATA_PATH # data path, default to: /var/lib/hex_mini
HM_CREDENTIALS_FILE # path to credentials file
```
### HM_CREDENTIALS_FILE
Credentials file should follow this format:
```
:
```
Like:
```
john_doe@local.dev:auth_token1
john_doe:auth_token2
```
---
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request