Skip to content

Commit

Permalink
feat: update README, and adding a docker-compose for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomMoulard committed Jan 18, 2023
1 parent 357152e commit f0789b6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 31 deletions.
31 changes: 1 addition & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,11 @@
# Header transformation plugin for traefik

[![Build Status](https://travis-ci.com/tomMoulard/htransformation.svg?branch=main)](https://travis-ci.com/tomMoulard/htransformation)

This plugin allows changing on the fly, the header value of a request.

## Dev `traefik.yml` configuration file for traefik

```yml
pilot:
token: [REDACTED]

experimental:
devPlugin:
goPath: /home/tm/go
moduleName: github.com/tomMoulard/htransformation

entryPoints:
http:
address: ":8000"
forwardedHeaders:
insecure: true

api:
dashboard: true
insecure: true

providers:
file:
filename: rules-htransformation.yaml
```
## How to dev

```bash
$ docker run -d --network host containous/whoami -port 5000
# traefik --config-file traefik.yml
$ docker compose up
```

## How to use
Expand Down
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3.9'

services:
traefik:
image: traefik:v3.0
command:
- --api.insecure=true
- --providers.docker
- --providers.file.filename=/rules-htransformation.yaml
- --log.level=DEBUG
- --experimental.localPlugins.htransformation.moduleName=github.com/tomMoulard/htransformation
ports:
- 80:80
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./rules-htransformation.yaml:/rules-htransformation.yaml
- .:/plugins-local/src/github.com/tomMoulard/htransformation/
tty: true

whoami:
image: traefik/whoami # https://github.com/traefik/whoami
command: -name whoami
labels:
traefik.http.routers.whoami.rule: Host(`whoami.localhost`)
2 changes: 1 addition & 1 deletion rules-htransformation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ http:
middlewares:
htransformation:
plugin:
dev:
htransformation:
Rules:
- Rule:
Name: 'Header transformation'
Expand Down

0 comments on commit f0789b6

Please sign in to comment.