nginx-lens 0.1.8__py3-none-any.whl → 0.2.0__py3-none-any.whl
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.
- analyzer/route.py +1 -1
- commands/graph.py +3 -4
- commands/route.py +2 -1
- {nginx_lens-0.1.8.dist-info → nginx_lens-0.2.0.dist-info}/METADATA +1 -1
- {nginx_lens-0.1.8.dist-info → nginx_lens-0.2.0.dist-info}/RECORD +9 -9
- {nginx_lens-0.1.8.dist-info → nginx_lens-0.2.0.dist-info}/WHEEL +0 -0
- {nginx_lens-0.1.8.dist-info → nginx_lens-0.2.0.dist-info}/entry_points.txt +0 -0
- {nginx_lens-0.1.8.dist-info → nginx_lens-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {nginx_lens-0.1.8.dist-info → nginx_lens-0.2.0.dist-info}/top_level.txt +0 -0
analyzer/route.py
CHANGED
|
@@ -33,7 +33,7 @@ def find_route(tree, url: str) -> Optional[Dict[str, Any]]:
|
|
|
33
33
|
if score > best_server_score:
|
|
34
34
|
best_server = d
|
|
35
35
|
best_server_score = score
|
|
36
|
-
if not best_server:
|
|
36
|
+
if not best_server or best_server_score < 2:
|
|
37
37
|
return None
|
|
38
38
|
# 2. Внутри server ищем лучший location (longest prefix match)
|
|
39
39
|
best_loc = None
|
commands/graph.py
CHANGED
|
@@ -29,9 +29,8 @@ def graph(
|
|
|
29
29
|
# Для каждого server/location строим маршрут
|
|
30
30
|
def walk(d, chain, upstreams):
|
|
31
31
|
if d.get('block') == 'server':
|
|
32
|
-
srv = d.get('arg','') or '[no arg]'
|
|
33
32
|
for sub in d.get('directives', []):
|
|
34
|
-
walk(sub, chain + [('server',
|
|
33
|
+
walk(sub, chain + [('server', None)], upstreams)
|
|
35
34
|
elif d.get('block') == 'location':
|
|
36
35
|
loc = d.get('arg','')
|
|
37
36
|
for sub in d.get('directives', []):
|
|
@@ -81,10 +80,10 @@ def graph(
|
|
|
81
80
|
server_val = route[0][1]
|
|
82
81
|
server_block = None
|
|
83
82
|
for d in tree.directives:
|
|
84
|
-
if d.get('block') == 'server'
|
|
83
|
+
if d.get('block') == 'server':
|
|
85
84
|
server_block = d
|
|
86
85
|
break
|
|
87
|
-
label = get_server_label(server_block) if server_block else
|
|
86
|
+
label = get_server_label(server_block) if server_block else 'default'
|
|
88
87
|
server_file = server_block.get('__file__') if server_block else None
|
|
89
88
|
t.append(f"[", style="white")
|
|
90
89
|
t.append(f"server: {label}", style="bold blue")
|
commands/route.py
CHANGED
|
@@ -60,4 +60,5 @@ def route(
|
|
|
60
60
|
text += f"[bold]proxy_pass:[/bold] {proxy_pass}\n"
|
|
61
61
|
console.print(Panel(text, title="Route", style="green"))
|
|
62
62
|
return
|
|
63
|
-
|
|
63
|
+
search_dir = os.path.dirname(configs[0]) if configs else '/etc/nginx'
|
|
64
|
+
console.print(Panel(f"Маршрут для {url} не найден ни в одном .conf в {search_dir}", style="yellow"))
|
|
@@ -7,31 +7,31 @@ analyzer/duplicates.py,sha256=jpy_6k-BzWxaXFt2Wb3rlulIXUEzbFe9xYRm7rWR50U,1215
|
|
|
7
7
|
analyzer/empty_blocks.py,sha256=7Zu4-5I5PS3bjhH0Ppq1CvM7rMTeRIc4fHx5n5vkMIw,517
|
|
8
8
|
analyzer/include.py,sha256=FhKR4VsogLknykjLD2N8jX9OtwxZcWik5oPpvp-_luE,2465
|
|
9
9
|
analyzer/rewrite.py,sha256=-jSLLG1jqmGU-dXWvU6NHCW6muB8Lfro6fXX1tDCHCQ,1834
|
|
10
|
-
analyzer/route.py,sha256=
|
|
10
|
+
analyzer/route.py,sha256=71dkmQaTrHqDTf4Up5gAsrgmgktNpXqWmxr7-0RAVtg,2370
|
|
11
11
|
analyzer/unused.py,sha256=Ixzv0bPsw9IafblVwLiAOgugdg2dGu1MJDtuoqzPZiY,1066
|
|
12
12
|
analyzer/warnings.py,sha256=zC36QMvegA2eQPvZ-P1eysrX_kXHx5A1MUKHKKNvG5c,5784
|
|
13
13
|
commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
commands/analyze.py,sha256=W6begSgXNjgKJGoGeguR3WKgHPLkClWXxxpDcqvsJdc,8343
|
|
15
15
|
commands/cli.py,sha256=9HwDJ-po5al0ceb4Wkyw5F2wzqxbJTo0CbHQ2AQ8obo,722
|
|
16
16
|
commands/diff.py,sha256=C7gRIWh6DNWHzjiQBPVTn-rZ40m2KCY75Zd6Q4URJIE,2076
|
|
17
|
-
commands/graph.py,sha256=
|
|
17
|
+
commands/graph.py,sha256=xB6KjXBkLmm5gII3e-5BMRGO7WeTwc7EFxRGzYgnme4,5947
|
|
18
18
|
commands/health.py,sha256=SuD2gOeMf9ZaoUfeqx1Nip0xQDBkDus6z872Fhw2Z9w,1682
|
|
19
19
|
commands/include.py,sha256=5PTYG5C00-AlWfIgpQXLq9E7C9yTFSv7HrZkM5ogDps,2224
|
|
20
20
|
commands/logs.py,sha256=RkPUdIpbO9dOVL56lemreYRuAjMjcqqMxRCKOFv2gC4,3691
|
|
21
|
-
commands/route.py,sha256=
|
|
21
|
+
commands/route.py,sha256=GzpHUqOwDOzhWlKcNf177Vq4OB6g--_8npZXPMDRNGg,3034
|
|
22
22
|
commands/syntax.py,sha256=ZWFdaL8LVv9S694wlk2aV3HJKb0OSKjw3wNgTlNvFR8,3418
|
|
23
23
|
commands/tree.py,sha256=mDfx0Aeg1EDQSYQoJ2nJIkSd_uP7ZR7pEqy7Cw3clQ0,2161
|
|
24
24
|
exporter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
exporter/graph.py,sha256=WYUrqUgCaK6KihgxAcRHaQn4oMo6b7ybC8yb_36ZIsA,3995
|
|
26
26
|
exporter/html.py,sha256=uquEM-WvBt2aV9GshgaI3UVhYd8sD0QQ-OmuNtvYUdU,798
|
|
27
27
|
exporter/markdown.py,sha256=_0mXQIhurGEZ0dO-eq9DbsuKNrgEDIblgtL3DAgYNo8,724
|
|
28
|
-
nginx_lens-0.
|
|
28
|
+
nginx_lens-0.2.0.dist-info/licenses/LICENSE,sha256=g8QXKdvZZC56rU8E12vIeYF6R4jeTWOsblOnYAda3K4,1073
|
|
29
29
|
parser/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
30
|
parser/nginx_parser.py,sha256=Sa9FtGAkvTqNzoehBvgLUWPJHLLIZYWH9ugSHW50X8s,3699
|
|
31
31
|
upstream_checker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
32
|
upstream_checker/checker.py,sha256=9-6CMUTN7gXUACP8EwX722QogfujZyV-WWWUeM3a79k,455
|
|
33
|
-
nginx_lens-0.
|
|
34
|
-
nginx_lens-0.
|
|
35
|
-
nginx_lens-0.
|
|
36
|
-
nginx_lens-0.
|
|
37
|
-
nginx_lens-0.
|
|
33
|
+
nginx_lens-0.2.0.dist-info/METADATA,sha256=lLuwZ7f3S8BLDun8sm25Oq-9S8jNux_PPOnL_AIkcqg,520
|
|
34
|
+
nginx_lens-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
35
|
+
nginx_lens-0.2.0.dist-info/entry_points.txt,sha256=qEcecjSyLqcJjbIVlNlTpqAhPqDyaujUV5ZcBTAr3po,48
|
|
36
|
+
nginx_lens-0.2.0.dist-info/top_level.txt,sha256=mxLJO4rZg0rbixVGhplF3fUNFs8vxDIL25ronZNvRy4,51
|
|
37
|
+
nginx_lens-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|