diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index afbd9b1..3121920 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ Security problems go through [private reporting](SECURITY.md), not public issues ## Building -See [Building](README.md#building) in the README. In short: Rust (MSVC), Node.js 20+, `mpv.exe` in +See [Building](docs/DEVELOPMENT.md#building). In short: Rust (MSVC), Node.js 20+, `mpv.exe` in `src-tauri/resources/mpv/`, then `npm install` and `npx tauri dev` for a debug window or `npx tauri build` for the installer. diff --git a/README.ar.md b/README.ar.md new file mode 100644 index 0000000..15533f4 --- /dev/null +++ b/README.ar.md @@ -0,0 +1,129 @@ +
+ +

+ شعار Flowbit +

+ +

Flowbit

+ +

+ شاهد التورنت وهو يُنزَّل.
+ برنامج تورنت مجاني ومفتوح المصدر لويندوز ولينكس،
+ فيه مكتبة للمشاهدة ومترجم للترجمات.
+ بدون إعلانات، وبدون حساب، ومجانًا بالكامل. +

+ +

+ تنزيل لويندوز +   + تنزيل للينكس +

+ +

+ آخر إصدار + حالة الفحص + ويندوز ولينكس + رخصة MIT +

+ +

+ English · العربية +

+ +

+ قائمة التورنتات في Flowbit بالعربية +

+ +## المزايا + +### شاهد أثناء التنزيل + +اضغط تشغيل ليفتح الفيديو في [mpv](https://mpv.io) بينما يستمر تنزيل الباقي. واختر الملفات التي تريدها واترك ما لا تحتاجه. + +### تابع ما تشاهده + +أكمل من حيث توقفت. الحلقات مرتبة حسب المسلسل، وما تنتهي منه يُعلَّم تلقائيًا، والصور مأخوذة من الفيديو نفسه. + +

+ مكتبة المشاهدة بالعربية +

+ +### ترجم الترجمات + +ترجم ملفات SRT و WebVTT و ASS إلى 21 لغة، مع بقاء التوقيت والتنسيق والمواضع كما هي تمامًا. ويُحفظ الملف الجديد بجانب الفيديو ليحمّله mpv. + +يعمل Google Translate بدون أي إعداد. ويمكنك أيضًا استخدام DeepL أو LibreTranslate أو نماذج الذكاء الاصطناعي (Gemini و Groq و OpenRouter و OpenAI و Ollama وأي خادم متوافق مع OpenAI)، ولكل منها شرح للإعداد داخل البرنامج. وتراعي الترجمة بالذكاء الاصطناعي سياق الجمل السابقة وتحافظ على الأسماء، ويمكنك اختيار العربية الفصحى أو الخليجية أو المصرية أو الشامية. + +

+ مترجم الترجمات بالعربية +

+ +### ومزايا أخرى + +- **واجهة عربية كاملة** من اليمين إلى اليسار، بجانب الإنجليزية، مع مظهر فاتح وداكن +- **حدّد ما تريد أو حدّد الكل** واحذفها معًا، مع ملفاتها أو بدونها +- **شارك** ملفاتك ومجلداتك، أو أنشئ ملف `.torrent` +- **حدود لسرعة التنزيل والرفع**، ومنفذ الاتصال، ومتتبعات إضافية +- **إيقاف تلقائي عند الاكتمال**، أو استمر في مشاركة ما تختاره +- **خفيف في شريط المهام:** حوالي 60 ميجابايت والنافذة مغلقة +- **يفتح روابط magnet وملفات `.torrent`** بدون صلاحيات المسؤول + +## التنزيل + +نزّل آخر إصدار من **[صفحة الإصدارات](https://github.com/GENERAL868/flowbit/releases/latest)**. + +### ويندوز + +لويندوز 10 و11 (64 بت)، و mpv مضمَّن معه. + +| الملف | الوصف | +|---|---| +| `Flowbit-x.y.z-setup.exe` | مثبّت لحسابك فقط، بدون صلاحيات المسؤول | +| `Flowbit-x.y.z-portable.zip` | نسخة محمولة: فك الضغط في أي مكان وشغّل `Flowbit.exe`، وتبقى الإعدادات في المجلد نفسه | + +### لينكس + +للتوزيعات 64 بت من عام 2022 فما بعد. وحزم `.deb` و `.rpm` تثبّت mpv تلقائيًا. + +| التوزيعة | الملف | التثبيت | +|---|---|---| +| Ubuntu و Debian و Mint و Pop!_OS | `Flowbit-x.y.z-linux-amd64.deb` | `sudo apt install ./Flowbit-x.y.z-linux-amd64.deb` | +| Fedora و openSUSE و RHEL | `Flowbit-x.y.z-linux-x86_64.rpm` | `sudo dnf install ./Flowbit-x.y.z-linux-x86_64.rpm` | +| غيرها | `Flowbit-x.y.z-linux-x86_64.AppImage` | ثبّت `mpv`، ثم `chmod +x Flowbit-*.AppImage` وشغّله | + +## معلومات مفيدة + +
+ويندوز يقول إنه حمى جهازي +
+البرنامج غير موقّع رقميًا بعد، لذلك يعرض SmartScreen تحذيرًا. اختر مزيد من المعلومات ← التشغيل على أي حال. +
+ +
+التورنت لا يبدأ التنزيل +
+يتصل Flowbit بالأجهزة الأخرى عبر TCP، ولا تعمل التورنتات التي مصادرها روابط ويب فقط أو متصفحات (WebRTC) فقط. +
+ +
+أين توجد إعداداتي؟ +
+في %LOCALAPPDATA%\app.flowbit.desktop على ويندوز، و~/.local/share/app.flowbit.desktop على لينكس. أما النسخة المحمولة فتحفظها في مجلدها. +
+ +هذا البرنامج أداة عامة الاستخدام، فالرجاء تنزيل ومشاركة ما يحق لك فقط. + +## المساهمة + +نرحب بالإبلاغ عن الأخطاء وبالترجمات وطلبات الدمج. + +- [دليل المساهمة](CONTRIBUTING.md) و[قواعد السلوك](CODE_OF_CONDUCT.md) +- [البناء من الكود وتنظيم المشروع](docs/DEVELOPMENT.md) +- [سياسة الأمان](SECURITY.md) +- [سجل التغييرات](CHANGELOG.md) + +## الرخصة + +رخصة البرنامج هي [MIT](LICENSE)، وللمكونات الخارجية رخصها الخاصة: librqbit (Apache-2.0) و mpv (GPL-2.0-or-later) والخطوط (SIL OFL 1.1). التفاصيل في [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). + +
diff --git a/README.md b/README.md index e1f3153..775565a 100644 --- a/README.md +++ b/README.md @@ -1,194 +1,132 @@

- + Flowbit logo

Flowbit

- A streaming torrent client for Windows and Linux. Start watching while it downloads, keep track - of what you've watched, and translate subtitles, in English or Arabic. + Watch torrents while they download.
+ A free, open-source torrent client for Windows and Linux,
+ with a watch library and a subtitle translator built in.
+ No ads, no account, nothing to pay.

- Latest release - CI + Download for Windows +   + Download for Linux +

+ +

+ Latest release + CI status Windows and Linux MIT license

- Flowbit's torrent list, with a download in progress + English · العربية

-## Download - -Get the latest version from [Releases](https://github.com/GENERAL868/flowbit/releases/latest). - -### Windows 10 and 11 (64-bit) +

+ Flowbit's torrent list, with downloads in progress and finished torrents +

-- **`Flowbit-x.y.z-setup.exe`**: installs for your account only, no admin rights needed -- **`Flowbit-x.y.z-portable.zip`**: unzip anywhere and run `Flowbit.exe`; settings stay in the - folder +## Features -Uses Microsoft Edge WebView2, which Windows already has. mpv comes with it. +### Stream while it downloads -### Linux (64-bit) +Press play and the video opens in [mpv](https://mpv.io) while the rest keeps downloading. Choose which files to get, and leave out the ones you don't need. -Flowbit plays videos in your system's **mpv**; the packages install it for you. +### Keep track of what you watch -| Distribution | File | Install | -|---|---|---| -| Ubuntu, Debian, Mint, Pop!_OS… | `Flowbit-x.y.z-linux-amd64.deb` | `sudo apt install ./Flowbit-x.y.z-linux-amd64.deb` | -| Fedora, openSUSE, RHEL… | `Flowbit-x.y.z-linux-x86_64.rpm` | `sudo dnf install ./Flowbit-x.y.z-linux-x86_64.rpm` | -| Any other | `Flowbit-x.y.z-linux-x86_64.AppImage` | install `mpv`, then `chmod +x Flowbit-*.AppImage` and run it | +Pick up where you stopped. Episodes are grouped by show, finished ones are marked for you, and posters come from the videos themselves. -Built on Ubuntu 22.04, so it runs on distributions from 2022 on (glibc 2.35, WebKitGTK 4.1). +

+ Watch library with continue watching and episodes grouped by show +

-## Built with +### Translate subtitles -- **Torrent engine:** [librqbit](https://github.com/ikatson/rqbit) 9.0.1, in Rust -- **Window:** [Tauri](https://tauri.app) 2, using the system's webview (WebView2 on Windows, - WebKitGTK on Linux) -- **Player:** [mpv](https://mpv.io) (bundled on Windows, the system's on Linux), in its own window - with its own controls and shortcuts (ASS subtitles keep their styling) -- **UI:** plain JavaScript, no build step, in `ui/`; English and Arabic (right to left) +Translate SRT, WebVTT and ASS files into 21 languages. Timings, styles and positions stay exactly as they were, and the result is saved next to the video so mpv loads it. -## Features +Google Translate works with no setup. You can also use DeepL, LibreTranslate or AI models (Gemini, Groq, OpenRouter, OpenAI, Ollama, or any OpenAI-compatible server), with a setup guide for each inside the app. AI translation follows the context of earlier lines, keeps names consistent, and can write Modern Standard, Gulf, Egyptian or Levantine Arabic. -- Streams video and audio while it downloads; pick which files to download -- Watch library: continue watching, episodes grouped by show, watched marks, posters from the video -- Subtitle translator for SRT, WebVTT and ASS that keeps timings and styling: Google Translate, - DeepL, AI models (Gemini, Groq, OpenRouter, OpenAI, Ollama or any OpenAI-compatible server) and - LibreTranslate, with setup guides inside the app. API keys are encrypted with Windows DPAPI - (on Linux, kept in a file only your account can read). -- Drag and drop `.torrent` files and magnet links (and, on Windows, files and folders to share); - create torrents -- Runs in the tray with only the engine (about 60 MB) when the window is closed -- Opens magnet links and `.torrent` files (current user, no admin rights) - -| Watch library | Subtitle translator | -|---|---| -| Watch library with continue watching and episodes | Subtitle translator with four engines | +

+ Subtitle translator with a file loaded and four translation engines +

-
-بالعربي +### And more -**Flowbit** برنامج تورنت لويندوز ولينكس، تشاهد فيه الحلقة وهي تنزل. +- **English and Arabic**, with a full right-to-left layout, in light and dark themes +- **Select torrents** or all of them, and remove them together, with or without their files +- **Share** your own files and folders, or create a `.torrent` +- **Download and upload limits**, listening port and extra trackers +- **Stop when finished**, or keep seeding the torrents you choose +- **Light in the tray:** about 60 MB with the window closed +- **Opens magnet links and `.torrent` files**, without admin rights -- **مكتبة مشاهدة:** تكمل من حيث وقفت، والحلقات مرتبة حسب المسلسل، وتعلّم على اللي شفته. -- **مترجم ترجمات:** يترجم ملفات SRT و ASS و WebVTT للعربي ويحافظ على التوقيت والتنسيق. يشتغل مع Google و DeepL ونماذج الذكاء الاصطناعي المجانية (Gemini و Groq وغيرها)، وتختار أسلوب العربي: فصحى أو خليجي أو مصري أو شامي. -- **واجهة عربية كاملة** من اليمين لليسار. -- **مجاني ومفتوح المصدر.** +## Download -نزّله من صفحة [الإصدارات](https://github.com/GENERAL868/flowbit/releases/latest). +Get the latest version from the **[Releases page](https://github.com/GENERAL868/flowbit/releases/latest)**. -مكتبة المشاهدة بالعربي +### Windows -
+For Windows 10 and 11, 64-bit. mpv is included. -## Layout - -``` -ui/ the window: index.html, app.js, i18n.js (English, Arabic), style.css, app.css, fonts, sounds -src-tauri/src/ - lib.rs app setup, commands for the window, tray, notifications, single instance - engine.rs librqbit session, torrent and file views, safe file paths - stream_server.rs the localhost streaming server mpv plays from - player.rs starts mpv on a stream URL - library.rs watch library (library.json), following playback through mpv's IPC pipe - posters.rs posters grabbed with mpv, and the Mark of the Web - subtitles.rs SRT/WebVTT/ASS parsing and writing, timings untouched - translate.rs translation engines - keys.rs API keys (DPAPI on Windows, a private file on Linux) - media_cmds.rs commands for the library, posters and the subtitle translator - i18n.rs tray, notification and dialog texts in English and Arabic - drop.rs files dropped on the window (paths through WebView2, Windows) - prefs.rs preferences (prefs.json) - handlers.rs registers magnet links and .torrent files (Windows registry) - handlers_linux.rs the same on Linux (desktop entry + xdg-mime) -src-tauri/resources/ mpv's config, .torrent file icon (and mpv.exe, see below) -src-tauri/tauri.linux.conf.json Linux packages: deb, rpm, AppImage -src-tauri/patches/ librqbit 9.0.1 with Windows fixes (see patches/librqbit/PATCHES.md) -``` - -## Building +| File | What it is | +|---|---| +| `Flowbit-x.y.z-setup.exe` | Installer, for your account only (no admin rights) | +| `Flowbit-x.y.z-portable.zip` | Portable: unzip anywhere and run `Flowbit.exe`; settings stay in the folder | ### Linux -On Ubuntu or Debian, [`.github/scripts/linux-deps.sh`](.github/scripts/linux-deps.sh) installs -what's needed (WebKitGTK 4.1, the tray library…). Then, with [Rust](https://rustup.rs) and -[Node.js](https://nodejs.org) 20 or later: - -```bash -npm install -npx tauri build # .deb, .rpm and .AppImage in src-tauri/target/release/bundle -``` +For 64-bit distributions from 2022 on. The `.deb` and `.rpm` packages install mpv for you. -Running needs `mpv` (and `xdg-utils`, for magnet links). Releases build the Linux packages on -GitHub Actions ([`release.yml`](.github/workflows/release.yml)). - -### Windows - -You need Windows 10 or 11 with: - -- [Rust](https://rustup.rs) (stable, `x86_64-pc-windows-msvc`) and the MSVC build tools -- [Node.js](https://nodejs.org) 20 or later -- `mpv.exe`: it's over GitHub's 100 MB file limit, so it isn't in the repository. Download a - Windows x86_64 build from [shinchiro/mpv-winbuild-cmake](https://github.com/shinchiro/mpv-winbuild-cmake/releases) - (Flowbit 1.3 ships release 20261018) and put `mpv.exe` in `src-tauri/resources/mpv/`. +| Distribution | File | Install | +|---|---|---| +| Ubuntu, Debian, Mint, Pop!_OS… | `Flowbit-x.y.z-linux-amd64.deb` | `sudo apt install ./Flowbit-x.y.z-linux-amd64.deb` | +| Fedora, openSUSE, RHEL… | `Flowbit-x.y.z-linux-x86_64.rpm` | `sudo dnf install ./Flowbit-x.y.z-linux-x86_64.rpm` | +| Any other | `Flowbit-x.y.z-linux-x86_64.AppImage` | Install `mpv`, then `chmod +x Flowbit-*.AppImage` and run it | -```powershell -npm install -npx tauri build # installer in src-tauri/target/release/bundle/nsis -``` +## Good to know -For a portable copy, put `Flowbit.exe` and the `resources` folder from `src-tauri/target/release` -in a folder with an empty `Portable Settings` folder next to `Flowbit.exe`. +
+Windows says it protected my PC +
+Flowbit isn't code-signed yet, so SmartScreen warns about it. Choose More info → Run anyway. +
-## Notes +
+A torrent won't start downloading +
+Flowbit connects to peers over TCP. Torrents that only have web seeds or only browser (WebRTC) peers won't download. +
-- **Data:** `%LOCALAPPDATA%\app.flowbit.desktop` on Windows, `~/.local/share/app.flowbit.desktop` - on Linux (prefs, session, DHT, library, webview data). A `Portable Settings` folder next to - `Flowbit.exe` makes it portable. `FLOWBIT_DATA_DIR` overrides both, for tests. -- **Streaming:** a small server (`src/stream_server.rs`) on `127.0.0.1:52525` (or a random port if - taken). The fixed port and a secret kept in `stream-secret` keep stream URLs stable, so mpv - remembers where you stopped watching. -- **TCP only:** librqbit marks uTP as experimental. -- **Not supported by librqbit:** web seeds (BEP 19) and WebRTC peers, so torrents that only have - HTTP sources or only browser peers won't download. -- **Drag and drop:** Tauri's drop handling is off (`dragDropEnabled: false`), because the window - under the cursor belongs to WebView2's browser process, where it can't register. WebView2 takes - the drop, the page sends the files with `chrome.webview.postMessageWithAdditionalObjects`, and - `src/drop.rs` reads their paths. +
+Where are my settings? +
+In %LOCALAPPDATA%\app.flowbit.desktop on Windows and ~/.local/share/app.flowbit.desktop on Linux. The portable version keeps them in its own folder. +
-## Security +Flowbit is a general-purpose tool. Please download and share only what you have the right to. -What a malicious torrent, magnet link or website could do, and what stops it: +## Built with -| Risk | Fix | -|---|---| -| A file named `C:evil.exe` in a torrent: on Windows `PathBuf::push` replaces the whole path, so a torrent could write, or on removal delete, files anywhere | `patches/librqbit/src/safe_path.rs`: every name is made a plain file name (no `:`, `<>"|?*`, control characters, trailing dots/spaces, `CON`/`NUL`/`COM1`…), and paths must be relative. Also blocks alternate data streams (`file:stream`) | -| Websites reaching the localhost streaming server: probing or embedding your files, DNS rebinding | The server only streams, needs a 128-bit secret in the URL, accepts only `Host: 127.0.0.1`/`localhost`, GET/HEAD only, 8 KB of headers within 10 s | -| A magnet link with `tr=http://127.0.0.1:…` trackers making the app send requests to local services (SSRF) | Loopback trackers are removed from magnet links; `.torrent` URLs on loopback are refused | -| Clicking a `.exe`, `.bat`, `.lnk`, `.ps1`… (on Linux an executable, `.desktop` or `.sh` file) from a torrent runs it | Programs and scripts are shown in their folder instead of being opened; on Windows other downloads get the Mark of the Web | -| Dropping a file by mistake shares it publicly at once | Sharing dropped files and folders asks first | -| Pasted text or the `add` command reading any local file | Only magnet links, http(s) links, info hashes, and `.torrent` files up to 20 MB | -| Torrent and file names in the window (HTML injection) | Everything from torrents is escaped; the CSP allows no inline scripts; the window may only listen to events and only navigate inside the app | -| API keys for translation services | Encrypted with Windows DPAPI for your account (on Linux, a file with mode 0600), sent only to their own service over HTTPS, never sent back to the window | - -Dependencies: `cargo audit` reports `ringbuf` 0.4.8 (RUSTSEC-2026-0293) through librqbit's uTP code. -It needs an element whose `Drop` panics; uTP only stores bytes, and uTP is off here, so it can't -happen. +- **Torrent engine:** [librqbit](https://github.com/ikatson/rqbit), in Rust +- **App:** [Tauri](https://tauri.app) 2, on the system's webview +- **Player:** [mpv](https://mpv.io), in its own window with its own controls and shortcuts +- **Interface:** plain JavaScript, no build step ## Contributing -Bug reports, translations and pull requests are welcome: see [CONTRIBUTING.md](CONTRIBUTING.md) -and the [code of conduct](CODE_OF_CONDUCT.md). -Report security problems privately, as described in [SECURITY.md](SECURITY.md). Changes are listed -in [CHANGELOG.md](CHANGELOG.md). +Bug reports, translations and pull requests are welcome. + +- [Contributing guide](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md) +- [Building from source and how the code is laid out](docs/DEVELOPMENT.md) +- [Security policy](SECURITY.md): how to report a problem privately, and what's already protected +- [Changelog](CHANGELOG.md) ## License -MIT, see [LICENSE](LICENSE). Third-party parts keep their own licenses: librqbit (Apache-2.0), -mpv (GPL-2.0-or-later) and the fonts (SIL OFL 1.1). See -[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). +[MIT](LICENSE). Third-party parts keep their own licenses: librqbit (Apache-2.0), mpv (GPL-2.0-or-later) and the fonts (SIL OFL 1.1). See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). diff --git a/SECURITY.md b/SECURITY.md index 8039f41..9246f31 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -26,6 +26,24 @@ are especially interesting: - HTML or script injection into the window through torrent or file names - Leaking translation API keys -The protections already in place are listed under [Security](README.md#security) in the README. Bugs in librqbit itself that aren't specific to Flowbit can also go to [rqbit](https://github.com/ikatson/rqbit), and mpv bugs to [mpv](https://github.com/mpv-player/mpv). + +## What's already protected + +What a malicious torrent, magnet link or website could do, and what stops it: + +| Risk | Fix | +|---|---| +| A file named `C:evil.exe` in a torrent: on Windows `PathBuf::push` replaces the whole path, so a torrent could write, or on removal delete, files anywhere | `patches/librqbit/src/safe_path.rs`: every name is made a plain file name (no `:`, `<>"\|?*`, control characters, trailing dots/spaces, `CON`/`NUL`/`COM1`…), and paths must be relative. Also blocks alternate data streams (`file:stream`) | +| Websites reaching the localhost streaming server: probing or embedding your files, DNS rebinding | The server only streams, needs a 128-bit secret in the URL, accepts only `Host: 127.0.0.1`/`localhost`, GET/HEAD only, 8 KB of headers within 10 s | +| A magnet link with `tr=http://127.0.0.1:…` trackers making the app send requests to local services (SSRF) | Loopback trackers are removed from magnet links; `.torrent` URLs on loopback are refused | +| Clicking a `.exe`, `.bat`, `.lnk`, `.ps1`… (on Linux an executable, `.desktop` or `.sh` file) from a torrent runs it | Programs and scripts are shown in their folder instead of being opened; on Windows other downloads get the Mark of the Web | +| Dropping a file by mistake shares it publicly at once | Sharing dropped files and folders asks first | +| Pasted text or the `add` command reading any local file | Only magnet links, http(s) links, info hashes, and `.torrent` files up to 20 MB | +| Torrent and file names in the window (HTML injection) | Everything from torrents is escaped; the CSP allows no inline scripts; the window may only listen to events and only navigate inside the app | +| API keys for translation services | Encrypted with Windows DPAPI for your account (on Linux, a file with mode 0600), sent only to their own service over HTTPS, never sent back to the window | + +Dependencies: `cargo audit` reports `ringbuf` 0.4.8 (RUSTSEC-2026-0293) through librqbit's uTP code. +It needs an element whose `Drop` panics; uTP only stores bytes, and uTP is off here, so it can't +happen. diff --git a/assets/download-linux-ar.svg b/assets/download-linux-ar.svg new file mode 100644 index 0000000..605e016 --- /dev/null +++ b/assets/download-linux-ar.svg @@ -0,0 +1,5 @@ + + + + تنزيل للينكس + diff --git a/assets/download-linux.svg b/assets/download-linux.svg new file mode 100644 index 0000000..207e569 --- /dev/null +++ b/assets/download-linux.svg @@ -0,0 +1,5 @@ + + + + Download for Linux + diff --git a/assets/download-windows-ar.svg b/assets/download-windows-ar.svg new file mode 100644 index 0000000..5292948 --- /dev/null +++ b/assets/download-windows-ar.svg @@ -0,0 +1,5 @@ + + + + تنزيل لويندوز + diff --git a/assets/download-windows.svg b/assets/download-windows.svg new file mode 100644 index 0000000..94f1ef5 --- /dev/null +++ b/assets/download-windows.svg @@ -0,0 +1,5 @@ + + + + Download for Windows + diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md new file mode 100644 index 0000000..79b1b38 --- /dev/null +++ b/docs/DEVELOPMENT.md @@ -0,0 +1,65 @@ +# Development + +How the code is laid out, how to build Flowbit, and notes on how it works. To contribute, see also [CONTRIBUTING.md](../CONTRIBUTING.md). + +## Layout + +``` +ui/ the window: index.html, app.js, i18n.js (English, Arabic), style.css, app.css, fonts, sounds +src-tauri/src/ + lib.rs app setup, commands for the window, tray, notifications, single instance + engine.rs librqbit session, torrent and file views, safe file paths + stream_server.rs the localhost streaming server mpv plays from + player.rs starts mpv on a stream URL + library.rs watch library (library.json), following playback through mpv's IPC pipe + posters.rs posters grabbed with mpv, and the Mark of the Web + subtitles.rs SRT/WebVTT/ASS parsing and writing, timings untouched + translate.rs translation engines + keys.rs API keys (DPAPI on Windows, a private file on Linux) + media_cmds.rs commands for the library, posters and the subtitle translator + i18n.rs tray, notification and dialog texts in English and Arabic + drop.rs files dropped on the window (paths through WebView2, Windows) + prefs.rs preferences (prefs.json) + handlers.rs registers magnet links and .torrent files (Windows registry) + handlers_linux.rs the same on Linux (desktop entry + xdg-mime) +src-tauri/resources/ mpv's config, .torrent file icon (and mpv.exe, see below) +src-tauri/tauri.linux.conf.json Linux packages: deb, rpm, AppImage +src-tauri/patches/ librqbit 9.0.1 with Windows fixes (see patches/librqbit/PATCHES.md) +``` + +## Building + +### Linux + +On Ubuntu or Debian, [`.github/scripts/linux-deps.sh`](../.github/scripts/linux-deps.sh) installs what's needed (WebKitGTK 4.1, the tray library…). Then, with [Rust](https://rustup.rs) and [Node.js](https://nodejs.org) 20 or later: + +```bash +npm install +npx tauri build # .deb, .rpm and .AppImage in src-tauri/target/release/bundle +``` + +Running needs `mpv` (and `xdg-utils`, for magnet links). Releases build the Linux packages on GitHub Actions ([`release.yml`](../.github/workflows/release.yml)), on Ubuntu 22.04 (glibc 2.35, WebKitGTK 4.1). + +### Windows + +You need Windows 10 or 11 with: + +- [Rust](https://rustup.rs) (stable, `x86_64-pc-windows-msvc`) and the MSVC build tools +- [Node.js](https://nodejs.org) 20 or later +- `mpv.exe`: it's over GitHub's 100 MB file limit, so it isn't in the repository. Download a Windows x86_64 build from [shinchiro/mpv-winbuild-cmake](https://github.com/shinchiro/mpv-winbuild-cmake/releases) (Flowbit ships release 20261018) and put `mpv.exe` in `src-tauri/resources/mpv/`. + +```powershell +npm install +npx tauri build # installer in src-tauri/target/release/bundle/nsis +``` + +For a portable copy, put `Flowbit.exe` and the `resources` folder from `src-tauri/target/release` in a folder with an empty `Portable Settings` folder next to `Flowbit.exe`. + +## Notes + +- **Stack:** librqbit 9.0.1 for torrents; Tauri 2 on the system's webview (WebView2 on Windows, WebKitGTK on Linux); mpv for playback, bundled on Windows and the system's on Linux; plain JavaScript in `ui/`, with no build step. +- **Data:** `%LOCALAPPDATA%\app.flowbit.desktop` on Windows, `~/.local/share/app.flowbit.desktop` on Linux (prefs, session, DHT, library, webview data). A `Portable Settings` folder next to `Flowbit.exe` makes it portable. `FLOWBIT_DATA_DIR` overrides both, for tests. +- **Streaming:** a small server (`src/stream_server.rs`) on `127.0.0.1:52525` (or a random port if taken). The fixed port and a secret kept in `stream-secret` keep stream URLs stable, so mpv remembers where you stopped watching. +- **TCP only:** librqbit marks uTP as experimental. +- **Not supported by librqbit:** web seeds (BEP 19) and WebRTC peers, so torrents that only have HTTP sources or only browser peers won't download. +- **Drag and drop:** Tauri's drop handling is off (`dragDropEnabled: false`), because the window under the cursor belongs to WebView2's browser process, where it can't register. WebView2 takes the drop, the page sends the files with `chrome.webview.postMessageWithAdditionalObjects`, and `src/drop.rs` reads their paths. diff --git a/docs/screenshots/home-ar.png b/docs/screenshots/home-ar.png index 027fee8..2f90315 100644 Binary files a/docs/screenshots/home-ar.png and b/docs/screenshots/home-ar.png differ diff --git a/docs/screenshots/home-en.png b/docs/screenshots/home-en.png index d6f0ac8..6586317 100644 Binary files a/docs/screenshots/home-en.png and b/docs/screenshots/home-en.png differ diff --git a/docs/screenshots/library-ar.png b/docs/screenshots/library-ar.png index c75433e..d39f41c 100644 Binary files a/docs/screenshots/library-ar.png and b/docs/screenshots/library-ar.png differ diff --git a/docs/screenshots/library-en.png b/docs/screenshots/library-en.png index 15f41b7..03bdb97 100644 Binary files a/docs/screenshots/library-en.png and b/docs/screenshots/library-en.png differ diff --git a/docs/screenshots/translator-ar.png b/docs/screenshots/translator-ar.png new file mode 100644 index 0000000..b1d56e1 Binary files /dev/null and b/docs/screenshots/translator-ar.png differ diff --git a/docs/screenshots/translator-en.png b/docs/screenshots/translator-en.png index 2d8c3b7..2292ca4 100644 Binary files a/docs/screenshots/translator-en.png and b/docs/screenshots/translator-en.png differ