Commit 58347e53 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

gitlab-init

parent 2b01b84f
#!/usr/bin/env ruby
require_relative '../lib/gitlab_init'
#
# GitLab Keys shell. Add/remove keys from ~/.ssh/authorized_keys
#
......@@ -8,7 +10,7 @@
#
# /bin/gitlab-keys rm-key dzaporozhets "ssh-rsa AAAAx321..."
#
ROOT_PATH = File.join(File.expand_path(File.dirname(__FILE__)), "..")
require File.join(ROOT_PATH, 'lib', 'gitlab_keys')
GitlabKeys.new.exec
......
#!/usr/bin/env ruby
require_relative '../lib/gitlab_init'
#
# GitLab Projects shell. Add/remove projects from /home/git/repositories
#
# Ex.
# /bin/gitlab-projects add-project gitlab/gitlab-ci.git
#
# /bin/gitlab-projects rm-project gitlab/gitlab-ci.git
#
ROOT_PATH = File.join(File.expand_path(File.dirname(__FILE__)), "..")
require File.join(ROOT_PATH, 'lib', 'gitlab_projects')
GitlabProjects.new.exec
......
......@@ -4,10 +4,14 @@ unless ENV['SSH_CONNECTION']
puts "Only ssh allowed"
exit
end
require_relative '../lib/gitlab_init'
#
#
# GitLab shell, invoked from ~/.ssh/authorized_keys
#
ROOT_PATH = File.join(File.expand_path(File.dirname(__FILE__)), "..")
#
require File.join(ROOT_PATH, 'lib', 'gitlab_shell')
GitlabShell.new.exec
......
#!/usr/bin/env ruby
require_relative '../lib/gitlab_init'
#
# GitLab shell, invoked from ~/.ssh/authorized_keys
#
ROOT_PATH = File.join(File.expand_path(File.dirname(__FILE__)), "..")
commands = [
"mkdir -p /home/git/repositories",
......
ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__), ".."))
......@@ -20,7 +20,7 @@ describe GitlabKeys do
end
it "should receive valid cmd" do
valid_cmd = "echo 'command=\"/home/git/gitlab-shell/spec/../bin/gitlab-shell dzaporozhets\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaDAxx2E' >> /home/git/.ssh/authorized_keys"
valid_cmd = "echo 'command=\"#{ROOT_PATH}/bin/gitlab-shell dzaporozhets\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaDAxx2E' >> /home/git/.ssh/authorized_keys"
@gl_keys.should_receive(:system).with(valid_cmd)
@gl_keys.send :add_key
end
......
ROOT_PATH = File.join(File.expand_path(File.dirname(__FILE__)), "..")
ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__), ".."))
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