Giter Site home page Giter Site logo

hyper-proxy's Introduction

hyper-proxy

A automated reverse proxy and load balancer for Hyper.

Getting started

Create a docker-compose.yml:

version: '2'
services:
  proxy:
    image: jgillich/hyper-proxy
    container_name: proxy
    ports:
      - "80:80"
      - "443:443"
    environment:
      - "HYPER_ACCESS=YOUR_ACCESS_KEY"
      - "HYPER_SECRET=YOUR_SECRET_KEY"
      - "LETSENCRYPT_EMAIL=YOUR_EMAIL" # optional
    size: s3
    fip: YOUR_FIP # get one by running hyper fip allocate

Then run it using hyper compose up -d, done!

Next, for each container, set the environment variable VIRTUAL_HOST, for example VIRTUAL_HOST=foo.mydomain.com.

hyper-proxy will query the Hyper API every 60 seconds and pick up new containers automatically.

Configuration

hyper-proxy is configured via environment variables.

  • HYPER_ACCESS: Your Hyper access key. Required.
  • HYPER_SECRET: Your Hyper secret key. Required.
  • LETSENCRYPT_EMAIL: If you want to enable Lets Encrypt certificates, your email. Optional.

Questions?

Please create an issue if you have a question or need a feature.

hyper-proxy's People

Contributors

jgillich avatar

Stargazers

Noah_A_S avatar Bevan Hunt avatar James Homer avatar Peter Banjo avatar Avaer Kazmer avatar Tsubasa Takayama avatar Jono avatar Najib Ninaba avatar Nick Wilton avatar Alex Joyce avatar Harold Anderson avatar

Watchers

 avatar Nick Wilton avatar  avatar

Forkers

howdoicomputer

hyper-proxy's Issues

Persistently store Lets Encrypt certificates

In theory, this container never needs to be recreated so it should only request certificates once, but it's still fucking annoying when you run into LE rate limits. Need a way to persistently store certificates without requiring a volume. Maybe Amazon S3 or something like that.

Failing to start. DNS name does not have enough labels

Since the GZIP update, I'm now getting the following error and the proxy is failing to start.
Googling a bit, it appears that the error message "DNS name does not have enough labels" appears to be specific to Let's Encrypt.

> [email protected] start /app
> node index.js

Activating privacy features...
2017/03/10 22:50:39 [gzip] failed to get certificate: acme: Error 400 - urn:acme:error:malformed - DNS name does not have enough labels


npm ERR! Linux 4.4.28-hyper
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hyper-proxy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs hyper-proxy
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls hyper-proxy
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /app/npm-debug.log

> [email protected] start /app
> node index.js

Unhandled rejection FetchError: request to https://us-west-1.hyper.sh/containers/json failed, reason: getaddrinfo EAI_AGAIN us-west-1.hyper.sh:443
    at ClientRequest.<anonymous> (/app/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketErrorListener (_http_client.js:310:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at connectErrorNT (net.js:1022:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Cheers.

Container hangs after a ~20 seconds.

Log:

> [email protected] start /app
> node index.js

Killed

hyper compose up -d -p lb

docker-compose.yml:

version: '2'
services:
  proxy:
    image: jgillich/hyper-proxy
    container_name: proxy
    ports:
      - "80:80"
      - "443:443"
    environment:
      - "HYPER_ACCESS=foo"
      - "HYPER_SECRET=bar"
    size: s3
    fip: 209.177.87.86

Debugging attempts:

  • Tried using Lets Encrypt with the same result.
  • Seems to work fine on local.
  • Hyper account new and empty.
  • Forked repo, enabled TLS DNS mode with Caddy, same result.

HTTP Compression

Hi There,

This is a great project. I'm just wondering how I would go about enabling HTTP compression?

Thanks.
Nick

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.