Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor fingerprint check to use ssh info from gitlab project instead of hardcoded one in config #40

Open
Salamek opened this issue Nov 19, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@Salamek
Copy link
Owner

Salamek commented Nov 19, 2022

Issue

Currently when checking fingerprint, we use GITLAB_SSH config option with hostname:port of gitlab SSH server, but gitlab API actually returns a ssh URI for created/existing project. Issue is that project creation is handled in async task (celery) and no user interaction is possible, that means that mirror has to already exist in database when task is triggered...

@Salamek Salamek added the enhancement New feature or request label Nov 19, 2022
@cenk1cenk2
Copy link
Contributor

cenk1cenk2 commented Apr 1, 2023

Hello @Salamek ,

I suppose the error I am getting whenever I try to update any of the existing configuration is related to this.

gitlab-tools-gitlab-tools-1  | [app] [2023-04-02 01:35:02,180] ERROR in app: Exception on /fingerprint/fingerprint-check [POST]
gitlab-tools-gitlab-tools-1  | [app] Traceback (most recent call last):
gitlab-tools-gitlab-tools-1  | [app]   File "/opt/gitlab-tools/venv/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
gitlab-tools-gitlab-tools-1  | [app]     response = self.full_dispatch_request()
gitlab-tools-gitlab-tools-1  | [app]   File "/opt/gitlab-tools/venv/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
gitlab-tools-gitlab-tools-1  | [app]     rv = self.handle_user_exception(e)
gitlab-tools-gitlab-tools-1  | [app]   File "/opt/gitlab-tools/venv/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
gitlab-tools-gitlab-tools-1  | [app]     reraise(exc_type, exc_value, tb)
gitlab-tools-gitlab-tools-1  | [app]   File "/opt/gitlab-tools/venv/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
gitlab-tools-gitlab-tools-1  | [app]     raise value
gitlab-tools-gitlab-tools-1  | [app]   File "/opt/gitlab-tools/venv/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
gitlab-tools-gitlab-tools-1  | [app]     rv = self.dispatch_request()
gitlab-tools-gitlab-tools-1  | [app]   File "/opt/gitlab-tools/venv/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
gitlab-tools-gitlab-tools-1  | [app]     return self.view_functions[rule.endpoint](**req.view_args)
gitlab-tools-gitlab-tools-1  | [app]   File "/opt/gitlab-tools/venv/lib/python3.9/site-packages/flask_login/utils.py", line 272, in decorated_view
gitlab-tools-gitlab-tools-1  | [app]     return func(*args, **kwargs)
gitlab-tools-gitlab-tools-1  | [app]   File "./gitlab_tools/views/fingerprint/index.py", line 163, in check_hostname_fingerprint
gitlab-tools-gitlab-tools-1  | [app]     return check_fingerprint_hostname(hostname)
gitlab-tools-gitlab-tools-1  | [app]   File "./gitlab_tools/views/fingerprint/index.py", line 39, in check_fingerprint_hostname
gitlab-tools-gitlab-tools-1  | [app]     found, remote_server_key = check_hostname(hostname, known_hosts_path)
gitlab-tools-gitlab-tools-1  | [app]   File "./gitlab_tools/tools/fingerprint.py", line 31, in check_hostname
gitlab-tools-gitlab-tools-1  | [app]     remote_server_key = get_remote_server_key_for_hostname(hostname)
gitlab-tools-gitlab-tools-1  | [app]   File "./gitlab_tools/tools/fingerprint.py", line 12, in get_remote_server_key_for_hostname
gitlab-tools-gitlab-tools-1  | [app]     return get_remote_server_key(hostname)
gitlab-tools-gitlab-tools-1  | [app]   File "./gitlab_tools/tools/crypto.py", line 72, in get_remote_server_key
gitlab-tools-gitlab-tools-1  | [app]     my_socket.connect((ip, port))
gitlab-tools-gitlab-tools-1  | [app] socket.gaierror: [Errno -2] Name or service not known

Is there any workaround for this?

@Salamek
Copy link
Owner Author

Salamek commented Apr 2, 2023

@cenk1cenk2 did you set

GITLAB_SSH = 'gitlab.your-domain.com:22'

in your /etc/gitlab-tools/config.yml ? as is mentioned in 1.3 release notes?

cenk1cenk2 added a commit to cenk1cenk2/docker-gitlab-tools that referenced this issue Apr 2, 2023
@cenk1cenk2
Copy link
Contributor

Yeah, sorry I suppose I have missed one and failed to read the release note since directly updated to 1.4.4.

Sorry for taking your time the reply but I really do appreciate it!

Have a very nice day @Salamek!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants