fixed cvat startup process (#2293)

* fixed cvat startup process

* updated readme

* updated license header

* updated CHANGELOG

Co-authored-by: Boris Sekachev <boris.sekachev@yandex.ru>
main
Andrey Zhavoronkov 5 years ago committed by GitHub
parent d4129f2868
commit 796a8d3f54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

@ -1,4 +1,4 @@
# Copyright (C) 2018-2019 Intel Corporation # Copyright (C) 2018-2020 Intel Corporation
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
@ -50,10 +50,22 @@ def generate_ssh_keys():
ssh_dir = '{}/.ssh'.format(os.getenv('HOME')) ssh_dir = '{}/.ssh'.format(os.getenv('HOME'))
pidfile = os.path.join(ssh_dir, 'ssh.pid') 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: with open(pidfile, "w") as pid:
fcntl.flock(pid, fcntl.LOCK_EX) fcntl.flock(pid, fcntl.LOCK_EX)
try: try:
subprocess.run(['ssh-add {}/*'.format(ssh_dir)], shell = True, stderr = subprocess.PIPE) add_ssh_keys()
keys = subprocess.run(['ssh-add -l'], shell = True, keys = subprocess.run(['ssh-add -l'], shell = True,
stdout = subprocess.PIPE).stdout.decode('utf-8').split('\n') stdout = subprocess.PIPE).stdout.decode('utf-8').split('\n')
if 'has no identities' in keys[0]: if 'has no identities' in keys[0]:
@ -440,3 +452,4 @@ CACHES = {
} }
USE_CACHE = True USE_CACHE = True

@ -1,4 +1,5 @@
Put your SSH keys and SSH config here and they will be installed to the CVAT container. 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: 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: * Make sure that SSH keys have been added to the CVAT container:

Loading…
Cancel
Save