Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
52a9d5e43d
|
|||
|
f7f97d084a
|
|||
|
95c1164366
|
|||
|
ca89ba18f1
|
|||
|
81a837de99
|
|||
|
f63a8d7647
|
|||
|
24d758da1c
|
|||
|
5ae88de22f
|
|||
|
82faef4cba
|
|||
|
2396795617
|
@@ -57,20 +57,60 @@ jobs:
|
||||
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
|
||||
VERSION="${GITHUB_REF#refs/tags/v}"
|
||||
else
|
||||
VERSION=$(grep '^version' monsoon-server/Cargo.toml | head -1 | cut -d'"' -f2)
|
||||
VERSION=$(sed -n '/\[workspace\.package\]/,/\[/{ s/^version *= *"\(.*\)"/\1/p }' Cargo.toml)
|
||||
fi
|
||||
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "Building version: ${VERSION}"
|
||||
|
||||
- name: Generate source tarball
|
||||
- name: Stamp version into all manifests
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.VERSION }}"
|
||||
# Use git archive if available, otherwise tar the checkout directly
|
||||
if command -v git &>/dev/null && [ -d .git ]; then
|
||||
git archive --prefix=monsoon-${VERSION}/ HEAD | gzip > monsoon-${VERSION}.tar.gz
|
||||
else
|
||||
cd .. && tar czf monsoon-${VERSION}.tar.gz --transform "s,^monsoon,monsoon-${VERSION}," --exclude='target' --exclude='node_modules' --exclude='dist' --exclude='vendor' monsoon && mv monsoon-${VERSION}.tar.gz monsoon/
|
||||
fi
|
||||
# Cargo workspace version (single source of truth for Rust crates)
|
||||
sed -i '/\[workspace\.package\]/,/\[/{ s/^version = ".*"/version = "'"${VERSION}"'"/ }' Cargo.toml
|
||||
# Tauri
|
||||
sed -i 's/"version": "[^"]*"/"version": "'"${VERSION}"'"/' src-tauri/tauri.conf.json
|
||||
# Frontend package.json files
|
||||
sed -i 's/"version": "[^"]*"/"version": "'"${VERSION}"'"/' package.json
|
||||
sed -i 's/"version": "[^"]*"/"version": "'"${VERSION}"'"/' monsoon-web/package.json
|
||||
# RPM spec
|
||||
sed -i "s/^Version:.*/Version: ${VERSION}/" monsoon.spec
|
||||
echo "Stamped version ${VERSION} into all manifests"
|
||||
|
||||
- name: Pre-build frontends
|
||||
run: |
|
||||
set -ex
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm build
|
||||
ls -la dist/
|
||||
cd monsoon-web
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm build
|
||||
ls -la dist/
|
||||
cd ..
|
||||
|
||||
- name: Generate source tarball
|
||||
run: |
|
||||
set -ex
|
||||
VERSION="${{ steps.version.outputs.VERSION }}"
|
||||
# Verify dist/ exists before tarring
|
||||
ls -la dist/index.html
|
||||
ls -la monsoon-web/dist/index.html
|
||||
# Include pre-built dist/ and monsoon-web/dist/ so the RPM build
|
||||
# doesn't need Node.js/pnpm. Write to /tmp to avoid "file changed
|
||||
# as we read it" from tar writing into the directory it's reading.
|
||||
tar czf /tmp/monsoon-${VERSION}.tar.gz \
|
||||
--transform "s,^\.,monsoon-${VERSION}," \
|
||||
--exclude='./target' \
|
||||
--exclude='./node_modules' \
|
||||
--exclude='./monsoon-web/node_modules' \
|
||||
--exclude='./vendor' \
|
||||
--exclude='./.git' \
|
||||
--exclude='*.tar.gz' \
|
||||
--exclude='*.src.rpm' \
|
||||
.
|
||||
mv /tmp/monsoon-${VERSION}.tar.gz .
|
||||
# Verify frontend assets are in the tarball
|
||||
tar tzf monsoon-${VERSION}.tar.gz | grep "dist/index.html"
|
||||
|
||||
- name: Vendor Rust dependencies
|
||||
run: |
|
||||
@@ -81,9 +121,6 @@ jobs:
|
||||
|
||||
- name: Build SRPM
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.VERSION }}"
|
||||
# Bake the version into the spec so COPR sees it when rebuilding
|
||||
sed -i "s/^Version:.*/Version: ${VERSION}/" monsoon.spec
|
||||
rpmbuild -bs monsoon.spec \
|
||||
--define "_sourcedir $(pwd)" \
|
||||
--define "_srcrpmdir $(pwd)"
|
||||
|
||||
@@ -7,6 +7,7 @@ members = [
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
license = "GPL-3.0-or-later"
|
||||
repository = "https://git.lair.cafe/monsoon/monsoon"
|
||||
|
||||
65
README.md
65
README.md
@@ -1,11 +1,21 @@
|
||||
# Monsoon
|
||||
|
||||
[](https://copr.fedorainfracloud.org/coprs/grenade/monsoon/package/monsoon/)
|
||||
|
||||
A fast BitTorrent client for the GNOME desktop and headless servers, built on the [Vortex](https://github.com/Nehliin/vortex) io-uring engine.
|
||||
|
||||
Two interfaces:
|
||||
- **Desktop app** -- Tauri + Svelte GUI with GNOME integration
|
||||
- **Headless server** -- REST API + WebSocket + web GUI for remote/LAN deployment
|
||||
|
||||
## Install from COPR (Fedora)
|
||||
|
||||
```bash
|
||||
sudo dnf copr enable grenade/monsoon
|
||||
sudo dnf install monsoon # desktop app
|
||||
sudo dnf install monsoon-server # headless server
|
||||
```
|
||||
|
||||
## Screenshots
|
||||
|
||||
### Torrent List
|
||||
@@ -20,46 +30,39 @@ Two interfaces:
|
||||
### Files
|
||||

|
||||
|
||||
## Dependencies
|
||||
## Building from Source
|
||||
|
||||
### Fedora
|
||||
### Dependencies (Fedora)
|
||||
|
||||
```bash
|
||||
sudo dnf install gtk3-devel webkit2gtk4.1-devel libsoup3-devel \
|
||||
sudo dnf install rust cargo gcc nodejs pnpm \
|
||||
gtk3-devel webkit2gtk4.1-devel libsoup3-devel \
|
||||
pango-devel gdk-pixbuf2-devel glib2-devel libappindicator-gtk3-devel
|
||||
```
|
||||
|
||||
The GTK dependencies are only needed for the desktop app. The headless server has no system library requirements beyond a working Rust toolchain.
|
||||
The GTK dependencies are only needed for the desktop app. The headless server only requires `rust`, `cargo`, and `gcc`.
|
||||
|
||||
### Toolchain
|
||||
|
||||
- Rust 1.85+ (edition 2024)
|
||||
- Node.js 18+
|
||||
- [pnpm](https://pnpm.io)
|
||||
- [Tauri CLI](https://tauri.app): `cargo install tauri-cli` (desktop app only)
|
||||
|
||||
## Desktop App
|
||||
|
||||
### Development
|
||||
### Desktop App
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
cargo tauri dev
|
||||
pnpm install && pnpm build # build frontend
|
||||
cargo build --release -p monsoon # build desktop binary (embeds frontend)
|
||||
```
|
||||
|
||||
### Release
|
||||
For development with hot-reload: `cargo install tauri-cli && cargo tauri dev`
|
||||
|
||||
### Headless Server
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
cargo tauri build
|
||||
cd monsoon-web && pnpm install && pnpm build && cd ..
|
||||
cargo build --release -p monsoon-server
|
||||
```
|
||||
|
||||
The release binary is at `target/release/monsoon` with the frontend assets embedded.
|
||||
|
||||
### Install
|
||||
### Manual Install
|
||||
|
||||
```bash
|
||||
sudo install -Dm755 target/release/monsoon /usr/local/bin/monsoon
|
||||
sudo install -Dm755 target/release/monsoon-server /usr/local/bin/monsoon-server
|
||||
sudo install -Dm644 data/cafe.lair.monsoon.desktop /usr/share/applications/cafe.lair.monsoon.desktop
|
||||
sudo install -Dm644 data/cafe.lair.monsoon.metainfo.xml /usr/share/metainfo/cafe.lair.monsoon.metainfo.xml
|
||||
sudo install -Dm644 src-tauri/icons/icon.png /usr/share/icons/hicolor/256x256/apps/cafe.lair.monsoon.png
|
||||
@@ -70,18 +73,11 @@ sudo gtk-update-icon-cache /usr/share/icons/hicolor/
|
||||
|
||||
## Headless Server
|
||||
|
||||
### Building
|
||||
|
||||
```bash
|
||||
cd monsoon-web && pnpm install && pnpm build && cd ..
|
||||
cargo build --release -p monsoon-server
|
||||
```
|
||||
|
||||
### Running
|
||||
|
||||
```bash
|
||||
# With web GUI (run from the repo root, or set MONSOON_WEB_DIR)
|
||||
cargo run --bin monsoon-server
|
||||
monsoon-server
|
||||
|
||||
# Or with explicit web asset path
|
||||
MONSOON_WEB_DIR=/path/to/monsoon-web/dist monsoon-server
|
||||
@@ -89,6 +85,13 @@ MONSOON_WEB_DIR=/path/to/monsoon-web/dist monsoon-server
|
||||
|
||||
The server listens on `0.0.0.0:3000` by default. Open `http://server-ip:3000` in a browser for the web GUI.
|
||||
|
||||
### Systemd
|
||||
|
||||
```bash
|
||||
sudo install -Dm644 data/monsoon-server.service /usr/lib/systemd/system/monsoon-server.service
|
||||
sudo systemctl enable --now monsoon-server
|
||||
```
|
||||
|
||||
### REST API
|
||||
|
||||
| Method | Endpoint | Description |
|
||||
@@ -138,12 +141,14 @@ Configure in `~/.config/monsoon/config.toml`:
|
||||
|
||||
```toml
|
||||
[server]
|
||||
listen_addr = "0.0.0.0:3000"
|
||||
max_concurrent_downloads = 3
|
||||
min_peers_before_queue = 2
|
||||
seed_completed_by_default = true
|
||||
webhook_url = "http://localhost:8080/hook"
|
||||
```
|
||||
|
||||
- **listen_addr** -- HTTP API and web GUI listen address (default `0.0.0.0:3000`)
|
||||
- **max_concurrent_downloads** -- new torrents are queued when all slots are full; the next queued torrent auto-starts when a slot frees up
|
||||
- **min_peers_before_queue** -- if a torrent has fewer peers than this and download speed is below 1 KiB/s for 30 consecutive seconds, it rotates to the back of the queue
|
||||
- **seed_completed_by_default** -- when `false`, completed torrents are paused instead of seeding
|
||||
|
||||
2
dist.sh
2
dist.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
VERSION=$(grep '^version' monsoon-server/Cargo.toml | head -1 | cut -d'"' -f2)
|
||||
VERSION=$(sed -n '/\[workspace\.package\]/,/\[/{ s/^version *= *"\(.*\)"/\1/p }' Cargo.toml)
|
||||
NAME=monsoon
|
||||
|
||||
echo "Packaging ${NAME}-${VERSION}..."
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "monsoon-core"
|
||||
version = "0.1.0"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "monsoon-server"
|
||||
version = "0.1.0"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": ["esbuild"]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
"svelte": "^5.0.0",
|
||||
|
||||
19
monsoon.spec
19
monsoon.spec
@@ -20,8 +20,6 @@ BuildRequires: pango-devel
|
||||
BuildRequires: gdk-pixbuf2-devel
|
||||
BuildRequires: glib2-devel
|
||||
BuildRequires: libappindicator-gtk3-devel
|
||||
BuildRequires: nodejs
|
||||
BuildRequires: pnpm
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: libappstream-glib
|
||||
BuildRequires: systemd-rpm-macros
|
||||
@@ -60,18 +58,13 @@ directory = "vendor"
|
||||
EOF
|
||||
|
||||
%build
|
||||
# Build web GUI for server
|
||||
cd monsoon-web && pnpm install --offline && pnpm build && cd ..
|
||||
# Prevent brp-mangle-shebangs from misinterpreting Rust #![...] attributes
|
||||
# in vendored sources as shebangs
|
||||
%global __brp_mangle_shebangs_exclude_from /usr/src/debug
|
||||
|
||||
# Build server binary
|
||||
cargo build --release -p monsoon-server
|
||||
|
||||
# Build desktop frontend
|
||||
pnpm install --offline
|
||||
pnpm build
|
||||
|
||||
# Build desktop binary (reads frontend from dist/)
|
||||
cargo build --release -p monsoon
|
||||
# Frontends are pre-built and included in the source tarball
|
||||
# (dist/ for desktop, monsoon-web/dist/ for server web GUI)
|
||||
cargo build --release -p monsoon -p monsoon-server
|
||||
|
||||
%install
|
||||
# Desktop app
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"preview": "vite preview",
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": ["esbuild"]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
"@tauri-apps/api": "^2.5.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "monsoon"
|
||||
version = "0.1.0"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user