Commit e7a4d233 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

gitlab-url config

parent 02f4cb52
user: git
gitlab_url: "http://localhost/"
repos_path: "/home/git/repositories"
auth_file: "/home/git/.ssh/authorized_keys"
......@@ -8,10 +8,14 @@ class GitlabConfig
end
def repos_path
@config['repos_path'] = "/home/git/repositories"
@config['repos_path'] ||= "/home/git/repositories"
end
def auth_file
@config['auth_file'] = "/home/git/.ssh/authorized_keys"
@config['auth_file'] ||= "/home/git/.ssh/authorized_keys"
end
def gitlab_url
@config['gitlab_url'] ||= "http://localhost/"
end
end
require 'net/http'
require 'json'
require_relative 'gitlab_config'
class GitlabNet
def allowed?(cmd, repo, key, ref)
project_name = repo.gsub("'", "")
......@@ -23,7 +25,7 @@ class GitlabNet
protected
def host
"http://127.0.0.1:3000/api/v3/internal"
"#{GitlabConfig.new.gitlab_url}api/v3/internal"
end
def get(url)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment