diff --git a/.gitignore b/.gitignore index c2658d7..ac16a2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ node_modules/ +.venv/ +__pycache__/ +*.egg-info/ +dist/ +build/ diff --git a/README.md b/README.md index e25d5d2..b599a23 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,37 @@ -# OTAMan — APDU Helper & Secured Packet Builder, SIM OTA in PWA +# OTAMan — SIM OTA toolkit: PWA + local card server -Standalone offline HTML/JS tool for building APDU commands for SIM, USIM, and GlobalPlatform RAM, assembling secure packets per ETSI TS 102 225, and constructing BER-TLV command scripts per ETSI TS 102 226. +OTAMan is an offline HTML/JS PWA for building APDU commands (SIM, USIM, GlobalPlatform RAM), assembling SCP80 secured packets per ETSI TS 102 225, and constructing BER-TLV command scripts per ETSI TS 102 226. A bundled [`pysim-otaman-server`](pysim_otaman_server/) exposes a local HTTP API over pySim for live card operations: file manager, raw APDU, SIM Toolkit menu browsing, and OTA (SCP80) delivery. -Open `index.html` in any modern browser. No server required. +**Demo:** [otaman.atroshin.ru](https://otaman.atroshin.ru) — the PWA alone, for experimenting. Install the server (below) for card-reader functions. -**Demo:** [otaman.atroshin.ru](https://otaman.atroshin.ru) +## Quick start + +**PWA only (client-side tools):** open `frontend/index.html` in any browser, or serve `frontend/` with any static server. No Python required. + +**Full (PWA + card server):** + +```sh +git clone https://github.com/anttro/otaman.git +cd otaman +./setup.sh # or setup.bat on Windows — creates .venv, installs pysim + server +./start.sh # or start.bat — starts the server (it serves the PWA too) +``` + +Then open http://127.0.0.1:8080 — the UI and API share one origin, so no CORS or browser-permission setup is needed. ## Build Tailwind CSS is used for styling. After cloning, rebuild the CSS: ```sh +cd frontend npm install npm run build ``` ## Interface -Six tabs, each with a form and a "Сгенерировать" button. +Five tabs, each with a form and a "Generate" button. --- @@ -383,7 +397,7 @@ Swaps nibble pairs of an even-length hex string. ## Card Reader (pySim integration) -Connects to a local [pysim-otaman-server](https://github.com/anttro/pysim-otaman-server) for live card operations. +Connects to the bundled [`pysim-otaman-server`](pysim_otaman_server/) for live card operations. > **Browser restriction:** when the PWA is served from a public HTTPS host, reaching the local server (`http://127.0.0.1:8080`) requires two things: the server must send `Access-Control-Allow-Private-Network: true` (pysim-otaman-server ≥ 1.6.1 does this automatically), and the browser must be allowed to access the local network — in Chrome/Edge/Vivaldi: Site settings → Local network access → allow the site (or accept the permission prompt). Without the browser permission, the request to `127.0.0.1` is blocked before any preflight is sent. @@ -459,6 +473,60 @@ OTAMan is a Progressive Web App and can be installed for offline use. Use the ** - Service worker pre-caches all assets on first visit - App icons at 192×192 and 512×512 +## Server (pysim-otaman-server) + +The bundled Python server wraps [pySim](https://osmocom.org/projects/pysim/wiki) and serves both the OTAMan PWA (from `frontend/`) and a JSON API under `/api/*`. + +### Prerequisites + +- **Python 3.8+** with `pip`, and **Git** +- **Smart card reader** (PC/SC or serial/FTDI) — PC/SC is preferable (`pcsc-lite` + `ccid` on Linux) +- **Windows** — use Python 3.10–3.13 (3.13 recommended): `pyscard` ships precompiled wheels for these versions. On 3.9 / 3.14 it builds from source (needs MSVC C++ Build Tools). The SMPP bridge (`smpp.twisted3`) is intentionally skipped on Windows. + +### Scripts + +| Script | What it does | +|--------|-------------| +| `setup.sh` / `setup.bat` | Creates `.venv/`, installs pysim and the server. Run once after cloning. | +| `start.sh` / `start.bat` | Starts the server from the venv (serves the PWA + API on `:8080`). | + +`start.sh` auto-detects the reader (PC/SC if `pcscd` is running, else `/dev/ttyUSB0`); `start.bat` always uses `-p 0` (PC/SC is built into Windows). If no reader is found the server still starts ("Reader: none") — initialize the card later via the **Equip** button. + +### Manual installation + +```sh +python3 -m venv .venv +source .venv/bin/activate # Linux/macOS (Windows: .venv\Scripts\activate) +pip install git+https://github.com/osmocom/pysim.git +pip install -e . # editable — serves frontend/ from the source tree +pysim-otaman-server --http-port 8080 +``` + +### CLI options + +| Option | Description | +|--------|-------------| +| `--http-host` | Bind address (default: `127.0.0.1`) | +| `--http-port` | TCP port (default: `8080`) | +| `--web-dir` | Directory with PWA static files (default: `/frontend`) | +| `-p` / `--pcsc-device` | PC/SC reader slot number | +| `-d` / `--device` | Serial device path | +| `--no-card-init` | Skip card init to preserve the CAT session (no file manager) | +| `--apdu-trace` | Log APDU-level traces to stderr | +| `--log-requests` | Log request/response payloads to stderr | +| `--sms-oa` / `--sms-sm-sc` | SMS-DELIVER originating address / SM-SC for PoR-in-submit | +| `--terminal-profile` | TERMINAL PROFILE payload hex (default 10-byte GSM profile) | +| `--poll-interval` | Idle interval before automatic STATUS polling (default 30s) | + +### Troubleshooting + +- **"Failed to establish context: Access denied"** — `pcscd` isn't running or the user lacks permission: `sudo systemctl enable --now pcscd && sudo usermod -a -G pcscd $USER`. +- **"device file /dev/ttyUSB0 does not exist"** — no serial reader; connect a USB reader or pass `-d` explicitly. The server still starts without a reader. + +### API reference + +See [docs/api.md](docs/api.md) for the full endpoint reference. + ## Theme Dark theme is supported. The app follows the OS preference on first visit, and a manual toggle button (🌙/☀️) at the top-right corner persists the choice in `localStorage`. diff --git a/README_RUS.md b/README_RUS.md index 6b93338..6fb28b3 100644 --- a/README_RUS.md +++ b/README_RUS.md @@ -1,23 +1,37 @@ -# OTAMan — APDU Helper & Secured Packet Builder, SIM OTA в PWA +# OTAMan — SIM OTA toolkit: PWA + локальный сервер карт -Автономный offline-инструмент на HTML/JS для создания APDU-команд для SIM, USIM и GlobalPlatform RAM, сборки защищённых пакетов по ETSI TS 102 225 и построения BER-TLV скриптов по ETSI TS 102 226. +OTAMan — автономный offline-PWA (HTML/JS) для создания APDU-команд (SIM, USIM, GlobalPlatform RAM), сборки защищённых пакетов SCP80 по ETSI TS 102 225 и построения BER-TLV скриптов по ETSI TS 102 226. В комплекте — [`pysim-otaman-server`](pysim_otaman_server/) — локальный HTTP-сервер поверх pySim для работы с картой: файловый менеджер, сырые APDU, меню SIM Toolkit и доставка OTA. -Откройте `index.html` в любом современном браузере. Сервер не требуется. +**Демо:** [otaman.atroshin.ru](https://otaman.atroshin.ru) — только PWA, для экспериментов. Для функций картридера установите сервер (ниже). -**Демо:** [otaman.atroshin.ru](https://otaman.atroshin.ru) +## Быстрый старт + +**Только PWA (клиентские функции):** откройте `frontend/index.html` в любом браузере или раздайте `frontend/` любым статическим сервером. Python не нужен. + +**Полная установка (PWA + сервер карт):** + +```sh +git clone https://github.com/anttro/otaman.git +cd otaman +./setup.sh # или setup.bat в Windows — создаёт .venv, ставит pysim + сервер +./start.sh # или start.bat — запускает сервер (он же раздаёт PWA) +``` + +Затем откройте http://127.0.0.1:8080 — интерфейс и API на одном origin, поэтому CORS и разрешения браузера не нужны. ## Сборка Для стилей используется Tailwind CSS. После клонирования пересоберите CSS: ```sh +cd frontend npm install npm run build ``` ## Интерфейс -Шесть вкладок, каждая с формой и кнопкой «Generate APDU». +Пять вкладок, каждая с формой и кнопкой «Generate APDU». --- @@ -382,7 +396,7 @@ PWA проверяет версию сервера при подключении ## Card Reader (интеграция с pySim) -Подключение к локальному [pysim-otaman-server](https://github.com/anttro/pysim-otaman-server) для работы с картой. +Подключение к встроенному [`pysim-otaman-server`](pysim_otaman_server/) для работы с картой. > **Ограничение браузера:** если PWA раздаётся с публичного HTTPS-хоста, для доступа к локальному серверу (`http://127.0.0.1:8080`) нужны два условия: сервер должен отправлять `Access-Control-Allow-Private-Network: true` (pysim-otaman-server ≥ 1.6.1 делает это автоматически), и браузеру должно быть разрешено обращаться к локальной сети — в Chrome/Edge/Vivaldi: Настройки сайта → Доступ к локальной сети → разрешить сайт (или подтвердить запрос). Без разрешения браузера запрос к `127.0.0.1` блокируется ещё до отправки preflight. @@ -407,4 +421,56 @@ PWA проверяет версию сервера при подключении ### Подсказки команд -Введите имя команды в **pySim command line**. Подсказки по использованию появляются через 300 мс. Автодополнение команд — над полем ввода. \ No newline at end of file +Введите имя команды в **pySim command line**. Подсказки по использованию появляются через 300 мс. Автодополнение команд — над полем ввода. + +## Сервер (pysim-otaman-server) + +Встроенный Python-сервер оборачивает [pySim](https://osmocom.org/projects/pysim/wiki) и раздаёт как PWA (из `frontend/`), так и JSON API по `/api/*`. + +### Требования + +- **Python 3.8+** с `pip`, и **Git** +- **Смарт-картридер** (PC/SC или serial/FTDI) — предпочтителен PC/SC (`pcsc-lite` + `ccid` на Linux) +- **Windows** — используйте Python 3.10–3.13 (рекомендуется 3.13): у `pyscard` есть готовые wheel. На 3.9 / 3.14 он собирается из исходников (нужны MSVC C++ Build Tools). SMPP-мост (`smpp.twisted3`) в Windows сознательно не ставится. + +### Скрипты + +| Скрипт | Назначение | +|--------|-------------| +| `setup.sh` / `setup.bat` | Создаёт `.venv/`, ставит pysim и сервер. Запускать один раз после клонирования. | +| `start.sh` / `start.bat` | Запускает сервер из venv (раздаёт PWA + API на `:8080`). | + +`start.sh` автоопределяет ридер (PC/SC при работающем `pcscd`, иначе `/dev/ttyUSB0`); `start.bat` всегда использует `-p 0`. Без ридера сервер всё равно стартует («Reader: none») — карту можно инициализировать позже кнопкой **Equip**. + +### Ручная установка + +```sh +python3 -m venv .venv +source .venv/bin/activate # Linux/macOS (Windows: .venv\Scripts\activate) +pip install git+https://github.com/osmocom/pysim.git +pip install -e . # editable — раздаёт frontend/ из исходного дерева +pysim-otaman-server --http-port 8080 +``` + +### Параметры CLI + +| Параметр | Описание | +|----------|-------------| +| `--http-host` | Адрес привязки (по умолчанию `127.0.0.1`) | +| `--http-port` | Порт (по умолчанию `8080`) | +| `--web-dir` | Каталог со статикой PWA (по умолчанию `/frontend`) | +| `-p` / `--pcsc-device` | Номер слота PC/SC | +| `-d` / `--device` | Путь к serial-устройству | +| `--no-card-init` | Пропустить инициализацию карты (сохранить CAT-сессию) | +| `--apdu-trace` | Лог APDU-трафика в stderr | +| `--log-requests` | Лог запросов/ответов в stderr | +| `--poll-interval` | Интервал автоопроса STATUS (по умолчанию 30с) | + +### Устранение неполадок + +- **"Failed to establish context: Access denied"** — `pcscd` не запущен или нет прав: `sudo systemctl enable --now pcscd && sudo usermod -a -G pcscd $USER`. +- **"device file /dev/ttyUSB0 does not exist"** — нет serial-ридера; подключите USB-ридер или укажите `-d`. Сервер всё равно стартует без ридера. + +### Справочник API + +Полный справочник endpoints: [docs/api.md](docs/api.md). \ No newline at end of file diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..6ada783 --- /dev/null +++ b/docs/api.md @@ -0,0 +1,268 @@ +# pysim-otaman-server — HTTP API reference + +The server exposes a JSON HTTP API under `/api/*`. All responses carry +`Access-Control-Allow-Origin: *` (plus `Access-Control-Allow-Private-Network: true` +on the preflight), so the API is reachable from a separately-hosted PWA. + +## Version compatibility + +| Server | PWA (OTAMan) | Status | +|--------|-------------|--------| +| 1.x.x | 1.x.x | ✅ Compatible | +| 0.x.x | 1.x.x | ❌ Outdated — update server | +| 2.x.x+ | 1.x.x | ⚠️ Server newer — update PWA | + +The server reports its version via `GET /api/version`. The PWA checks this on +connect and warns if versions are incompatible. + +## Endpoints + +| Endpoint | Method | Purpose | +|----------|--------|---------| +| `/api/version` | GET | Server version string | +| `/api/status` | GET | Card reader + card info + current selection | +| `/api/command` | POST | pySim command (equip, status, tree, etc.) | +| `/api/commands` | GET | List available pySim commands | +| `/api/tree` | POST | File tree browser for given FID/name | +| `/api/select` | POST | Select a file by name or FID | +| `/api/read` | POST | Read file content | +| `/api/write` | POST | Write raw hex data to a file | +| `/api/apdu` | POST | Raw APDU send | +| `/api/help` | POST | pySim help for a given command | +| `/api/send-ota` | POST | SCP80 OTA secured packet delivery | +| `/api/sp-verify` | POST | Verify secured packet against pySim reference | +| `/api/menu` | GET | Current STK menu (title + items + active) | +| `/api/menu-select` | POST | ENVELOPE(Menu Selection) with item_id | +| `/api/menu-respond` | POST | TERMINAL RESPONSE for paused STK command | +| `/api/stk-status` | GET | STK session state (active/pending/type) | +| `/api/events` | GET | Event list from SET UP EVENT LIST | +| `/api/event-send` | POST | Send ENVELOPE(Event Download) | +| `/api/proactive-log` | GET | Last 50 proactive commands | +| `/api/status-poll` | POST | Manual STATUS poll + FETCH if 91XX | +| `/api/rescue` | POST | Re-send TERMINAL PROFILE to recover CAT session | +| `/api/poll-status` | GET | Background STATUS polling state | +| `/api/poll-toggle` | POST | Enable/disable background polling | +| `/api/pli-qualifiers` | GET | List of qualifier codes with descriptions | +| `/api/pli-dict` | GET | Current dictionary (hex values per qualifier) | +| `/api/pli-dict` | POST | Update dictionary entries | + +## Endpoint details + +### `GET /api/version` + +Returns server version for compatibility checking. + +**Example response:** +```json +{"version": "1.7.0"} +``` + +### `GET /api/status` + +Card reader, card type, current selection, and card state. + +### `GET /api/commands` + +List all available shell commands for the current card profile. + +### `POST /api/command` + +Execute any pysim-shell command. + +```json +{"cmd": "select MF"} +``` + +Returns: + +```json +{"output": "..."} +``` + +### `POST /api/apdu` + +Send a raw APDU to the card. + +```json +{"apdu": "00A4040000..."} +``` + +Returns: + +```json +{"response": "...", "sw": "9000"} +``` + +### `POST /api/help` + +Get structured help for a shell command. + +```json +{"cmd": "apdu"} +``` + +Returns: +```json +{"usage": "apdu [-h] [--expect-sw EXPECT_SW] [--raw] APDU", "description": "...", "args": [{"name": "APDU", "type": "positional", "help": "..."}]} +``` + +### `POST /api/send-ota` + +Send an OTA command (SCP80) to the card via SMS-PP-DOWNLOAD ENVELOPE. +The secured packet is delivered in an SMS-DELIVER TPDU wrapped in an ENVELOPE command. + +**Request body:** +```json +{ + "sp": "00201516011515b00000...", + "spi1": "16", + "spi2": "01", + "kic": "15", + "kid": "15", + "tar": "b00000", + "cntr": "0000000001", + "kicKey": "D6FCC023...", + "kidKey": "1B07E7E0..." +} +``` + +**Response (delivery PoR):** +```json +{"success": true, "sw": "9000", "response_data": "027100000e0a...", + "por": {"response_status": "por_ok", "tar": "B00000", "pcntr": 0, + "decoded": {"number_of_commands": 1, "last_status_word": "6e00", + "last_response_data": ""}}} +``` + +**Response (submit PoR):** PoR is extracted from the SMS-SUBMIT TPDU +fetched via a proactive command (FETCH). The response contains the +same `por` structure if decoding succeeds. + +The SPI2 `por_in_submit` bit (0x20) selects submit-mode PoR. + +### `POST /api/sp-verify` + +Cross-check a secured packet against pySim's `OtaDialectSms.encode_cmd` +reference. Returns the JS-generated packet, pySim reference, a match flag, +and the decoded SPI fields. + +```json +{"spi1": "16", "spi2": "01", "kic": "15", "kid": "15", "tar": "b00000", + "cntr": "0000000001", "apdu": "00a40000023f00", + "kicKey": "D6FCC023...", "kidKey": "1B07E7E0..."} +``` + +**Response:** +```json +{"js_sp": "...", "py_sp": "...", "match": true, + "diffs": [], "spi": {"counter": "counter_must_be_higher", ...}} +``` + +### `GET /api/menu` + +Returns the SIM Toolkit SETUP MENU captured from the card's TERMINAL PROFILE +response at startup. Empty `{"items": []}` if the card didn't send a menu. + +**Response:** +```json +{"command_number": 1, "items": [{"id": 128, "text": "Настройки/Settings"}], + "title": "Alfa Mobile", "active": false} +``` + +### `POST /api/menu-select` + +Sends an `ENVELOPE(MENU SELECTION)` with the selected item ID, then handles +the card's proactive response (DISPLAY TEXT or SELECT ITEM). + +```json +{"item_id": 128} +``` + +**Response:** +```json +{"type": "display_text", "text": "Hello", "sw": "9122"} +``` +or +```json +{"type": "select_item", "items": [{"id": 1, "text": "Sub-menu"}], "sw": "9122"} +``` + +### `POST /api/menu-respond` + +Sends `TERMINAL RESPONSE` to the current proactive command with the given result +code. Continues the proactive chain if the card responds with `91XX`. + +```json +{"result": "ok", "item_id": 1} +``` + +| `result` | TERMINAL RESPONSE code | Meaning | +|---|---|---| +| `ok` | `0x00` | Command performed successfully | +| `back` | `0x12` | Backward move requested | +| `cancel` | `0x10` | Proactive session terminated | +| `timeout` | `0x11` | No response from user | + +### `GET /api/stk-status` + +Returns the current STK session state. +```json +{"active": true, "pending": true, "pending_type": "select_item"} +``` + +### `POST /api/read` + +Read file content. Auto-detects transparent vs record files. + +```json +{"name": "EF.ICCID", "fid": "2FE2", "parent_sel": "3F00", "mode": "raw"} +``` + +Returns: +```json +{"success": true, "sw": "9000", "file_type": "transparent", "data": "..."} +``` + +### `POST /api/write` + +Write raw hex data to a file. + +```json +{"name": "EF.ICCID", "fid": "2FE2", "data": "A0A1A2...", "parent_sel": "3F00"} +``` + +For record files: +```json +{"name": "EF.ADN", "fid": "6F3A", "data": "A0A1...", "record_nr": 1, "parent_sel": "7F10"} +``` + +Returns: +```json +{"success": true, "sw": "9000"} +``` + +### `POST /api/select` + +Select a file by name or FID, with optional parent selection. + +```json +{"name": "EF.ICCID", "fid": "2FE2", "parent_sel": "3F00"} +``` + +Returns: +```json +{"name": "EF.ICCID", "fid": "2FE2", "file_type": "transparent", "exists": true} +``` + +### `POST /api/tree` + +Get directory listing with typed children. + +```json +{"name": "MF", "fid": "3F00"} +``` + +Returns: +```json +{"exists": true, "name": "MF", "fid": "3F00", "file_type": "df", "children": [{"name": "EF.ICCID", "fid": "2fe2", "isDir": false}]} +``` diff --git a/aes-bundle.js b/frontend/aes-bundle.js similarity index 100% rename from aes-bundle.js rename to frontend/aes-bundle.js diff --git a/des-bundle.js b/frontend/des-bundle.js similarity index 100% rename from des-bundle.js rename to frontend/des-bundle.js diff --git a/help-ru.html b/frontend/help-ru.html similarity index 96% rename from help-ru.html rename to frontend/help-ru.html index 4373d25..53c22e9 100644 --- a/help-ru.html +++ b/frontend/help-ru.html @@ -236,7 +236,7 @@

6. Вкладка Card reader (pySim)

-

Подключение к локальному pysim-otaman-server для работы с картой. Подвкладки: File manager, Custom files, pySim command line, Raw APDU и Proactive UICC.

+

Подключение к локальному pysim-otaman-server для работы с картой. Подвкладки: File manager, Custom files, pySim command line, Raw APDU и Proactive UICC.

6.1 File manager

    @@ -322,7 +322,7 @@

    7. Установка сервера

    -

    Для работы с картой (вкладка Card reader, Proactive UICC, доставка OTA) нужен локальный pysim-otaman-server — небольшой HTTP-сервер, оборачивающий pySim и взаимодействующий с ридером через PC/SC или serial.

    +

    Для работы с картой (вкладка Card reader, Proactive UICC, доставка OTA) нужен локальный pysim-otaman-server — встроенный в OTAMan HTTP-сервер, оборачивающий pySim, работающий с ридером через PC/SC или serial и раздающий сам PWA (откройте http://127.0.0.1:8080).

    7.1 Требования

      @@ -333,17 +333,17 @@

    7.2 Быстрый старт — Linux / macOS

    -
    git clone https://github.com/anttro/pysim-otaman-server.git
    -cd pysim-otaman-server
    +	
    git clone https://github.com/anttro/otaman.git
    +cd otaman
     chmod +x setup.sh start.sh
     ./setup.sh          # создаёт .venv, устанавливает pysim + сервер (однократно)
    -./start.sh          # запускает сервер (автоопределение ридера)
    +./start.sh # запускает сервер (PWA + API, автоопределение ридера)

    7.3 Быстрый старт — Windows

    -
    git clone https://github.com/anttro/pysim-otaman-server.git
    -cd pysim-otaman-server
    +	
    git clone https://github.com/anttro/otaman.git
    +cd otaman
     setup.bat           # создаёт .venv, устанавливает pysim + сервер (однократно)
    -start.bat           # запускает сервер
    +start.bat # запускает сервер (PWA + API)

    7.4 Вспомогательные скрипты

    @@ -369,14 +369,14 @@ source .venv/bin/activate # Linux/macOS # .venv\Scripts\activate # Windows # Установить pysim -pip install git+https://gitea.osmocom.org/sim-card/pysim.git +pip install git+https://github.com/osmocom/pysim.git -# Установить pysim-otaman-server -pip install . +# Установить pysim-otaman-server (editable — раздаёт встроенный PWA) +pip install -e . -# Запустить сервер +# Запустить сервер (PWA + API) pysim-otaman-server --http-port 8080 -

    Подключите PC/SC-ридер с SIM-картой и укажите в PWA адрес http://127.0.0.1:8080.

    +

    Подключите PC/SC-ридер с SIM-картой и откройте http://127.0.0.1:8080 — PWA и API на одном origin, поэтому CORS не требуется.

    Если PWA раздаётся с публичного HTTPS-хоста (например, https://otaman.example.com), для доступа к локальному серверу карт нужны два условия: (1) сервер отвечает на preflight заголовком Access-Control-Allow-Private-Network: true (pysim-otaman-server ≥ 1.6.1 делает это автоматически), и (2) браузеру должно быть разрешено обращаться к локальной сети — в Chrome/Edge/Vivaldi: Настройки сайта → Доступ к локальной сети → разрешить сайт (или подтвердить запрос). Без разрешения браузера запрос к 127.0.0.1 блокируется ещё до отправки preflight.

    diff --git a/help.html b/frontend/help.html similarity index 97% rename from help.html rename to frontend/help.html index 5e51583..54a9ef6 100644 --- a/help.html +++ b/frontend/help.html @@ -236,7 +236,7 @@

    6. Card reader (pySim) tab

    -

    Connects to a local pysim-otaman-server for live card operations. Sub-tabs: File manager, Custom files, pySim command line, Raw APDU, and Proactive UICC.

    +

    Connects to a local pysim-otaman-server for live card operations. Sub-tabs: File manager, Custom files, pySim command line, Raw APDU, and Proactive UICC.

    6.1 File manager

      @@ -322,7 +322,7 @@

      7. Server installation

      -

      Live card operations (Card reader tab, Proactive UICC, OTA delivery) require the local pysim-otaman-server — a small HTTP server that wraps pySim and talks to the reader over PC/SC or serial.

      +

      Live card operations (Card reader tab, Proactive UICC, OTA delivery) require the local pysim-otaman-server — a small HTTP server bundled with OTAMan that wraps pySim, talks to the reader over PC/SC or serial, and also serves the PWA itself (open http://127.0.0.1:8080).

      7.1 Prerequisites

        @@ -333,17 +333,17 @@

      7.2 Quick start — Linux / macOS

      -
      git clone https://github.com/anttro/pysim-otaman-server.git
      -cd pysim-otaman-server
      +	
      git clone https://github.com/anttro/otaman.git
      +cd otaman
       chmod +x setup.sh start.sh
       ./setup.sh          # creates .venv, installs pysim + server (run once)
      -./start.sh          # starts the server (auto-detects reader)
      +./start.sh # starts the server (serves PWA + API, auto-detects reader)

      7.3 Quick start — Windows

      -
      git clone https://github.com/anttro/pysim-otaman-server.git
      -cd pysim-otaman-server
      +	
      git clone https://github.com/anttro/otaman.git
      +cd otaman
       setup.bat           # creates .venv, installs pysim + server (run once)
      -start.bat           # starts the server
      +start.bat # starts the server (serves PWA + API)

      7.4 Helper scripts

    @@ -369,14 +369,14 @@ source .venv/bin/activate # Linux/macOS # .venv\Scripts\activate # Windows # Install pysim -pip install git+https://gitea.osmocom.org/sim-card/pysim.git +pip install git+https://github.com/osmocom/pysim.git -# Install pysim-otaman-server -pip install . +# Install pysim-otaman-server (editable, so it serves the bundled PWA) +pip install -e . -# Start the server +# Start the server (serves PWA + API) pysim-otaman-server --http-port 8080 -

    Connect a PC/SC reader with a SIM card, then point the PWA at http://127.0.0.1:8080.

    +

    Connect a PC/SC reader with a SIM card, then open http://127.0.0.1:8080 — the PWA and API share one origin, so no CORS is involved.

    If the PWA is served from a public HTTPS host (e.g. https://otaman.example.com), two things are required to reach a local card server: (1) the server must answer the preflight with Access-Control-Allow-Private-Network: true (pysim-otaman-server ≥ 1.6.1 does this automatically), and (2) the browser must be allowed to access the local network — in Chrome/Edge/Vivaldi: Site settings → Local network access → allow the site (or accept the permission prompt). Without the browser permission, the request to 127.0.0.1 is blocked before any preflight is sent.

    diff --git a/icon-192.png b/frontend/icon-192.png similarity index 100% rename from icon-192.png rename to frontend/icon-192.png diff --git a/icon-512.png b/frontend/icon-512.png similarity index 100% rename from icon-512.png rename to frontend/icon-512.png diff --git a/index.html b/frontend/index.html similarity index 99% rename from index.html rename to frontend/index.html index cfa7adc..cd324d0 100644 --- a/index.html +++ b/frontend/index.html @@ -17,7 +17,7 @@
    -

    OTAMan SIM OTA with a Human Face v1.6.1

    +

    OTAMan SIM OTA with a Human Face v1.7.0

    github @@ -846,7 +846,7 @@

    To access local card reader, you need pysim-otaman-server running locally.

    -

    To connect, install pysim-otaman-server: git clone https://github.com/anttro/pysim-otaman-server.git and start it.
    Refer to pysim-otaman-server README files for details. Click Connect when pysim-otaman-server is ready

    +

    To connect, install pysim-otaman-server: git clone https://github.com/anttro/otaman.git and start it.
    Refer to pysim-otaman-server README files for details. Click Connect when pysim-otaman-server is ready