README: two explicit install paths; Windows launchers pass --db and quote paths

- the Install section now leads with the release artifacts (the wheel via
  pipx/pip, the direct release URL, `gh release download` for the
  version-agnostic case, and the source archive) and keeps the git clone as
  the development path.  It finally names the launchers (./start.sh,
  start.bat): a clone needs no install, but the README never said how to start
  it while the Running section only showed the console script that an install
  provides.
- Windows: the USB section now says the .bat launchers mirror the shell ones
  and call the `python` command (Python 3 must be on PATH); the Install section
  carries the same note.
- start.bat: --db/DB was parsed and then never passed to the server; it is
  passed now, and --gsmtap-port is sent only for gsmtap capture (as start.sh
  already did).  Both .bat files passed values unquoted and stripped the
  quotes of pass-through options, so paths with spaces broke
  (--db "C:\My Data\...", --web-dir, --pcap, --output); values are quoted now
  and pass-through keeps the original quoting (argument assembly through
  delayed expansion).
- the launcher usage comments include the `disabled` capture mode.
- verified the argument assembly with Wine cmd.exe and an echo harness: the
  quoted paths survive, --db arrives, --gsmtap-port appears only for gsmtap;
  547 Python + 80 Node tests.
This commit is contained in:
catarrh committed 2026-10-20 23:15:54 +03:00
1 parent 25aa87ba1e
commit 65c8ab215b
5 files changed
+119 -47

No files matched your search

+50 -18
View File
@@ -94,26 +94,15 @@ No other dependencies. PCAP, GSMTAP, and hex dump output use only Python stdlib.
## Install ## Install
```sh There are two ways to get the analyser: install a release artifact (no git
git clone https://github.com/anttro/simtrace-analyser.git history), or clone the repository for development. Both bundle the same PWA.
cd simtrace-analyser
pip install pyusb
```
Or install the package into your environment: ### From a release (no git history)
```sh Everything is on the
pip install -e . [latest release](https://github.com/anttro/simtrace-analyser/releases/latest).
# then run: simtrace-analyser-server [opts]
# or: simtrace2-pysniff [opts]
```
### From a release (no git checkout) **Wheel** (recommended — an isolated install, the PWA is inside the package):
The release artifacts bundle the PWA, so an installed server serves the same UI
as a clone. Download the wheel from the
[latest release](https://github.com/anttro/simtrace-analyser/releases/latest)
and install it:
```sh ```sh
pipx install ./simtrace_analyser-2.7.10-py3-none-any.whl pipx install ./simtrace_analyser-2.7.10-py3-none-any.whl
@@ -123,12 +112,49 @@ pipx install ./simtrace_analyser-2.7.10-py3-none-any.whl
simtrace-analyser-server --capture gsmtap simtrace-analyser-server --capture gsmtap
``` ```
`pip` can also fetch the wheel straight from the release page: `pip` can also fetch the wheel straight from the release page (use the version
shown there):
```sh ```sh
pip install https://github.com/anttro/simtrace-analyser/releases/download/v2.7.10/simtrace_analyser-2.7.10-py3-none-any.whl pip install https://github.com/anttro/simtrace-analyser/releases/download/v2.7.10/simtrace_analyser-2.7.10-py3-none-any.whl
``` ```
With the GitHub CLI, download the latest wheel without knowing the version:
```sh
gh release download --pattern '*.whl'
pipx install ./simtrace_analyser-*.whl
```
**Source archive** — the *Source code (zip / tar.gz)* assets are the full tree
without the git history: unzip, `cd` into it and use the launchers below
(`./start.sh` on Linux/macOS, `start.bat` on Windows).
### From a git clone (development)
```sh
git clone https://github.com/anttro/simtrace-analyser.git
cd simtrace-analyser
./start.sh # Linux/macOS; on Windows: start.bat
```
The launchers add the checkout to `PYTHONPATH` and run
`python -m simtrace_analyser`, so no install step is needed for browsing and
GSMTAP capture; they accept the server's options (`./start.sh --capture direct
--port 8080`). Direct hardware capture needs **PyUSB** (`pip install pyusb`).
To get the console scripts (`simtrace-analyser-server`, `simtrace2-pysniff`)
install the package instead:
```sh
pip install -e .
simtrace-analyser-server --capture gsmtap
```
On Windows the `.bat` launchers run the `python` command, so Python 3 has to be
on `PATH` (check with `python --version`); direct USB capture additionally
needs the driver swap described in [USB Device Access](#usb-device-access).
## Running ## Running
### Analysis server + PWA (`simtrace-analyser-server`) ### Analysis server + PWA (`simtrace-analyser-server`)
@@ -397,6 +423,12 @@ Windows does not ship a libusb-compatible driver for SIMtrace2. Use
After that, `python -m simtrace2_pysniff` works identically to Linux. After that, `python -m simtrace2_pysniff` works identically to Linux.
The Windows launchers match their shell counterparts and pass every option
through: `start.bat --capture direct` starts the analyser server and
`sniff-start.bat` the capture utility. Both call the `python` command, so
Python 3 must be on `PATH` (verify with `python --version` in a new command
prompt).
## Utility CLI Options ## Utility CLI Options
``` ```
+53 -18
View File
@@ -99,26 +99,16 @@ SIM/UICC из UDP-потока GSMTAP (или импортирует файлы
## Установка ## Установка
```sh Есть два способа получить анализатор: установить артефакт релиза (без истории
git clone https://github.com/anttro/simtrace-analyser.git git) или склонировать репозиторий для разработки. В обоих случаях в комплекте
cd simtrace-analyser одна и та же PWA.
pip install pyusb
```
Или установите пакет в своё окружение: ### Из релиза (без истории git)
```sh Всё находится на странице
pip install -e . [последнего релиза](https://github.com/anttro/simtrace-analyser/releases/latest).
# затем запуск: simtrace-analyser-server [opts]
# или: simtrace2-pysniff [opts]
```
### Из релиза (без клонирования репозитория) **Wheel** (рекомендуется — изолированная установка, PWA внутри пакета):
Релизные артефакты содержат PWA внутри пакета, поэтому установленный сервер
отдаёт тот же интерфейс, что и при запуске из клона. Скачайте wheel со
страницы [последнего релиза](https://github.com/anttro/simtrace-analyser/releases/latest)
и установите его:
```sh ```sh
pipx install ./simtrace_analyser-2.7.10-py3-none-any.whl pipx install ./simtrace_analyser-2.7.10-py3-none-any.whl
@@ -128,12 +118,51 @@ pipx install ./simtrace_analyser-2.7.10-py3-none-any.whl
simtrace-analyser-server --capture gsmtap simtrace-analyser-server --capture gsmtap
``` ```
`pip` также может скачать wheel прямо со страницы релиза: `pip` также может скачать wheel прямо со страницы релиза (подставьте версию,
указанную там):
```sh ```sh
pip install https://github.com/anttro/simtrace-analyser/releases/download/v2.7.10/simtrace_analyser-2.7.10-py3-none-any.whl pip install https://github.com/anttro/simtrace-analyser/releases/download/v2.7.10/simtrace_analyser-2.7.10-py3-none-any.whl
``` ```
С GitHub CLI можно скачать wheel последнего релиза, не зная версии:
```sh
gh release download --pattern '*.whl'
pipx install ./simtrace_analyser-*.whl
```
**Архив исходников** — ассеты *Source code (zip / tar.gz)* содержат полное
дерево без истории git: распакуйте, перейдите в каталог и используйте скрипты
запуска ниже (`./start.sh` в Linux/macOS, `start.bat` в Windows).
### Из клона репозитория (для разработки)
```sh
git clone https://github.com/anttro/simtrace-analyser.git
cd simtrace-analyser
./start.sh # Linux/macOS; в Windows: start.bat
```
Скрипты запуска добавляют каталог в `PYTHONPATH` и запускают
`python -m simtrace_analyser`, поэтому для просмотра и захвата GSMTAP
установка не нужна; они принимают параметры сервера
(`./start.sh --capture direct --port 8080`). Для прямого захвата с
оборудования нужен **PyUSB** (`pip install pyusb`).
Чтобы получить консольные команды (`simtrace-analyser-server`,
`simtrace2-pysniff`), установите пакет:
```sh
pip install -e .
simtrace-analyser-server --capture gsmtap
```
В Windows скрипты `.bat` вызывают команду `python`, поэтому Python 3 должен
быть в `PATH` (проверьте `python --version`); для прямого захвата по USB
дополнительно нужна замена драйвера, описанная в разделе
[Доступ к USB-устройству](#доступ-к-usb-устройству).
## Запуск ## Запуск
### Анализирующий сервер + PWA (`simtrace-analyser-server`) ### Анализирующий сервер + PWA (`simtrace-analyser-server`)
@@ -407,6 +436,12 @@ sudo udevadm trigger
После этого `python -m simtrace2_pysniff` работает так же, как в Linux. После этого `python -m simtrace2_pysniff` работает так же, как в Linux.
Скрипты запуска для Windows соответствуют shell-версиям и передают все
параметры: `start.bat --capture direct` запускает сервер анализатора, а
`sniff-start.bat` — утилиту захвата. Оба вызывают команду `python`, поэтому
Python 3 должен быть в `PATH` (проверьте `python --version` в новом окне
команды).
## Параметры CLI утилиты ## Параметры CLI утилиты
``` ```
+7 -7
View File
@@ -59,7 +59,7 @@ if "%~1"=="--inactivity-timeout" (
shift shift
goto :parse_args goto :parse_args
) )
set "EXTRA_ARGS=!EXTRA_ARGS! %~1" set "EXTRA_ARGS=!EXTRA_ARGS! %1"
shift shift
goto :parse_args goto :parse_args
@@ -67,11 +67,11 @@ goto :parse_args
echo Starting simtrace2-pysniff... echo Starting simtrace2-pysniff...
set "ARGS=" set "ARGS="
if not "%GSMTAP%"=="" set "ARGS=!ARGS! --gsmtap %GSMTAP%" if not "%GSMTAP%"=="" set "ARGS=!ARGS! --gsmtap "%GSMTAP%""
if not "%PCAP%"=="" set "ARGS=!ARGS! --pcap %PCAP%" if not "%PCAP%"=="" set "ARGS=!ARGS! --pcap "%PCAP%""
if not "%OUTPUT%"=="" set "ARGS=!ARGS! --output %OUTPUT%" if not "%OUTPUT%"=="" set "ARGS=!ARGS! --output "%OUTPUT%""
if not "%FORMAT%"=="" set "ARGS=!ARGS! --format %FORMAT%" if not "%FORMAT%"=="" set "ARGS=!ARGS! --format "%FORMAT%""
if not "%INACTIVITY_TIMEOUT%"=="0" set "ARGS=!ARGS! --inactivity-timeout %INACTIVITY_TIMEOUT%" if not "%INACTIVITY_TIMEOUT%"=="0" set "ARGS=!ARGS! --inactivity-timeout "%INACTIVITY_TIMEOUT%""
set "PYTHONPATH=%~dp0" set "PYTHONPATH=%~dp0"
python -m simtrace2_pysniff %ARGS% %EXTRA_ARGS% python -m simtrace2_pysniff !ARGS! !EXTRA_ARGS!
+8 -3
View File
@@ -3,7 +3,7 @@ setlocal enabledelayedexpansion
:: simtrace-analyser-server startup script for Windows :: simtrace-analyser-server startup script for Windows
:: ::
:: Usage: start.bat [--capture gsmtap|direct] [--port PORT] [--db PATH] [--gsmtap-port PORT] :: Usage: start.bat [--capture gsmtap|direct|disabled] [--port PORT] [--db PATH] [--gsmtap-port PORT]
:: ::
:: Options set via environment variables act as defaults; CLI flags override them. :: Options set via environment variables act as defaults; CLI flags override them.
@@ -42,7 +42,7 @@ if "%~1"=="--gsmtap-port" (
shift shift
goto :parse_args goto :parse_args
) )
set "EXTRA_ARGS=!EXTRA_ARGS! %~1" set "EXTRA_ARGS=!EXTRA_ARGS! %1"
shift shift
goto :parse_args goto :parse_args
@@ -50,5 +50,10 @@ goto :parse_args
echo Starting simtrace-analyser-server... echo Starting simtrace-analyser-server...
echo PWA (simtrace-analyser) will be served at http://127.0.0.1:%PORT%/ echo PWA (simtrace-analyser) will be served at http://127.0.0.1:%PORT%/
set "ARGS=--capture "%CAPTURE%" --port "%PORT%""
if not "%DB%"=="" set "ARGS=!ARGS! --db "%DB%""
if /i "%CAPTURE%"=="gsmtap" set "ARGS=!ARGS! --gsmtap-port "%GSMTAP_PORT%""
set "ARGS=!ARGS! !EXTRA_ARGS!"
set "PYTHONPATH=%~dp0" set "PYTHONPATH=%~dp0"
python -m simtrace_analyser --capture %CAPTURE% --port %PORT% --gsmtap-port %GSMTAP_PORT% %EXTRA_ARGS% python -m simtrace_analyser !ARGS!
+1 -1
View File
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# simtrace-analyser-server startup script # simtrace-analyser-server startup script
# #
# Usage: ./start.sh [--capture gsmtap|direct] [--port PORT] [--db PATH] [--gsmtap-port PORT] # Usage: ./start.sh [--capture gsmtap|direct|disabled] [--port PORT] [--db PATH] [--gsmtap-port PORT]
# #
# Options set via environment variables act as defaults; CLI flags override them. # Options set via environment variables act as defaults; CLI flags override them.