summaryrefslogtreecommitdiff
path: root/lib/gitlab_keys.rb
Commit message (Collapse)AuthorAgeFilesLines
* Refactor 'GitlabKey' class awaysmall-fixesJacob Vosmaer2016-08-041-15/+11
| | | | | It is not nice to have both 'GitlabKeys' and 'GitlabKey'. We also do not need GitlabKey to be a class when it has no state.
* Add permission check tests, improve checkauthorized-keys-permission-checkJacob Vosmaer2016-08-031-3/+3
|
* Improve authorized_keys checkJacob Vosmaer2016-08-021-0/+13
| | | | | | The old check only looked if authorized_keys exists. With this change, we look whether we can actually open the file for reading and writing. When this fails we try to print useful diagnostic information.
* Manage authorized_keys permissions continuouslykeys-chmodJacob Vosmaer2016-08-011-4/+11
| | | | | | We can lazily create authorized_keys and set its permissions. This adds negligible overhead and it allows us to remove a setup step from GitLab both on source and in omnibus-gitlab.
* Add authorized keys bin script to find keys by fingerprintPablo Carranza2016-03-241-11/+15
|
* Merge branch 'batch-add-keys-timeout'Dmitriy Zaporozhets2015-07-171-1/+1
|\ | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Increase batch_add_keys lock timeout to 300 secondsJacob Vosmaer2015-07-161-1/+1
| |
* | Remove keys from authorized_keys in-placeJacob Vosmaer2015-07-161-8/+7
|/ | | | | | This will speed up the rm-key operation. The downside is that authorized_keys will not shrink when you remove a key. If this ever becomes a problem it can be fixed by running 'rake gitlab:shell:setup'.
* Prevent keys with a very specific comment from accidentally being deleted.Douwe Maan2015-04-141-2/+6
|
* Include ecdsa keys in `gitlab_keys list-keys`.list-ecdsaDouwe Maan2015-04-101-1/+1
|
* Added list-keys command and specDavid Martin2014-10-151-0/+14
| | | | | | | | | | | | | | | | | | Removed puts and tidied up regex Address the hound Address the hound, again Use single quotes Add back travis.yml file Remove travis.yml, only keep on fh-master Use single quotes Use single quotes
* Expliclity require 'timeout' from the stdlibJacob Vosmaer2014-06-101-0/+1
| | | | | | This avoids getting the following error on some platforms: NameError: uninitialized constant GitlabKeys::Timeout
* Use authorized_keys lock when add new key to fileDmitriy Zaporozhets2014-05-311-3/+5
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Put authorized_keys.lock in the .ssh directoryJacob Vosmaer2014-05-301-1/+1
|
* Use lock file when add or remove keys from authorized_keys fileDmitriy Zaporozhets2014-04-181-14/+34
| | | | | | This prevents concurrent modification of authorized_keys file Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Add gitlab-keys batch-add-keysJacob Vosmaer2014-03-141-0/+18
| | | | | This command is intended to be called by the GitLab Rails code when restoring an application backup.
* Generate key_line in separate methodJacob Vosmaer2014-03-141-1/+5
|
* Fix return values in GitlabKeysJacob Vosmaer2013-11-201-0/+3
|
* Use Ruby instead of the Bourne shellJacob Vosmaer2013-11-021-1/+1
|
* Remove sed invocation from GitlabKeysJacob Vosmaer2013-11-021-2/+7
|
* Use Kernel#open to append lines to authorized_keysJacob Vosmaer2013-10-311-3/+2
|
* Use Tempfile instead of `sed -i`Jacob Vosmaer2013-07-191-2/+5
| | | | | | The syntax for `sed -i` is incompatible between GNU sed and BSD sed. By Tempfile from the Ruby standard library we can avoid using the `-i` option of sed.
* Remove unused require statementJacob Vosmaer2013-07-191-1/+0
|
* Ability to clear authorized_keys fileDmitriy Zaporozhets2013-07-181-0/+5
|
* Use :warn instead of :error for invalid commands.ash2013-05-181-1/+1
|
* Use a better error message if gitlab-keys gets an invalid command.ash2013-05-181-1/+1
|
* Add log messages for gitlab_keys.ash2013-05-171-0/+4
|
* Regex used in rm-key command is too laxMax Krasnyansky2013-04-241-1/+1
| | | | | | Basically the issue is that 'gitlab-shell rm-key key-2' removes all keys that match "key-2" pattern. "key-20", "key-25", etc. This change makes the regex used in the sed command more strict.
* return non-zero status if gitlab-projects or gitlab-keys cmd was not successfulv1.2.0Dmitriy Zaporozhets2013-03-251-0/+1
|
* test GitlabKeys execDmitriy Zaporozhets2013-03-111-0/+2
|
* more accurate key deletionDmitriy Zaporozhets2013-02-091-1/+1
|
* Include gitlab_config in gitlab_initDmitriy Zaporozhets2013-02-061-1/+0
|
* Fix key removalDmitriy Zaporozhets2013-02-051-1/+1
|
* add/remove keys by idDmitriy Zaporozhets2013-02-051-4/+4
|
* More testsDmitriy Zaporozhets2013-02-051-6/+0
|
* GitlabConfig. Fixed adding keyDmitriy Zaporozhets2013-02-041-5/+3
|
* proper rm-userDmitriy Zaporozhets2013-02-041-2/+1
|
* add/remove keys to authorized_keysDmitriy Zaporozhets2013-02-031-0/+44