git auth添加日志

dev_ec
jingquan huang 5 years ago
parent d1a77755d8
commit f17fa26ee5

@ -8,7 +8,11 @@ class GitsController < ApplicationController
# 供 git-workhorse反向调用认证
def auth
# HTTP_AUTHORIZATION: "Basic 这里base64编码的的密码(user:passwd)"
decodes = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
rand_code = decodes.sample(10).join
logger.info("11111112222223333 HTTP_AUTHORIZATION: #{request.env["HTTP_AUTHORIZATION"]}")
logger.info("1111111 git auth start: code is #{rand_code}, time is #{Time.now}")
# logger.info("#########-----request_env: #{request.env}")
# {"service"=>"git-receive-pack", "controller"=>"gits", "action"=>"auth",
# "url"=>"forge01/cermyt39.git/info/refs"}
@ -68,6 +72,7 @@ class GitsController < ApplicationController
authenticate_or_request_with_http_basic do |username, password|
result
logger.info("1111111 git auth end: code is #{rand_code}, time is #{Time.now}")
end
end

Loading…
Cancel
Save