From 43ec9b04b1b5c494d66d743d60fc3afb44ff3a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Leurent?= <131.php@cloudyks.org> Date: Thu, 27 Oct 2016 18:13:08 +0000 Subject: [PATCH] Add "user" command to gitlab-shell to dump user JSON metadata --- lib/gitlab_shell.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index e243aac8..0bcd7464 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -9,7 +9,7 @@ class GitlabShell class DisallowedCommandError < StandardError; end class InvalidRepositoryPathError < StandardError; end - GIT_COMMANDS = %w(git-upload-pack git-receive-pack git-upload-archive git-annex-shell git-lfs-authenticate).freeze + GIT_COMMANDS = %w(git-upload-pack git-receive-pack git-upload-archive git-annex-shell git-lfs-authenticate user).freeze API_COMMANDS = %w(2fa_recovery_codes) GL_PROTOCOL = 'ssh'.freeze @@ -71,9 +71,12 @@ class GitlabShell raise DisallowedCommandError unless GIT_COMMANDS.include?(@command) case @command + + when 'user' + puts user.to_json + exit when 'git-annex-shell' raise DisallowedCommandError unless @config.git_annex_enabled? - @repo_name = args[2].sub(/\A\/~\//, '') when 'git-lfs-authenticate' raise DisallowedCommandError unless args.count >= 2 -- GitLab