Commit Graph

224 Commits

Author SHA1 Message Date
Negasus
738c3baf6c add consul catalog provider 2021-05-13 01:14:04 -05:00
Umputun
a93bd40f8a treat 0 max request size limit as unlimited 2021-05-12 21:54:41 -05:00
Umputun
25ee73d8d6 set X-Forwarded-Host to orid host, drop X-Origin-Host #67 2021-05-10 03:50:00 -05:00
Umputun
a73a16c12b wait till fqdn avail for ssl auto #63 2021-05-05 01:41:23 -05:00
Umputun
211fe15b8f add autocert details log 2021-05-04 12:51:07 -05:00
Umputun
5c1ab356cc fix default ssk port selection 2021-05-03 21:52:08 -05:00
Umputun
4c051ca37f
detect in-container and set listen address to 0.0.0.0 (#62)
* detect in-container and set listen to 0.0.0.0

* simplify default address logic

don't change if user defined, use 127.0.0.1:8080 for non-docker and 0.0.0.0:8080 for in-docker only if nothing set

* add dynamic default to redir http port

* add docs about dynamic defaults

* add ssl example

* lint: params warn
2021-05-03 21:40:21 -05:00
Umputun
3eba72cbff extend health chek to make sure all pings called 2021-05-02 12:52:29 -05:00
Umputun
5743109210
Nice error (#61)
* add support of html error reporting with custom templates

* typo

* formatting

* better template load error msg
2021-04-30 04:03:36 -05:00
Umputun
06e78b81d4 extend no match WARN 2021-04-28 14:47:53 -05:00
Umputun
9b9d64894d reproxy.port to enable container 2021-04-28 14:37:11 -05:00
Umputun
2670144e8a add support of docker route prefix 2021-04-28 14:00:38 -05:00
Umputun
69bb10d42f fix default docker dest to include container 2021-04-28 13:40:59 -05:00
Umputun
1ff45cc2ca add integration test over https 2021-04-27 02:50:45 -05:00
Umputun
604391e55e extend tests for tricky cases 2021-04-27 01:57:04 -05:00
Umputun
66eb3ffe4a support d units in cache duration 2021-04-27 01:40:46 -05:00
Umputun
a4cffbe922
Mime cache (#59)
* support different caching duration for different mime types #58

* extract main code to run func

* lint: err shadowing
2021-04-26 18:51:48 -05:00
Umputun
9a7a92fc41 make deadlock test on health handler more realistic 2021-04-24 04:03:29 -05:00
Umputun
efded2cf5e flip order in docker proxy+static labels #55
we want proxy rule to have priority over assets rule
2021-04-23 04:05:14 -05:00
Umputun
c590c3246d
Assets cache (#54)
* add caching control for assets
* regen site
2021-04-23 02:02:36 -05:00
Nikita Vasiliev
ef8298bb9c Test to catch a deadlock in healthHandler() 2021-04-21 17:30:34 -05:00
Nikita Vasiliev
38af32f37c Fix a deadlock 2021-04-21 17:30:34 -05:00
Umputun
4c79c3b239 rename endpoint to /metrics 2021-04-21 01:28:07 -05:00
Umputun
f16d92b774 lint: minor warns 2021-04-20 19:22:46 -05:00
Umputun
aef3040b60 fix tests regression 2021-04-20 19:22:46 -05:00
Umputun
8ea0052228 implement basic support of metrics via mgmt server #35 2021-04-20 19:22:46 -05:00
Umputun
3499836b90 fix typo in help msg 2021-04-19 03:25:59 -05:00
Umputun
f7b24e1058 fix health counts calculation 2021-04-17 23:41:44 -05:00
Umputun
1695532aa5 add ping test 2021-04-17 23:32:54 -05:00
Umputun
f246618622 don't health check asset mappers 2021-04-17 23:28:12 -05:00
Umputun
afbcc6c7bb removed unneded atomic in health check 2021-04-17 23:24:41 -05:00
Umputun
e8988bacc6 extend main test 2021-04-17 23:17:05 -05:00
Umputun
f304a2f0e6 add total number of services to health error 2021-04-17 23:06:48 -05:00
Umputun
1aa89cfbd6 fix docker resp struct 2021-04-17 22:55:32 -05:00
Timofey
e7121846da Handle docker API errors 2021-04-17 22:37:32 -05:00
Timofey
813ed6df3d Set minimal supported docker version 2021-04-17 22:37:32 -05:00
Umputun
bbbd24dd53 fix missing url.Host forward 2021-04-17 13:11:10 -05:00
Umputun
0a9051d528 lint: unneeded fmt 2021-04-17 02:36:49 -05:00
Umputun
2b492d840a fix tests 2021-04-17 02:35:23 -05:00
Umputun
ee4f8919e1 allow docker to provide static with proxy at the same time #27 2021-04-17 02:17:23 -05:00
Umputun
6ad288afd0 drop docker api version 2021-04-17 02:16:43 -05:00
Umputun
b667720cc3 suppress messages on docker events check 2021-04-16 17:36:57 -05:00
Timofey
7f991b1e18 Refactor
Thx for the feedback.

* Add missing test
* Decouple containerInfo from docker client
* Move refresh interval var to `Docker`
* Minor things
2021-04-16 17:30:54 -05:00
Timofey
76be67d39c Detect changes in running containers
* Naive attempt to detect changes based on container metadata
* And my best effort to test it
2021-04-16 17:30:54 -05:00
Timofey
a91fb6816f Invoke Docker API directly
* Remove third-party docker client dependency
* Simplify code and tests

Might need to run `go mod tidy` and `go mod vendor` afterwards
2021-04-16 17:30:54 -05:00
Umputun
8dca98c6b3 don't resort rules for file provider inside the server #37 2021-04-16 11:10:07 -05:00
Umputun
8cf4b9063d
Multiple static location (#36)
* add isStatic flag to mapper, implement for file and static providers

* handle static match response as a special case

* move assets conversion to load time

* rename static to assets everywhere for consistency

* don't overwride asset param in url mapper

* add documentation about assets mode

* add tests
2021-04-16 02:49:00 -05:00
Vladimir Garvardt
66610ef491 Replaced github.com/pkg/errors with stdlib errors wrap 2021-04-14 11:44:20 -05:00
Konstantin Alikhanov
c5200e0a1a Fixing type error in SSL Static mode 2021-04-14 11:08:17 -05:00
Umputun
47d802679d sort mappers in the list 2021-04-14 02:47:35 -05:00
Umputun
de4a6eca64 container named rerpoxy excluded from discovery 2021-04-13 20:40:42 -05:00
Umputun
1606e56d82 fix proxy headers, should affect response not the request 2021-04-13 14:33:54 -05:00
Umputun
6dcc2fa719 flip signature, disabled by default 2021-04-13 14:08:15 -05:00
Umputun
510b29c3ec wrap proxy internal err log 2021-04-13 14:03:25 -05:00
Umputun
9bcb9de0d4 filter /ping from stdout logging 2021-04-13 13:04:40 -05:00
Umputun
d8309ab6f2 allow optional stdout logging 2021-04-13 12:45:49 -05:00
Umputun
5479063f4e limit health check concurrency 2021-04-13 12:34:34 -05:00
Umputun
f6491246f8 support reproxy.port #21
defines which of exposed ports will be used for the destination in case if multiple ports exposed from the container
2021-04-13 12:01:54 -05:00
Umputun
af02a41147 add primitive priority order for discovered containers 2021-04-13 01:52:12 -05:00
Umputun
26647571af lint: simplify health and ping path check 2021-04-13 01:28:22 -05:00
Umputun
dea0e5c742 add details to health error message 2021-04-13 01:24:57 -05:00
Umputun
ffd8afad07 change both /health and /ping to exact url match
needed to prevent conflict with proxied services
implementing /health or /ping
2021-04-13 00:52:06 -05:00
Umputun
64fd98a130 all timeouts are customizable #5 2021-04-12 21:54:59 -05:00
Umputun
06a6d595b3 change docker provider defaults
skip without --docker.auto all containers without reproxy.* label
2021-04-12 21:26:31 -05:00
Umputun
02c87ffc7a support multiple servers in reproxy.server label #20 2021-04-12 03:13:25 -05:00
Umputun
a20abd0140 change docker default and add autoapi param #20 2021-04-12 02:57:13 -05:00
Umputun
1ac2f23504 adjust tests for delayed events 2021-04-12 02:29:17 -05:00
Umputun
0e5998d540 add error logging on failed list 2021-04-12 02:11:43 -05:00
Umputun
8b3889d4e5 switch events to provider id, delay repsponse 2021-04-12 02:09:34 -05:00
Umputun
a79cd3c7a4 correct providers order 2021-04-12 02:07:35 -05:00
Umputun
9c659afb0f drop separate ID method from providers, fill directly 2021-04-11 23:41:23 -05:00
Umputun
5a98338f84 fix separator conflict between env and static rule parts 2021-04-11 23:18:06 -05:00
Umputun
3bf88c5af3 allow @ substitution in addtion to $ in destination 2021-04-11 21:01:52 -05:00
Umputun
dfc101cb85 enforce servers sort 2021-04-11 14:42:16 -05:00
Umputun
46d83f235e don't run discovery if no providers 2021-04-11 14:21:58 -05:00
Umputun
ef09f8ace3
Merge pull request #15 from daulet/master
Speed up route lookup by grouping mappers by server names
2021-04-11 13:52:46 -05:00
Daulet Zhanguzin
957916fd6b Speed up route lookup by grouping mappers by server names 2021-04-11 10:18:57 +01:00
Umputun
9462170cd1 support reproxy.enabled label, enforce this label for reproxy container itself #16 2021-04-11 01:37:45 -05:00
Umputun
be20b0b636 allow use of assets server without any provider 2021-04-10 14:34:28 -05:00
Daulet Zhanguzin
936a0815a0 Fix missed file update if consumer of events is busy, e.g. waiting on a lock 2021-04-10 19:59:50 +01:00
Daulet Zhanguzin
5d9283be34 Add a test to reproduce missed file update 2021-04-10 19:59:50 +01:00
Umputun
7da8ee593e add reference to examples 2021-04-10 13:18:28 -05:00
Umputun
6bcb791bc5 fix ping path from docker labels, clarify docs about path (not url) for the destination 2021-04-10 02:44:40 -05:00
Umputun
b0dcad19fc disable network check by default 2021-04-10 02:08:26 -05:00
Umputun
a3d35bf7a9 normalize signatureHandler to be similar to other handlers 2021-04-09 21:01:46 -05:00
Umputun
a4323dcdb2 consolidate transport with director 2021-04-09 20:55:21 -05:00
Umputun
bd08c91889 don't use default transport for proxy, causing race with tests 2021-04-09 20:54:02 -05:00
Umputun
6508c95eae update deps 2021-04-09 15:31:14 -05:00
Umputun
fe7992a972 drop compress, switch to gorilla 2021-04-09 15:26:06 -05:00
Umputun
9107b41590 lint: err shadow 2021-04-09 15:22:21 -05:00
Umputun
3761364f6e fix unsafe close 2021-04-09 15:19:11 -05:00
Umputun
9029b4d60f lint: multiple warns cleanup 2021-04-09 15:05:22 -05:00
Umputun
220f966720 switch gzip middleware 2021-04-09 13:50:01 -05:00
Umputun
cdbe5d6dd7 don't autofill servers if FQDNs passed in 2021-04-09 02:48:18 -05:00
Umputun
6ab7ae8225 fix missing fqdn param and default for redirect port 2021-04-09 02:28:13 -05:00
Umputun
8733d84ef6 support extension of rules 2021-04-08 23:27:57 -05:00
Umputun
c18d0e8cb7 change docker default network to bridge 2021-04-08 22:07:40 -05:00
Umputun
44340eec77 fix health error report 2021-04-08 22:07:15 -05:00
Umputun
cdbf455d65 simplify docker events with filters 2021-04-08 22:06:16 -05:00
Umputun
e7d08008bf fix comments, more tests 2021-04-07 21:52:14 -05:00
Umputun
7004aa83f2 fix flaky test 2021-04-06 23:59:23 -05:00
Umputun
af1cd3ae46 back to 1.15 compat 2021-04-06 23:50:04 -05:00
Umputun
a835b66bf9 missing file for prev commit 2021-04-06 23:18:27 -05:00
Umputun
cfb8d8df14 add-nosignature mode, rename leftovers from dpx 2021-04-06 23:17:50 -05:00
Umputun
a27b718d59 missing vendor 2021-04-05 22:14:23 -05:00
Umputun
6e31a87a40 add access log 2021-04-05 22:12:06 -05:00
Umputun
225590da2c add ping url and health check 2021-04-05 03:37:28 -05:00
Umputun
75fddfa7fe support groups of route for file provider 2021-04-05 01:37:05 -05:00
Umputun
dfa0d51b31 add Servers list and fill FQDNs 2021-04-04 15:55:06 -05:00
Umputun
4e28e69997 add X-Real-IP to proxied request 2021-04-04 02:57:34 -05:00
Umputun
7a263fed42 bump go-pkgz/rest 2021-04-04 02:39:42 -05:00
Umputun
f8cd5f53b0 rename to reproxy 2021-04-03 14:23:23 -05:00
Umputun
2092674d2f fix tag typo in opts 2021-04-03 02:45:43 -05:00
Umputun
ee51a35513 some initial docs 2021-04-03 02:31:48 -05:00
Umputun
2c757b4c37 comments and more logging 2021-04-03 01:38:05 -05:00
Umputun
d45415080a allow custom https and http ports 2021-04-03 01:20:24 -05:00
Umputun
79f0514294 lint: multiple warns 2021-04-03 01:00:09 -05:00
Umputun
a316070eb6 add ssl suport 2021-04-03 00:22:54 -05:00
Umputun
d8c515d4d5 bump deps 2021-04-02 14:27:40 -05:00
Umputun
96e5cd2e6b WIP: add 3 types of server 2021-04-02 03:13:49 -05:00
Umputun
7c08a09053 allow docker provider on exposed and matched network 2021-04-02 00:50:16 -05:00
Umputun
190b194d88 support multiple servers 2021-04-02 00:07:36 -05:00
Umputun
0dcb927e01 add headers mw 2021-04-01 02:53:42 -05:00
Umputun
8a7b73f41f initial version #1 2021-04-01 02:37:28 -05:00