Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-shell
Commits
58347e53
Commit
58347e53
authored
Feb 05, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gitlab-init
parent
2b01b84f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
6 deletions
+18
-6
bin/gitlab-keys
bin/gitlab-keys
+3
-1
bin/gitlab-projects
bin/gitlab-projects
+4
-1
bin/gitlab-shell
bin/gitlab-shell
+5
-1
bin/install
bin/install
+2
-1
lib/gitlab_init.rb
lib/gitlab_init.rb
+2
-0
spec/gitlab_keys_spec.rb
spec/gitlab_keys_spec.rb
+1
-1
spec/spec_helper.rb
spec/spec_helper.rb
+1
-1
No files found.
bin/gitlab-keys
View file @
58347e53
#!/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
...
...
bin/gitlab-projects
View file @
58347e53
#!/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
...
...
bin/gitlab-shell
View file @
58347e53
...
...
@@ -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
...
...
bin/install
View file @
58347e53
#!/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"
,
...
...
lib/gitlab_init.rb
0 → 100644
View file @
58347e53
ROOT_PATH
=
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
".."
))
spec/gitlab_keys_spec.rb
View file @
58347e53
...
...
@@ -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
...
...
spec/spec_helper.rb
View file @
58347e53
ROOT_PATH
=
File
.
join
(
File
.
expand_path
(
File
.
dirname
(
__FILE__
)),
".."
)
ROOT_PATH
=
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
".."
)
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment