Coder Social home page Coder Social logo

udm-proxy's Introduction

Proxy for UDM Pro

Create a reverse proxy for UDM Pro.

Work based upon unifi-utilities/unifios-utilities#149

Prerequisities

Setup

Follow the steps below to get going

  1. Download or clone this repository into /mnt/data/proxy.

  2. Customize on_boot.d/30-proxy.sh to your needs.

  3. Symlink container proxy boot script

    $ ln -sf /mnt/data/proxy/on_boot.d/30-proxy.sh /mnt/data/on_boot.d/.

  4. Run boot script (to create/update network and create CNI configuration for container)

    $ /mnt/data/on_boot.d/30-proxy.sh

    It will fail when trying to run the container, but thats okay, its just for setting op needed configuration before initial image run.

  5. Register the container with podman

    $ podman run -d --systemd=false --network proxy --name proxy -v "/mnt/data/proxy/Caddyfile:/etc/proxy/Caddyfile" xpherism/udm-proxy

  6. Run boot script again and we are done :-)

Remember to change the etc/caddy/Caddyfile to your requirements and add additional mounts to podman run if needed.
The default caddefile proxies unifi.my.domain to 10.0.0.1 (ie. unifi controller) If you keep the proxy settings for the unifi controller, then you need do following first to avoid redirect recursion

$ ln -sf /mnt/data/proxy/etc/unifi-core/config.yaml /mnt/data/unifi-os/unifi-core/.

This disabled http->https redirect from unifi controller which is the cause of the above problem.

Image

Container image xpherism/udm-proxy is caddy built with the following modules

Feel free to use the vanilla caddy docker image or roll your own depending on your needs.

To update container image, simple do

$ podman stop proxy && podman rm proxy and run boot script again :-)

For more information

To build your own image, simple fork this repository and change what you need and simple run

$ docker build --platform arm64 -t udm-proxy .

TODO

  • Add DNS proxy DoH or DoT to xpherism:udm-proxy docker image
  • If bored make a simple UI to reverse proxy :-)

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.