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
ff33debb
Commit
ff33debb
authored
Jul 18, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ability to clear authorized_keys file
parent
768ae8eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
README.md
README.md
+4
-0
bin/gitlab-keys
bin/gitlab-keys
+2
-0
lib/gitlab_keys.rb
lib/gitlab_keys.rb
+5
-0
No files found.
README.md
View file @
ff33debb
...
...
@@ -72,3 +72,7 @@ Remove key
./bin/gitlab-keys rm-key key-23 "ssh-rsa AAAAx321..."
Remoev all keys from authorized_keys file
./bin/gitlab-keys clear
bin/gitlab-keys
View file @
ff33debb
...
...
@@ -10,6 +10,8 @@ require_relative '../lib/gitlab_init'
#
# /bin/gitlab-keys rm-key key-23 "ssh-rsa AAAAx321..."
#
# /bin/gitlab-keys clear"
#
require
File
.
join
(
ROOT_PATH
,
'lib'
,
'gitlab_keys'
)
...
...
lib/gitlab_keys.rb
View file @
ff33debb
...
...
@@ -17,6 +17,7 @@ class GitlabKeys
case
@command
when
'add-key'
;
add_key
when
'rm-key'
;
rm_key
when
'clear'
;
clear
else
$logger
.
warn
"Attempt to execute invalid gitlab-keys command
#{
@command
.
inspect
}
."
puts
'not allowed'
...
...
@@ -38,4 +39,8 @@ class GitlabKeys
cmd
=
"sed -i '/shell
#{
@key_id
}
\"
/d'
#{
auth_file
}
"
system
(
cmd
)
end
def
clear
system
(
"echo '# Managed by gitlab-shell' >
#{
auth_file
}
"
)
end
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