Fix forward_auth in caddy, keep proxy open when run locally
This commit is contained in:
parent
7dd5248a6e
commit
6bd98d6792
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
http://*:8888 {
|
http://*:8888 {
|
||||||
forward_auth /admin/* http://127.0.0.1:3000 {
|
forward_auth /admin/* http://127.0.0.1:3000 {
|
||||||
uri http://127.0.0.1:3000
|
uri /auth
|
||||||
copy_headers {
|
copy_headers {
|
||||||
Authorization
|
Authorization
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,13 @@ class Config
|
|||||||
end
|
end
|
||||||
|
|
||||||
class ConfigAuthHandler < Kemal::BasicAuth::Handler
|
class ConfigAuthHandler < Kemal::BasicAuth::Handler
|
||||||
|
only ["/auth"]
|
||||||
|
|
||||||
|
def call(context)
|
||||||
|
return call_next(context) unless only_match?(context)
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
# Ignored, just make the compiler happy
|
# Ignored, just make the compiler happy
|
||||||
@credentials = Kemal::BasicAuth::Credentials.new({"foo" => "bar"})
|
@credentials = Kemal::BasicAuth::Credentials.new({"foo" => "bar"})
|
||||||
|
@ -23,6 +23,9 @@ get "/version" do
|
|||||||
"#{version}"
|
"#{version}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
get "/auth" do
|
||||||
|
end
|
||||||
|
|
||||||
get "/reload" do
|
get "/reload" do
|
||||||
Log.info { "Reloading configuration" }
|
Log.info { "Reloading configuration" }
|
||||||
Config.load
|
Config.load
|
||||||
|
@ -37,7 +37,7 @@ module Proxy
|
|||||||
|
|
||||||
http://*:8888 {
|
http://*:8888 {
|
||||||
forward_auth /admin/* http://127.0.0.1:3000 {
|
forward_auth /admin/* http://127.0.0.1:3000 {
|
||||||
uri http://127.0.0.1:3000
|
uri /auth
|
||||||
copy_headers {
|
copy_headers {
|
||||||
Authorization
|
Authorization
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user