diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..afce6f1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,30 @@ +--- +name: Bug report +about: Something is broken or behaves incorrectly +title: '[BUG] ' +labels: bug +--- + +## Environment + +- OS / version: +- BLIP version (About screen or `app-metadata.json`): +- Install type (dev / NSIS / portable): + +## Steps to reproduce + +1. +2. +3. + +## Expected + +## Actual + +## Logs / screenshots + +Paste main process logs or DevTools console if relevant. Redact personal info. + +## Checklist + +- [ ] I searched existing issues for duplicates. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..faa7276 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: General question + url: https://github.com/krwg/BLIP/discussions + about: Ask the community (discussions) if you are unsure whether this is a bug. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..3428ab3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: Feature request +about: Suggest an improvement or new capability +title: '[FEATURE] ' +labels: enhancement +--- + +## Problem / motivation + +What pain point does this solve? + +## Proposed solution + +## Alternatives considered + +## Scope notes + +- LAN-only / privacy constraints: +- Affects main process, renderer, or packaging: + +## Checklist + +- [ ] I am willing to help implement or test (optional). diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..fea3236 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: / + schedule: + interval: monthly + open-pull-requests-limit: 5 + labels: + - dependencies + + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..adc87cf --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ +## Summary + + + +## Type of change + +- [ ] Bug fix +- [ ] New feature +- [ ] Documentation / repo hygiene +- [ ] Refactor (no user-visible change) + +## How tested + + + +## Screenshots (UI) + + + +## Checklist + +- [ ] `npm run build` passes locally (or CI equivalent). +- [ ] User-visible strings updated in **EN + RU** if applicable (`renderer/i18n.js`). +- [ ] Linked issue: closes # diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5cc7bd5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v6 + with: + node-version: '20' + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build renderer (Vite) + run: npm run build diff --git a/.gitignore b/.gitignore index d708878..fbf0711 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,3 @@ -node_modules/ -dist/ -dist-electron/ -build/icon.ico -build/icon.png -build/tray-16.png -build/icon.svg -*.log -.DS_Store -Thumbs.db +node_modules +dist-electron +dist diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c901f5a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,42 @@ +# Changelog + +All notable changes to this project are documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Release **version numbers** track [`app-metadata.json`](app-metadata.json) (synced into `package.json` on build). + +## [Unreleased] + +### Added + +- OSS hygiene: Contributing guide (`CONTRIBUTING.md`), Code of Conduct, security policy (`SECURITY.md`), root changelog, architecture doc (`docs/ARCHITECTURE.md`). +- `.github/workflows/ci.yml` — `npm ci` + `npm run build` on push/PR to `main`/`master`. +- Issue / PR templates, Dependabot (npm + GitHub Actions), `.nvmrc`, `engines.node` in `package.json`. +- Tracked backlog files under `issues/` (removed from `.gitignore`). + +### Changed + +- README: Community section + Node **20+** align with toolchain. + +## [0.1.4] — Obsidian + +### Added + +- Settings **About**: version from app metadata, GitHub link (`openExternal`). +- Chat history **clear conversation** action (with confirm). +- Central **`app-metadata.json`** + sync script for `package.json` version. + +### Changed + +- Main process handles **busy TCP/UDP ports** (`EADDRINUSE`): user dialog + clean exit instead of uncaught exception. +- Discovery ignores **self-announcements** on any local IPv4 alias (fewer phantom “duplicate self” peers). + +### Removed + +- In-app UDP/TCP port preset UI (profiles A/B); advanced users use env vars / config as documented. + +## Earlier + +Prior development history lives in Git commits and GitHub Releases; append older semver sections here when you cut releases. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..bdd608b --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,35 @@ +# Contributor Covenant Code of Conduct + +## Our pledge + +We pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +## Our standards + +Examples of behavior that contributes to a positive environment: + +- Demonstrating empathy and kindness toward others +- Being respectful of differing opinions and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing when we affect others, and learning from the experience +- Focusing on what is best for the community + +Examples of unacceptable behavior: + +- The use of sexualized language or imagery, and sexual attention or advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others’ private information without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement + +Maintainers are responsible for clarifying and enforcing standards of acceptable behavior. They may take appropriate and fair corrective action in response to behavior that they deem inappropriate, threatening, offensive, or harmful. + +## Reporting + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the maintainers via GitHub (issues or direct message if available). All complaints will be reviewed and investigated promptly and fairly. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9a141f3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,75 @@ +# Contributing to BLIP + +Thanks for helping improve BLIP. This project is **GPL-3.0** — your contributions will be under the same license. + +## Prerequisites + +- **Node.js** ≥ 20 (see `.nvmrc`). Use `nvm use` if you use nvm. +- **npm** (ships with Node). +- **Windows** is the primary target today; other platforms may work but are not fully validated in CI. + +## Quick setup + +```bash +git clone https://github.com/krwg/BLIP.git +cd BLIP +npm ci +``` + +## Development + +```bash +npm run electron:dev +``` + +This runs Vite and Electron with `BLIP_VITE_DEV=1`. The UI loads from `http://localhost:5173`. + +**Second instance** (separate config directory — see `scripts/electron-dev-peer2.mjs`): + +```bash +npm run electron:dev:peer2 +``` + +## Production-like run + +```bash +npm start +``` + +Builds the renderer first (`prestart` → `vite build`), then launches Electron against `dist/`. + +## Building installers + +Requires Windows for the current electron-builder targets: + +```bash +npm run electron:build # NSIS installer +npm run electron:build:portable +``` + +Outputs go to `dist-electron/` (see `electron-builder.yml`). + +## Version / metadata + +- Release version and display metadata live in **`app-metadata.json`**. +- `npm run build` runs `scripts/sync-app-metadata.mjs` so `package.json`’s `version` stays in sync. + +## Code style + +- Match existing patterns in `main/` and `renderer/`. +- Prefer small, focused PRs with a clear **what** and **why**. +- If you change user-visible strings, update **EN + RU** in `renderer/i18n.js` when applicable. + +## Pull requests + +1. Fork → branch → push → open PR against `main`. +2. Ensure **CI is green** (see `.github/workflows/ci.yml`). +3. Describe behavior change, testing done, and screenshots for UI changes. + +## Security + +Do **not** open public issues for sensitive vulnerabilities. See [SECURITY.md](SECURITY.md). + +## Questions + +Open a GitHub issue. If **Discussions** are enabled for this repo, you may ask broader questions there instead. diff --git a/README.md b/README.md index 80f6f2a..d0f0c47 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ | Section | English | Русский | |---------|---------|---------| | Language | [**English**](#english) | [**Русский**](#russian) | +| Testing (one PC) | [Testing](#en-testing) | [Тестирование](#ru-testing) | | Overview | [Overview](#en-overview) | [Обзор](#ru-overview) | | Features | [Features](#en-features) | [Возможности](#ru-features) | | Architecture | [Architecture](#en-architecture) | [Архитектура](#ru-architecture) | @@ -32,11 +33,24 @@ | Project layout | [Project layout](#en-layout) | [Структура](#ru-layout) | | Design tokens | [Design](#en-design) | [Дизайн](#ru-design) | | License | [License](#en-license) | [Лицензия](#ru-license) | +| Community | [Community](#en-community) | [Сообщество](#ru-community) | ---

English

+

Testing on one PC

+ +| Approach | Works for chat/calls? | +|----------|---------------------| +| **Two BLIP windows on the same PC** | **No** — both try to bind UDP `42069` and TCP `42070`; the second copy usually fails or cannot discover the first. | +| **VM** (VirtualBox / Hyper-V) with bridged network | **Yes** — guest gets its own IP; install or run BLIP in the VM. | +| **Second device** on the same Wi‑Fi (laptop, old PC) | **Yes** — recommended. | +| **Hamachi / Radmin VPN** between two machines | **Yes** — same as LAN. | +| **Phone** | No mobile app yet — desktop only. | + +Quick VM flow: host runs BLIP (ID **1**), VM runs BLIP (ID **2**), same subnet via bridged adapter, allow firewall for ports **42069–42070**. +

Overview

| | | @@ -111,7 +125,7 @@ flowchart LR | | | |---|---| -| Node.js | **18+** | +| Node.js | **20+** (see `.nvmrc`) | | OS | Windows 10/11 (for `.exe` builds) | | Network | Same LAN / VPN (Hamachi, Radmin) | @@ -148,8 +162,8 @@ Icons: root `icon.svg` → `npm run build:icons` → `build/icon.ico`. | Command | Output | |---------|--------| -| `npm run electron:build` | **`BLIP-Setup-0.1.0.exe`** — full NSIS installer | -| `npm run electron:build:portable` | **`BLIP-0.1.0-Portable.exe`** — single-file portable | +| `npm run electron:build` | **`BLIP-Setup-0.1.4.exe`** — full NSIS installer | +| `npm run electron:build:portable` | **`BLIP-0.1.4-Portable.exe`** — single-file portable | | `npm run electron:build:all` | Both artifacts | | `npm run electron:build:dir` | `dist-electron/win-unpacked/BLIP.exe` (debug folder) | @@ -238,6 +252,16 @@ blip/ | Borders | `2px solid` | | Radius | **0** everywhere | +

Community

+ +| Doc | Purpose | +|-----|---------| +| [CONTRIBUTING.md](CONTRIBUTING.md) | Setup, dev workflow, PR expectations | +| [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) | Community standards | +| [SECURITY.md](SECURITY.md) | Reporting vulnerabilities | +| [CHANGELOG.md](CHANGELOG.md) | Release history | +| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Technical map of the app | +

License

This project is licensed under **[GNU GPL v3](LICENSE)**. @@ -250,6 +274,18 @@ The **Minecraft** font is licensed separately under [MIT](https://github.com/bs- *Ты в сети. Ты сигнал.* +

Тестирование на одном ПК

+ +| Способ | Чат / звонки? | +|--------|----------------| +| **Два окна BLIP на одном ПК** | **Нет** — порты `42069` (UDP) и `42070` (TCP) заняты; второй экземпляр не поднимется или не увидит первого. | +| **Виртуальная машина** (VirtualBox / Hyper-V, сеть bridged) | **Да** — у гостя свой IP; BLIP в VM + на хосте. | +| **Второе устройство** в той же Wi‑Fi | **Да** — лучший вариант. | +| **Hamachi / Radmin VPN** на двух машинах | **Да** — как LAN. | +| **Телефон** | Мобильного клиента пока нет. | + +Кратко: хост BLIP ID **1**, в VM BLIP ID **2**, одна подсеть, firewall открыт для **42069–42070**. +

Обзор

| | | @@ -294,7 +330,7 @@ The **Minecraft** font is licensed separately under [MIT](https://github.com/bs- | | | |---|---| -| Node.js | **18+** | +| Node.js | **20+** (see `.nvmrc`) | | ОС | Windows 10/11 (сборка `.exe`) | | Сеть | Одна LAN / VPN (Hamachi, Radmin) | @@ -331,8 +367,8 @@ npx electron . | Команда | Результат | |---------|-----------| -| `npm run electron:build` | **`BLIP-Setup-0.1.0.exe`** — установщик NSIS | -| `npm run electron:build:portable` | **`BLIP-0.1.0-Portable.exe`** — portable | +| `npm run electron:build` | **`BLIP-Setup-0.1.4.exe`** — установщик NSIS | +| `npm run electron:build:portable` | **`BLIP-0.1.4-Portable.exe`** — portable | | `npm run electron:build:all` | Оба файла | | `npm run electron:build:dir` | `dist-electron/win-unpacked/BLIP.exe` | @@ -421,6 +457,16 @@ blip/ | Borders | `2px solid` | | Radius | **0** (везде) | +

Сообщество

+ +| Документ | Зачем | +|----------|--------| +| [CONTRIBUTING.md](CONTRIBUTING.md) | Сборка, dev, правила PR | +| [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) | Правила сообщества | +| [SECURITY.md](SECURITY.md) | Как сообщить об уязвимости | +| [CHANGELOG.md](CHANGELOG.md) | История версий | +| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Архитектура кода | +

Лицензия

Проект распространяется под **[GNU GPL v3](LICENSE)**. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..bff65f1 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,46 @@ +# Security policy + +## Supported versions + +| Version | Supported | +|---------|-----------| +| Latest release on GitHub | Yes | +| Older tags | Best effort | + +BLIP is a **local-network P2P** app. Treat your LAN like a trust boundary: anyone on the same broadcast domain may attempt to interact with discovery or open TCP sessions to advertised ports. + +## Reporting a vulnerability + +**Please do not file public issues** for undisclosed security problems. + +Instead: + +1. Open a **private vulnerability report** via GitHub (**Security** → **Advisories** → **Report a vulnerability**), if enabled for the repository, **or** +2. Contact the maintainer through a private channel listed on their GitHub profile. + +Include: + +- Description and impact +- Steps to reproduce +- Affected version / commit +- Optional patch or mitigation ideas + +We aim to acknowledge within a few days; timelines depend on maintainer availability. + +## Scope (in scope) + +- Remote code execution, unsafe IPC, or unsafe `shell.openExternal` usage +- WebRTC / preload bridge weaknesses that break `contextIsolation` assumptions +- Packaging / auto-update integrity (when implemented) + +## Out of scope + +- Physical access to the machine, or malware already running as the user +- Social engineering on the local network +- Denial-of-service by flooding open ports on a hostile LAN (document hardening separately) + +## Hardening tips for users + +- Run BLIP only on networks you trust. +- Keep the app updated once releases publish security fixes. +- Use OS firewall policies if you expose unusual port overrides. diff --git a/app-metadata.json b/app-metadata.json new file mode 100644 index 0000000..a668566 --- /dev/null +++ b/app-metadata.json @@ -0,0 +1,6 @@ +{ + "displayName": "BLIP", + "codename": "Obsidian", + "version": "0.1.4", + "githubUrl": "https://github.com/krwg/BLIP" +} diff --git a/build/icon.ico b/build/icon.ico new file mode 100644 index 0000000..6fa1455 Binary files /dev/null and b/build/icon.ico differ diff --git a/build/icon.png b/build/icon.png new file mode 100644 index 0000000..cadfce7 Binary files /dev/null and b/build/icon.png differ diff --git a/build/icon.svg b/build/icon.svg new file mode 100644 index 0000000..ce06903 --- /dev/null +++ b/build/icon.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/tray-16.png b/build/tray-16.png new file mode 100644 index 0000000..e4ae0f9 Binary files /dev/null and b/build/tray-16.png differ diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md new file mode 100644 index 0000000..a46247d --- /dev/null +++ b/docs/ARCHITECTURE.md @@ -0,0 +1,60 @@ +# BLIP — architecture overview + +High-level map of how pieces fit together. For build and contribution workflow see [CONTRIBUTING.md](../CONTRIBUTING.md). + +``` +┌─────────────────────────────────────────────────────────────────┐ +│ Electron main process │ +│ main/index.js — IPC, tray, BrowserWindows, orchestration │ +│ main/discovery.js — UDP (+ mDNS) peer presence │ +│ main/tcp-server.js | tcp-client.js — line-delimited JSON │ +└─────────────────────────────────────────────────────────────────┘ + ▲ preload.cjs (contextBridge → window.blip) + │ +┌─────────┴─────────────────────────────────────────────────────────┐ +│ Renderer (Vite bundles) │ +│ renderer/main.js · ui.js · chat.js · call.js … │ +│ renderer/call-window.html + call-window-main.js (call window) │ +└─────────────────────────────────────────────────────────────────┘ + +WebRTC signalling (SDP, ICE candidates) travels over the same TCP +connection as chat messages; media is peer-to-peer in the renderer. +``` + +## Processes & windows + +| Piece | Role | +|--------|------| +| **Main** | TCP server/client coordination, discovery, IPC to all renderers. | +| **Main window** | Chat, dial, peers, settings (`dist/index.html` or Vite dev URL). | +| **Call window** | Separate `BrowserWindow` loads `call-window.html` — WebRTC UI isolation. | + +## Networking + +| Mechanism | Default port | Purpose | +|-----------|---------------|---------| +| UDP broadcast (+ optional multi-port fan-out) | 42069 (config/env) | `announce` payloads: `blipId`, display name, IPs, advertised TCP/UDP. | +| TCP | 42070 (config/env) | Framed `\n`-delimited JSON: chat, pings, WebRTC signalling. | +| mDNS | — | Auxiliary discovery (`_blip._udp.local` TXT records). | + +Environment overrides: `BLIP_UDP_PORT`, `BLIP_TCP_PORT`. Separate user data dirs support side-by-side dev instances (`BLIP_USER_DATA_DIR`). + +## Persistence + +| Data | Location | +|------|-----------| +| User config (`blipId`, name, language, …) | Electron `userData` → `blip-config.json`. | +| Chat history | Renderer `localStorage` key `blip_chat_v1`. | +| Release metadata | `app-metadata.json` (version, codename, repo URL). | + +## Security posture (today) + +- `contextIsolation: true`, preload exposes a narrow API (`preload.cjs`). +- `openExternal` is restricted to http(s) URLs in main. +- LAN trust model: peers are whoever answers on your network segment. + +See [SECURITY.md](../SECURITY.md) for reporting expectations. + +## Future seams (tracked as GitHub issues / `issues/*.md`) + +- Auto-update channel, richer diagnostics UI, hardened trust UX, CI packaging smoke jobs. diff --git a/electron-builder.yml b/electron-builder.yml index b6f736f..f80c41a 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -9,6 +9,7 @@ files: - preload.cjs - dist/**/* - package.json + - app-metadata.json extraResources: - from: build/icon.png to: icons/icon.png diff --git a/issues/001-theme-and-wallpaper-customization.md b/issues/001-theme-and-wallpaper-customization.md new file mode 100644 index 0000000..cf4afd4 --- /dev/null +++ b/issues/001-theme-and-wallpaper-customization.md @@ -0,0 +1,33 @@ +# [FEATURE] Theme, accent colors, and optional animated wallpaper support + +## Type +Enhancement · UX · Settings + +## Summary +Expose user-selectable themes (minimum: light/dark/high-contrast + accent hue), persisted in app config; allow optional animated or static wallpaper behind the chrome with performance-safe toggles. + +## Background +Custom appearance increases engagement and aligns expectations with polished messengers without requiring server-side infrastructure. + +## Scope +- Persist theme keys in Electron `userData` config (reuse existing pattern). +- CSS variables driven by preset tokens; avoid per-control inline colors. +- Optional wallpaper layer (`