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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-shell
Commits
2a3b15ee
Commit
2a3b15ee
authored
May 16, 2013
by
ash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add log messages for gitlab_keys.
parent
e5f4130a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
lib/gitlab_keys.rb
lib/gitlab_keys.rb
+4
-0
No files found.
lib/gitlab_keys.rb
View file @
2a3b15ee
require
'open3'
require_relative
'gitlab_config'
require_relative
'gitlab_logger'
class
GitlabKeys
attr_accessor
:auth_file
,
:key
...
...
@@ -17,6 +18,7 @@ class GitlabKeys
when
'add-key'
;
add_key
when
'rm-key'
;
rm_key
else
$logger
.
error
"Attempt to execute invalid command
#{
@command
.
inspect
}
."
puts
'not allowed'
false
end
...
...
@@ -25,12 +27,14 @@ class GitlabKeys
protected
def
add_key
$logger
.
info
"Adding key
#{
@key_id
}
=>
#{
@key
.
inspect
}
"
cmd
=
"command=
\"
#{
ROOT_PATH
}
/bin/gitlab-shell
#{
@key_id
}
\"
,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty
#{
@key
}
"
cmd
=
"echo
\'
#{
cmd
}
\'
>>
#{
auth_file
}
"
system
(
cmd
)
end
def
rm_key
$logger
.
info
"Removing key
#{
@key_id
}
"
cmd
=
"sed -i '/shell
#{
@key_id
}
\"
/d'
#{
auth_file
}
"
system
(
cmd
)
end
...
...
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