From 832a4b1f5683de8ed9953bcea83fcf9605c2772b Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Fri, 9 Oct 2020 13:46:32 +0300 Subject: [PATCH 1/4] fixed cvat startup process --- cvat/settings/base.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cvat/settings/base.py b/cvat/settings/base.py index 2b49c78f48cd..cfde2d141363 100644 --- a/cvat/settings/base.py +++ b/cvat/settings/base.py @@ -50,10 +50,22 @@ def generate_ssh_keys(): ssh_dir = '{}/.ssh'.format(os.getenv('HOME')) pidfile = os.path.join(ssh_dir, 'ssh.pid') + def add_ssh_keys(): + IGNORE_FILES = ('README.md', 'ssh.pid') + keys_to_add = [entry.name for entry in os.scandir(ssh_dir) if entry.name not in IGNORE_FILES] + keys_to_add = ' '.join(os.path.join(ssh_dir, f) for f in keys_to_add) + subprocess.run(['ssh-add {}'.format(keys_to_add)], + shell = True, + stderr = subprocess.PIPE, + # lets set the timeout if ssh-add requires a input passphrase for key + # otherwise the process will be freezed + timeout=30, + ) + with open(pidfile, "w") as pid: fcntl.flock(pid, fcntl.LOCK_EX) try: - subprocess.run(['ssh-add {}/*'.format(ssh_dir)], shell = True, stderr = subprocess.PIPE) + add_ssh_keys() keys = subprocess.run(['ssh-add -l'], shell = True, stdout = subprocess.PIPE).stdout.decode('utf-8').split('\n') if 'has no identities' in keys[0]: @@ -440,3 +452,4 @@ def generate_ssh_keys(): } USE_CACHE = True + From 824d6f9f0d00c255626799efc454054394315499 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Fri, 9 Oct 2020 13:55:20 +0300 Subject: [PATCH 2/4] updated readme --- ssh/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ssh/README.md b/ssh/README.md index b5dcd609638e..246dc050b2ee 100644 --- a/ssh/README.md +++ b/ssh/README.md @@ -1,4 +1,5 @@ Put your SSH keys and SSH config here and they will be installed to the CVAT container. +Please do not use encrypted keys that require a passphrase - these keys will not be used. If you have any problems with a git repository cloning inside the CVAT: * Make sure that SSH keys have been added to the CVAT container: From 39f30d26619533a8b99c08a8835cf61d6ecfa543 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Fri, 9 Oct 2020 14:12:30 +0300 Subject: [PATCH 3/4] updated license header --- cvat/settings/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvat/settings/base.py b/cvat/settings/base.py index cfde2d141363..307570440945 100644 --- a/cvat/settings/base.py +++ b/cvat/settings/base.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2019 Intel Corporation +# Copyright (C) 2018-2020 Intel Corporation # # SPDX-License-Identifier: MIT From 5fa2dc2bb5bf4f902f918d5bad028e96df58f88b Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Fri, 9 Oct 2020 15:22:11 +0300 Subject: [PATCH 4/4] updated CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb4379b0bac8..dd53ad8ed865 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ filters and searching the nearest frame without any annotations () - Fixed issues from #2112 () - Git application name (renamed to dataset_repo) () +- Fixed CVAT startup process if the user has `umask 077` in .bashrc file () ### Security -