Skip to content

Commit 796a8d3

Browse files
Andrey Zhavoronkovbsekachev
Andrey Zhavoronkov
andauthored
fixed cvat startup process (#2293)
* fixed cvat startup process * updated readme * updated license header * updated CHANGELOG Co-authored-by: Boris Sekachev <[email protected]>
1 parent d4129f2 commit 796a8d3

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6161
- Fixed issues from #2112 (<https://github.com/openvinotoolkit/cvat/pull/2217>)
6262
- Git application name (renamed to dataset_repo) (<https://github.com/openvinotoolkit/cvat/pull/2243>)
6363
- A problem in exporting of tracks, where tracks could be truncated (<https://github.com/openvinotoolkit/cvat/issues/2129>)
64-
64+
- Fixed CVAT startup process if the user has `umask 077` in .bashrc file (<https://github.com/openvinotoolkit/cvat/pull/2293>)
6565

6666
### Security
6767

cvat/settings/base.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2019 Intel Corporation
1+
# Copyright (C) 2018-2020 Intel Corporation
22
#
33
# SPDX-License-Identifier: MIT
44

@@ -50,10 +50,22 @@ def generate_ssh_keys():
5050
ssh_dir = '{}/.ssh'.format(os.getenv('HOME'))
5151
pidfile = os.path.join(ssh_dir, 'ssh.pid')
5252

53+
def add_ssh_keys():
54+
IGNORE_FILES = ('README.md', 'ssh.pid')
55+
keys_to_add = [entry.name for entry in os.scandir(ssh_dir) if entry.name not in IGNORE_FILES]
56+
keys_to_add = ' '.join(os.path.join(ssh_dir, f) for f in keys_to_add)
57+
subprocess.run(['ssh-add {}'.format(keys_to_add)],
58+
shell = True,
59+
stderr = subprocess.PIPE,
60+
# lets set the timeout if ssh-add requires a input passphrase for key
61+
# otherwise the process will be freezed
62+
timeout=30,
63+
)
64+
5365
with open(pidfile, "w") as pid:
5466
fcntl.flock(pid, fcntl.LOCK_EX)
5567
try:
56-
subprocess.run(['ssh-add {}/*'.format(ssh_dir)], shell = True, stderr = subprocess.PIPE)
68+
add_ssh_keys()
5769
keys = subprocess.run(['ssh-add -l'], shell = True,
5870
stdout = subprocess.PIPE).stdout.decode('utf-8').split('\n')
5971
if 'has no identities' in keys[0]:
@@ -440,3 +452,4 @@ def generate_ssh_keys():
440452
}
441453

442454
USE_CACHE = True
455+

ssh/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Put your SSH keys and SSH config here and they will be installed to the CVAT container.
2+
Please do not use encrypted keys that require a passphrase - these keys will not be used.
23

34
If you have any problems with a git repository cloning inside the CVAT:
45
* Make sure that SSH keys have been added to the CVAT container:

0 commit comments

Comments
 (0)