Skip to content

Commit 309e3b8

Browse files
authored
Webui revamp (#280)
1 parent 3063686 commit 309e3b8

File tree

445 files changed

+39400
-12481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

445 files changed

+39400
-12481
lines changed

.github/workflows/checks.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222
- name: Run linters
2323
run: |
2424
nix develop --ignore-environment --keep HOME . --command task lint
25+
# Adding golang-ci lint as a separate step as the Nix package is currently broken
26+
- name: golangci-lint
27+
uses: golangci/golangci-lint-action@v6
28+
with:
29+
version: v1.61
30+
args: --timeout=10m
2531

2632
test:
2733
runs-on: ubuntu-latest
@@ -65,13 +71,15 @@ jobs:
6571
- uses: cachix/install-nix-action@v26
6672
with:
6773
github_access_token: ${{ secrets.GITHUB_TOKEN }}
68-
- name: Install web UI, apply database migrations, generate code and build web app
74+
- name: Install web UI, apply database migrations, generate code, extract translations and build web app
6975
run: |
7076
nix develop --ignore-environment --command task install-webui
7177
nix develop --ignore-environment --keep HOME --keep POSTGRES_PASSWORD . --command task migrate
7278
nix develop --ignore-environment --keep HOME --keep POSTGRES_PASSWORD . --command task gen
79+
nix develop --ignore-environment . --command task i18n-extract
7380
nix develop --ignore-environment . --command task build-webui
7481
env:
7582
POSTGRES_PASSWORD: postgres
7683
- name: Check nothing changed
77-
run: git diff --exit-code
84+
# excluding the 3rdpartylicenses file in a horrible hack:
85+
run: git diff --exit-code -- . ':(exclude)webui/dist/bitmagnet/3rdpartylicenses.txt'

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
bitmagnet.io/schemas/**/*.*
22
webui/dist/**/*.*
33
webui/src/app/graphql/generated/**/*.*
4+
webui/src/app/i18n/translations/*.json
5+
webui/.angular

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:alpine3.18 AS build
1+
FROM golang:1.23.2-alpine3.20 AS build
22

33
RUN apk --update add \
44
gcc \
@@ -13,7 +13,7 @@ WORKDIR /build
1313

1414
RUN go build -ldflags "-s -w -X github.com/bitmagnet-io/bitmagnet/internal/version.GitTag=$(git describe --tags --always --dirty)"
1515

16-
FROM alpine:3.18
16+
FROM alpine:3.20
1717

1818
RUN apk --update add \
1919
curl \

Taskfile.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,19 @@ tasks:
4646
- go run . classifier schema --format json > ./bitmagnet.io/schemas/classifier-0.1.json
4747

4848
gen-webui-graphql:
49+
dir: ./webui
50+
cmds:
51+
- npm run graphql:codegen
52+
53+
i18n-extract:
54+
dir: ./webui
4955
cmds:
50-
- cd webui && npm run graphql:codegen
56+
- npm run i18n:extract
5157

5258
lint:
5359
cmds:
54-
- task lint-golangci
60+
# Removing golang-ci lint as the Nix package is currently broken
61+
# - task lint-golangci
5562
- task lint-webui
5663
- task lint-prettier
5764

@@ -93,7 +100,7 @@ tasks:
93100
build-webui:
94101
dir: ./webui
95102
cmds:
96-
- npm run build -- -c embedded
103+
- npm run build
97104

98105
build-docsite:
99106
dir: ./bitmagnet.io

bitmagnet.io/Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
source 'https://rubygems.org'
22

3-
gem "just-the-docs", "~> 0.6"
3+
gem "just-the-docs", "~> 0.10"
44
gem "jekyll", "~> 4.3"
55
gem "jekyll-redirect-from", "~> 0.16"
66
gem "jekyll-seo-tag"
77
gem "jekyll-target-blank", "~> 2.0"
8-
gem "kramdown", "~> 2.3"
8+
gem "kramdown", "~> 2.4"
99
gem "kramdown-parser-gfm", "~> 1.1"
1010
gem "webrick", "~> 1.8"

bitmagnet.io/Gemfile.lock

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
addressable (2.8.5)
5-
public_suffix (>= 2.0.2, < 6.0)
4+
addressable (2.8.7)
5+
public_suffix (>= 2.0.2, < 7.0)
6+
bigdecimal (3.1.8)
67
colorator (1.1.0)
7-
concurrent-ruby (1.2.2)
8+
concurrent-ruby (1.3.4)
89
em-websocket (0.5.3)
910
eventmachine (>= 0.12.9)
1011
http_parser.rb (~> 0)
1112
eventmachine (1.2.7)
12-
ffi (1.16.2)
13+
ffi (1.17.0-arm64-darwin)
14+
ffi (1.17.0-x86_64-linux-gnu)
1315
forwardable-extended (2.6.0)
14-
google-protobuf (3.24.3-arm64-darwin)
15-
google-protobuf (3.24.3-x86_64-linux)
16+
google-protobuf (4.28.2-arm64-darwin)
17+
bigdecimal
18+
rake (>= 13)
19+
google-protobuf (4.28.2-x86_64-linux)
20+
bigdecimal
21+
rake (>= 13)
1622
http_parser.rb (0.8.0)
17-
i18n (1.14.1)
23+
i18n (1.14.6)
1824
concurrent-ruby (~> 1.0)
19-
jekyll (4.3.2)
25+
jekyll (4.3.4)
2026
addressable (~> 2.4)
2127
colorator (~> 1.0)
2228
em-websocket (~> 0.5)
@@ -45,7 +51,7 @@ GEM
4551
nokogiri (~> 1.10)
4652
jekyll-watch (2.2.1)
4753
listen (~> 3.0)
48-
just-the-docs (0.6.2)
54+
just-the-docs (0.10.0)
4955
jekyll (>= 3.8.5)
5056
jekyll-include-cache
5157
jekyll-seo-tag (>= 2.0)
@@ -55,35 +61,34 @@ GEM
5561
kramdown-parser-gfm (1.1.0)
5662
kramdown (~> 2.0)
5763
liquid (4.0.4)
58-
listen (3.8.0)
64+
listen (3.9.0)
5965
rb-fsevent (~> 0.10, >= 0.10.3)
6066
rb-inotify (~> 0.9, >= 0.9.10)
6167
mercenary (0.4.0)
62-
nokogiri (1.16.5-arm64-darwin)
68+
nokogiri (1.16.7-arm64-darwin)
6369
racc (~> 1.4)
64-
nokogiri (1.16.5-x86_64-linux)
70+
nokogiri (1.16.7-x86_64-linux)
6571
racc (~> 1.4)
6672
pathutil (0.16.2)
6773
forwardable-extended (~> 2.6)
68-
public_suffix (5.0.3)
69-
racc (1.7.3)
70-
rake (13.0.6)
74+
public_suffix (6.0.1)
75+
racc (1.8.1)
76+
rake (13.2.1)
7177
rb-fsevent (0.11.2)
72-
rb-inotify (0.10.1)
78+
rb-inotify (0.11.1)
7379
ffi (~> 1.0)
74-
rexml (3.2.8)
75-
strscan (>= 3.0.9)
76-
rouge (4.1.3)
80+
rexml (3.3.8)
81+
rouge (4.4.0)
7782
safe_yaml (1.0.5)
78-
sass-embedded (1.68.0-arm64-darwin)
79-
google-protobuf (~> 3.23)
80-
sass-embedded (1.68.0-x86_64-linux-gnu)
81-
google-protobuf (~> 3.23)
82-
strscan (3.1.0)
83+
sass-embedded (1.79.5)
84+
google-protobuf (~> 4.27)
85+
rake (>= 13)
86+
sass-embedded (1.79.5-arm64-darwin)
87+
google-protobuf (~> 4.27)
8388
terminal-table (3.0.2)
8489
unicode-display_width (>= 1.1.1, < 3)
85-
unicode-display_width (2.4.2)
86-
webrick (1.8.1)
90+
unicode-display_width (2.6.0)
91+
webrick (1.8.2)
8792

8893
PLATFORMS
8994
arm64-darwin-22
@@ -95,10 +100,10 @@ DEPENDENCIES
95100
jekyll-redirect-from (~> 0.16)
96101
jekyll-seo-tag
97102
jekyll-target-blank (~> 2.0)
98-
just-the-docs (~> 0.6)
99-
kramdown (~> 2.3)
103+
just-the-docs (~> 0.10)
104+
kramdown (~> 2.4)
100105
kramdown-parser-gfm (~> 1.1)
101106
webrick (~> 1.8)
102107

103108
BUNDLED WITH
104-
2.5.7
109+
2.5.9

bitmagnet.io/faq.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,17 @@ As a rough guide, you should allow around 300MB RAM for BitMagnet, and at least
2424

2525
## I've started **bitmagnet** for the first time and am not seeing torrents right away, is something wrong?
2626

27-
If everything is working, **bitmagnet** should begin showing torrents in the web UI within a maximum of 10 minutes (which is its cache TTL). The round blue refresh button in the web UI is a cache buster - use it to see new torrent content in real time. Bear in mind that when a torrent is inserted into the database, a background queue job must run before it will become available in the UI. If you're importing thousands or millions of torrents, it might therefore take a while for everything to show. Check the next question if you're still not seeing torrents.
27+
If everything is working, **bitmagnet** should begin showing torrents in the web UI within a maximum of 10 minutes (which is its cache TTL). The refresh button at the top of the torrent listing is a cache buster - use it to see new torrent content in real time. Bear in mind that when a torrent is inserted into the database, a background queue job must run before it will become available in the UI. If you're importing thousands or millions of torrents, it might therefore take a while for everything to show. Check the next question if you're still not seeing torrents.
2828

2929
## **bitmagnet** isn't finding any new torrents, what's wrong?
3030

31-
{: .highlight }
32-
If **bitmagnet** isn't finding new torrents, it probably isn't due to a problem with the software - many people are using it successfully. You may have a networking or firewall issue, or a VPN misconfiguration preventing you from connecting to the DHT. Additionally, the TMDB API is blocked in certain countries; if you are in an affected country you may need to either disable the TMDB integration with the `tmdb.enabled` configuration key, or use a VPN.
31+
If **bitmagnet** isn't finding new torrents, it probably isn't due to a problem with the software - many people are using it successfully. You may have a networking or firewall issue, or a VPN misconfiguration preventing you from connecting to the DHT. Additionally, the TMDB API is blocked in certain countries; if you are in an affected country you may need to either disable the TMDB integration with the `tmdb.enabled` configuration key, or use a VPN. Configuring a personal TMDB API key (or disabling TMDB) will make the queue run a **lot** faster.
3332

34-
Here are some things to check if you're not seeing any new torrents:
33+
**bitmagnet** now shows its health status in the main toolbar: It will show a tick for health, a cross for unhealthy or sometimes 3 dots for pending. Click on it to open the health dialog and check that all workers are running and healthy. The dashboard can be used to monitor queue throughput. On the queues dashboard, the following would indicate a problem:
3534

36-
- Press the round blue refresh button in the UI.
37-
- Visit the metrics endpoint at `/metrics` and check the following metrics:
38-
- `bitmagnet_dht_crawler_persisted_total`: If you see a positive number for this, the DHT crawler is working and has found torrents.
39-
- If torrents are being persisted but you still don't see them in the UI, then check:`bitmagnet_queue_jobs_total{queue="process_torrent",status="processed"}`: If you see a positive number here, then the queue worker is running and processing jobs. If you see `status="failed"` or `status="retry"`, but no `status="processed"`, then something is wrong.
40-
- If no torrents are being persisted, check: `bitmagnet_dht_server_query_success_total` and `bitmagnet_dht_server_query_error_total`. Having some DHT query errors is completely normal, but if you see no successful queries then something is wrong.
41-
- If any of the above metrics are missing, you can assume their value is zero.
42-
- If the metrics confirm a problem, check the logs for errors.
35+
- A high number of pending jobs, and the number of processed jobs not increasing over time
36+
- A high number of failed jobs
37+
- No new jobs being created over time
4338

4439
## Why doesn't **bitmagnet** show me exactly how many torrents it has indexed?
4540

@@ -51,7 +46,7 @@ This will depend on a number of factors, including your hardware and network con
5146

5247
## How can I see exactly how many torrents **bitmagnet** has crawled in the current session?
5348

54-
Visit the metrics endpoint at `/metrics` and check the metric `bitmagnet_dht_crawler_persisted_total`. `{entity="Torrent"}` corresponds to newly crawled torrents, and `{entity="TorrentsTorrentSource"}` corresponds to torrents that were rediscovered and had their seeders/leechers count, and last-seen-on date updated.
49+
The new dashboard shows throughput of the crawler and job queue. Alternatively, visit the metrics endpoint at `/metrics` and check the metric `bitmagnet_dht_crawler_persisted_total`. `{entity="Torrent"}` corresponds to newly crawled torrents, and `{entity="TorrentsTorrentSource"}` corresponds to torrents that were rediscovered and had their seeders/leechers count, and last-seen-on date updated.
5550

5651
## How are the seeders/leechers numbers determined for torrents crawled from the DHT?
5752

@@ -69,6 +64,10 @@ No. The DHT crawler works by sampling random info hashes from the network, and w
6964

7065
**bitmagnet** is in early development, and improving the classifier will be an ongoing effort. When new versions are released, you can follow the [reclassify turorial](/tutorials/reprocess-reclassify.html) to reclassify torrents. If you'd like to [improve or customize the classifier](/guides/classifier.html), this is also possible.
7166

67+
## How can I make **bitmagnet** automatically delete torrents I'm not interested in?
68+
69+
A better question would be: why bother? Disk space is inexpensive in the quantities required by **bitmagnet**, and searching is easier than deleting. Nevertheless this is one of the most commonly asked questions, and it is possible to do this by [customizing the classifier](/guides/classifier.html). Please consider the wastage of resources and load on the network created by deleting what you've crawled. Also remember that the classifier isn't perfect: for example, enabling deletion of XXX content will also delete anything that has been mis-identified as XXX by the classifier, preventing you from finding it in future - for example because it contains a rude word. If you are deleting a large proportion of what you're crawling, you are almost certainly deleting over-zealously and you should consider just using one of the many indexer sites instead.
70+
7271
## Can I run multiple **bitmagnet** instances pointing to the same database?
7372

7473
Yes you can, just point multiple instances to one database and it will work - _but_ it will put more load on the database and cause the app to run slower. An alternative is to run multiple instances with multiple databases, and periodically [merge the databases](/guides/backup-restore-merge.html).

bitmagnet.io/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ This means that **bitmagnet** is not reliant on any external trackers or torrent
3636
- [x] A GraphQL API: currently this provides a single search query; there is also an embedded GraphQL playground at `/graphql`
3737
- [x] A web user interface implemented in Angular: currently this is a simple single-page application providing a user interface for search queries via the GraphQL API
3838
- [x] [A Torznab-compatible endpoint for integration with the Serverr stack](/guides/servarr-integration.html)
39+
- [x] A WebUI dashboard for monitoring and administration
3940

4041
### High priority features not yet implemented
4142

42-
- [ ] A WebUI dashboard showing things like crawler throughput, task queue, database size etc.
4343
- [ ] Authentication, API keys, access levels etc.
4444
- [ ] An admin API, and in general a more complete GraphQL API
45-
- [ ] A more complete web UI
4645
- [ ] Saved searches for content of particular interest, enabling custom feeds in addition to the following feature
4746
- [ ] Bi-directional integration with the [Prowlarr indexer proxy](https://prowlarr.com/): Currently **bitmagnet** can be added as an indexer in Prowlarr; bi-directional integration would allow **bitmagnet** to crawl content from any indexer configured in Prowlarr, unlocking many new sources of content
4847
- [ ] More documentation and more tests!

bitmagnet.io/setup/installation.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,17 @@ When referring to CLI commands in the rest of the documentation, for simplicity
8585
```sh
8686
bitmagnet --help
8787
```
88+
89+
## Starting **bitmagnet**
90+
91+
**bitmagnet** runs as multiple worker processes that can be started either individually or all at once. To start all workers, run:
92+
93+
```sh
94+
bitmagnet worker run --all
95+
```
96+
97+
Alternatively, specify individual workers to start:
98+
99+
```sh
100+
bitmagnet worker run --keys=http_server,queue_server,dht_crawler
101+
```

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
description = "A basic flake with a shell";
3-
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
3+
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
44
inputs.flake-utils.url = "github:numtide/flake-utils";
55

66
outputs = {
@@ -20,7 +20,7 @@
2020
go-task
2121
golangci-lint
2222
jekyll
23-
nodejs_20
23+
nodejs_22
2424
nodePackages.prettier
2525
protobuf
2626
protoc-gen-go

0 commit comments

Comments
 (0)