-
Notifications
You must be signed in to change notification settings - Fork 1
Update docs #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docs #23
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,34 +1,46 @@ | ||||||
| <img src=".github/img/splash.jpeg"> | ||||||
|
|
||||||
| <br/> | ||||||
| # `magic-proxy` | ||||||
|
|
||||||
| [](https://github.com/stonegray/magic-proxy/actions/workflows/ci.yml) | ||||||
|
|
||||||
| magic-proxy automatically configures your proxy by reading `x-magic-proxy-descriptor` fields embedded in docker compose files, allowing you to simply bring the compose up and trust that your proxy will automatically configure itself without user intervention. | ||||||
| magic-proxy automatically configures your web proxy by reading `x-magic-proxy` fields embedded in docker compose files, allowing you to simply bring the compose up and trust that your proxy will automatically configure itself without user intervention. It is essentially a templating engine that uses a common syntax, allowing it to generate output for various proxies. | ||||||
|
|
||||||
| magic-proxy attaches event-based watchers to relavant files and passively streams events from your `docker.sock` to ensure near-instant configuration of your proxy when it changes, without any polling overhead. | ||||||
|
|
||||||
| magic-proxy passively streams events from your `docker.sock` to ensure near-instant configuration of your proxy, without any polling overhead. | ||||||
| Features: | ||||||
|
|
||||||
| magic-proxy is proxy-agnostic and user extensible. It contains a built in HTTP server for status reporting; which is read only and isolated in a v8 VM with a well defined abstraction layer to reduce attack surface. | ||||||
| - API for status monitoring | ||||||
| - Hundreds of built-in regression tests to ensure future stability | ||||||
| - Runtime tests to validate your configuration | ||||||
|
|
||||||
| magic-proxy is currently in development. | ||||||
| Limitations: | ||||||
| - Only one port per container. | ||||||
| - Currently only the Traefik backend is implemented. You may try the Nginx branch at your own risk. | ||||||
|
|
||||||
| Example: | ||||||
|
|
||||||
| ```yaml | ||||||
| version: "3.9" | ||||||
|
|
||||||
| services: | ||||||
| web-test1: | ||||||
| image: crccheck/hello-world | ||||||
| container_name: web-test1 | ||||||
| expose: | ||||||
| - "8000" | ||||||
| x-magic-proxy-descriptor: | ||||||
| x-magic-proxy: | ||||||
| # read ./config/template/* to see how these work, but basically it's | ||||||
| # the base config that gets permutated for each container: | ||||||
| template: example.yml | ||||||
| # base information to pass to the proxy: | ||||||
| hostname: web-test1.proxy.example.org | ||||||
| target: http://web-test1:8000 | ||||||
| userData: | ||||||
| # add anything here; like OIDC/Oauth2 roles/groups | ||||||
| # this data can get passed to any configuration parameter | ||||||
| # on the proxy: | ||||||
| oidc_group: superCoolPeople | ||||||
| rateLimit: 10 | ||||||
| ``` | ||||||
|
|
||||||
| Now visiting web-test1.proxy.example.org transparently forwards to | ||||||
| Now visiting web-test1.proxy.example.org transparently forwards to port 8000 in the container. | ||||||
|
|
||||||
| ## Usage: | ||||||
| Simply start the container on your host and specify the name of the proxy container. | ||||||
|
|
@@ -38,25 +50,23 @@ services: | |||||
| magic-proxy: | ||||||
| build: . | ||||||
| image: docker-ts-app:latest | ||||||
| enviroment: | ||||||
| - PROXY_TYPE="traefik" | ||||||
| - PROXY_OUTPUT_FILE="traefik" | ||||||
| volumes: | ||||||
| - "traefik_magic.yml:/var/traefik_magic.yml" | ||||||
| - "/var/run/docker.sock:/var/run/docker.sock" | ||||||
| - "./config:/var/config:ro" | ||||||
| - "/var/run/docker.sock:/var/run/docker.sock:ro" | ||||||
| - "generated_config:/var/generated" | ||||||
| - "/:/host:ro" # required to read the compose files | ||||||
| restart: unless-stopped | ||||||
| traefik: | ||||||
| image: "traefik:v3.4" | ||||||
| container_name: "traefik" | ||||||
| restart: unless-stopped | ||||||
| security_opt: | ||||||
| - no-new-privileges:true | ||||||
| command: | ||||||
| - "--entryPoints.web.address=:80" | ||||||
| - "--configFile:/var/generated/traefik_magic.yml" | ||||||
|
||||||
| - "--configFile:/var/generated/traefik_magic.yml" | |
| - "--configFile=/var/generated/traefik_magic.yml" |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docker-compose.yml file is incomplete - it's missing the closing volumes declaration and the "Why?" section on line 71 appears to be cut off with no content. The file should either include the complete docker-compose.yml example or indicate that it continues.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: "relavant" should be "relevant"