Skip to content

Commit 8fd80ef

Browse files
authored
Use real qbittorrent in dev (#141)
* docker-compose for qbittorrent * let qbittorrent serve dev build - no longer need http prod config - temp login page is useless now - simplifies other things * helpful script for running in dev * dev container instructions * bump app ver, cleanup
1 parent b7dfa91 commit 8fd80ef

16 files changed

+85
-211
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ testem.log
4444
# System Files
4545
.DS_Store
4646
Thumbs.db
47+
48+
49+
# qBittorrent dev container
50+
dev/config
51+
dev/downloads
52+
dev/www

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ This app relies on a couple files to work properly.
3232
Under `src/assets/` there are two files: `config.json` and `config.prod.json`. This will store general configuration, such as the delimeter used when parsing file paths (Unix vs. Windows).
3333

3434
### HTTP Config
35-
Under `src/assets/` there are two files: `http_config.json` and `http_config.prod.json`. During the production build, the former is replaced with the latter file.
36-
3735
If you wish to configure your endpoints and other data for dev/prod, do so here.
3836

3937

angular.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
"replace": "src/environments/environment.ts",
4141
"with": "src/environments/environment.prod.ts"
4242
},
43-
{
44-
"replace": "src/assets/http_config.json",
45-
"with": "src/assets/http_config.prod.json"
46-
},
4743
{
4844
"replace": "src/assets/config.json",
4945
"with": "src/assets/config.prod.json"

dev/README.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Running qBittorrent in a docker container during development. Allows for more complete and accurate testing, as opposed to the "mock server" originally used.
2+
3+
The folder structure is as follows:
4+
- "config"
5+
- holds qbittorrent configuration files
6+
- "downloads"
7+
- where all the torrent downloads are saved
8+
- "www"
9+
- holds dev builds for both login and the main UI
10+
11+
12+
To setup the dev env:
13+
1. Go to "dev" folder
14+
2. Run: docker-compose up -d
15+
3. Open up the default web ui and set desired username/password
16+
4. Under Web UI settings, set the path to "/www"
17+
5. Go to project root
18+
6. Run: npm run dev
19+
7. Go to http://localhost:8090
20+
21+
Note: If you make any changes to the source code, you will have to hard-reload the page each time (Ctrl + Shift + R on Windows).

dev/docker-compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: "2.1"
2+
services:
3+
qbittorrent:
4+
image: linuxserver/qbittorrent:version-14.3.8.99202110081405-7423-ac5c264e6ubuntu20.04.1
5+
container_name: qbit-matUI-dev-container
6+
environment:
7+
- PUID=1000
8+
- PGID=1000
9+
- TZ=America/New_York
10+
- WEBUI_PORT=8090
11+
volumes:
12+
- ./config:/config
13+
- ./downloads:/downloads
14+
- ./www:/www
15+
ports:
16+
- 6881:6881
17+
- 6881:6881/udp
18+
- 8090:8090
19+
restart: unless-stopped

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"scripts": {
44
"ng": "ng",
55
"start": "ng serve",
6+
"dev": "ng build --watch --output-path=\"dev/www/private\"",
67
"build": "ng build",
78
"build_prod": "ng build --prod",
89
"test": "ng test",

scripts/builds/build_prod.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,5 @@ echo "Copying login page to existing builds..."
6565
cp -r "$default_build_path/$login_build" "$default_build_path/$win_build/public"
6666
cp -r "$default_build_path/$login_build" "$default_build_path/$unix_build/public"
6767

68-
# Step (6) -- Compress both builds into .zip
69-
# echo "Compressing builds..."
70-
# pushd "$default_build_path" > /dev/null
71-
# tar -zcvf "$win_build.zip" "$win_build"
72-
# tar -zcvf "$unix_build.zip" "$unix_build"
73-
# popd > /dev/null
74-
7568
echo
7669
echo "Done!"

src/app/app.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "1.13.0"
2+
"version": "1.14.0"
33
}

src/app/app.module.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { AppComponent } from './app.component';
1313
import { CookieService } from 'ngx-cookie-service';
1414
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
1515
import { TorrentsTableComponent } from './torrents-table/torrents-table.component';
16-
import { LoginComponent } from './login/login.component';
1716
import { HomeComponent } from './home/home.component';
1817
import { environment } from 'src/environments/environment';
1918
import { MatSortModule } from '@angular/material/sort';
@@ -72,8 +71,7 @@ var appRoutes: Routes;
7271
// Login page is only needed during development/testing
7372
if(!environment.production){
7473
appRoutes = [
75-
{ path: '', component: LoginComponent},
76-
{ path: 'home', component: HomeComponent}
74+
{ path: '', component: HomeComponent}
7775
]
7876
} else {
7977
appRoutes = [
@@ -85,7 +83,6 @@ if(!environment.production){
8583
declarations: [
8684
AppComponent,
8785
TorrentsTableComponent,
88-
LoginComponent,
8986
HomeComponent,
9087
AddTorrentDialogComponent,
9188
DeleteTorrentDialogComponent,

src/app/login/login.component.css

Whitespace-only changes.

0 commit comments

Comments
 (0)