nginx-lens 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nginx-lens might be problematic. Click here for more details.
- {nginx_lens-0.2.2/nginx_lens.egg-info → nginx_lens-0.2.3}/PKG-INFO +1 -1
- {nginx_lens-0.2.2 → nginx_lens-0.2.3/nginx_lens.egg-info}/PKG-INFO +1 -1
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/setup.py +1 -1
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/upstream_checker/checker.py +22 -5
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/LICENSE +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/README.md +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/__init__.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/base.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/conflicts.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/dead_locations.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/diff.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/duplicates.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/empty_blocks.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/include.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/rewrite.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/route.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/unused.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/warnings.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/__init__.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/analyze.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/cli.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/diff.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/graph.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/health.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/include.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/logs.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/route.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/syntax.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/tree.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/exporter/__init__.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/exporter/graph.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/exporter/html.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/exporter/markdown.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/nginx_lens.egg-info/SOURCES.txt +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/nginx_lens.egg-info/dependency_links.txt +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/nginx_lens.egg-info/entry_points.txt +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/nginx_lens.egg-info/requires.txt +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/nginx_lens.egg-info/top_level.txt +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/parser/__init__.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/parser/nginx_parser.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/pyproject.toml +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/setup.cfg +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/tests/test_conflicts.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/tests/test_duplicates.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/tests/test_empty_blocks.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/tests/test_health.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/tests/test_parser.py +0 -0
- {nginx_lens-0.2.2 → nginx_lens-0.2.3}/upstream_checker/__init__.py +0 -0
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="nginx-lens",
|
|
5
|
-
version="0.2.
|
|
5
|
+
version="0.2.3",
|
|
6
6
|
description="CLI-инструмент для анализа, визуализации и диагностики конфигураций Nginx",
|
|
7
7
|
author="Daniil Astrouski",
|
|
8
8
|
author_email="shelovesuastra@gmail.com",
|
|
@@ -7,9 +7,15 @@ from typing import Dict, List
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def check_tcp(address: str, timeout: float, retries: int) -> bool:
|
|
10
|
-
"""
|
|
11
|
-
|
|
10
|
+
"""
|
|
11
|
+
Проверка доступности сервера по TCP.
|
|
12
|
+
Ignores extra upstream options like 'max_fails' or 'fail_timeout'.
|
|
13
|
+
"""
|
|
14
|
+
# Берем только host:port, игнорируем параметры
|
|
15
|
+
host_port = address.split()[0]
|
|
16
|
+
host, port = host_port.split(":")
|
|
12
17
|
port = int(port)
|
|
18
|
+
|
|
13
19
|
for _ in range(retries):
|
|
14
20
|
try:
|
|
15
21
|
with socket.create_connection((host, port), timeout=timeout):
|
|
@@ -20,9 +26,14 @@ def check_tcp(address: str, timeout: float, retries: int) -> bool:
|
|
|
20
26
|
|
|
21
27
|
|
|
22
28
|
def check_http(address: str, timeout: float, retries: int) -> bool:
|
|
23
|
-
"""
|
|
24
|
-
|
|
29
|
+
"""
|
|
30
|
+
Проверка доступности сервера по HTTP (GET /).
|
|
31
|
+
Ignores extra upstream options like 'max_fails' or 'fail_timeout'.
|
|
32
|
+
"""
|
|
33
|
+
host_port = address.split()[0]
|
|
34
|
+
host, port = host_port.split(":")
|
|
25
35
|
port = int(port)
|
|
36
|
+
|
|
26
37
|
for _ in range(retries):
|
|
27
38
|
try:
|
|
28
39
|
conn = http.client.HTTPConnection(host, port, timeout=timeout)
|
|
@@ -38,10 +49,16 @@ def check_http(address: str, timeout: float, retries: int) -> bool:
|
|
|
38
49
|
return False
|
|
39
50
|
|
|
40
51
|
|
|
41
|
-
def check_upstreams(
|
|
52
|
+
def check_upstreams(
|
|
53
|
+
upstreams: Dict[str, List[str]],
|
|
54
|
+
timeout: float = 2.0,
|
|
55
|
+
retries: int = 1,
|
|
56
|
+
mode: str = "tcp"
|
|
57
|
+
) -> Dict[str, List[dict]]:
|
|
42
58
|
"""
|
|
43
59
|
Проверяет доступность upstream-серверов.
|
|
44
60
|
mode: "tcp" (по умолчанию) или "http"
|
|
61
|
+
|
|
45
62
|
Возвращает:
|
|
46
63
|
{
|
|
47
64
|
"backend": [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|