nginx-lens 0.1.8__tar.gz → 0.1.9__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.
- {nginx_lens-0.1.8/nginx_lens.egg-info → nginx_lens-0.1.9}/PKG-INFO +1 -1
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/README.md +17 -1
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/graph.py +3 -4
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/route.py +2 -1
- {nginx_lens-0.1.8 → nginx_lens-0.1.9/nginx_lens.egg-info}/PKG-INFO +1 -1
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/setup.py +1 -1
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/LICENSE +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/__init__.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/base.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/conflicts.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/dead_locations.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/diff.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/duplicates.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/empty_blocks.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/include.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/rewrite.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/route.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/unused.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/analyzer/warnings.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/__init__.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/analyze.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/cli.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/diff.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/health.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/include.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/logs.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/syntax.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/commands/tree.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/exporter/__init__.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/exporter/graph.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/exporter/html.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/exporter/markdown.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/nginx_lens.egg-info/SOURCES.txt +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/nginx_lens.egg-info/dependency_links.txt +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/nginx_lens.egg-info/entry_points.txt +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/nginx_lens.egg-info/requires.txt +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/nginx_lens.egg-info/top_level.txt +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/parser/__init__.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/parser/nginx_parser.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/pyproject.toml +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/setup.cfg +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/tests/test_conflicts.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/tests/test_duplicates.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/tests/test_empty_blocks.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/tests/test_health.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/tests/test_parser.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/upstream_checker/__init__.py +0 -0
- {nginx_lens-0.1.8 → nginx_lens-0.1.9}/upstream_checker/checker.py +0 -0
|
@@ -62,7 +62,23 @@
|
|
|
62
62
|
- **Python 3.8+**
|
|
63
63
|
- Linux/macOS (работает и под Windows WSL)
|
|
64
64
|
|
|
65
|
-
### Установка
|
|
65
|
+
### Установка с помощью bash-скрипта (Рекомендуется)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
wget https://raw.githubusercontent.com/shelovesuastra/nginx-lens/install-nginx-lens.sh
|
|
69
|
+
# или
|
|
70
|
+
curl https://raw.githubusercontent.com/shelovesuastra/nginx-lens/install-nginx-lens.sh
|
|
71
|
+
|
|
72
|
+
chmod +x install-nginx-lens.sh
|
|
73
|
+
|
|
74
|
+
./install-nginx-lens.sh
|
|
75
|
+
# или
|
|
76
|
+
sh ./install-nginx-lens.sh
|
|
77
|
+
# или
|
|
78
|
+
bash ./install-nginx-lens.sh
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Установка через PyPI
|
|
66
82
|
|
|
67
83
|
```bash
|
|
68
84
|
pipx install nginx-lens
|
|
@@ -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")
|
|
@@ -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"))
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="nginx-lens",
|
|
5
|
-
version="0.1.
|
|
5
|
+
version="0.1.9",
|
|
6
6
|
description="CLI-инструмент для анализа, визуализации и диагностики конфигураций Nginx",
|
|
7
7
|
author="Daniil Astrouski",
|
|
8
8
|
author_email="shelovesuastra@gmail.com",
|
|
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
|