@muhammedaksam/easiarr 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muhammedaksam/easiarr",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "TUI tool for generating docker-compose files for the *arr media ecosystem with 41 apps, TRaSH Guides best practices, VPN routing, and Traefik reverse proxy support",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
@@ -178,21 +178,33 @@ export class QBittorrentClient {
178
178
 
179
179
  /**
180
180
  * Configure qBittorrent for TRaSH Guide compliance
181
- * Sets proper save paths and creates categories based on enabled apps
181
+ * Sets proper save paths and creates categories based on enabled *arr apps
182
182
  * @param categories - Array of {name, savePath} for each enabled *arr app
183
+ * @param auth - Optional credentials to enforce (update username/password)
183
184
  */
184
- async configureTRaSHCompliant(categories: QBittorrentCategory[] = []): Promise<void> {
185
+ async configureTRaSHCompliant(
186
+ categories: QBittorrentCategory[] = [],
187
+ auth?: { user: string; pass: string }
188
+ ): Promise<void> {
185
189
  debugLog("qBittorrent", "Configuring TRaSH-compliant settings")
186
190
 
187
191
  // 1. Set global preferences
188
192
  debugLog("qBittorrent", "Setting save_path to /data/torrents")
189
- await this.setPreferences({
193
+ const prefs: Record<string, unknown> = {
190
194
  save_path: "/data/torrents",
191
195
  temp_path_enabled: false,
192
196
  auto_tmm_enabled: true,
193
197
  category_changed_tmm_enabled: true,
194
198
  save_path_changed_tmm_enabled: true,
195
- })
199
+ }
200
+
201
+ if (auth) {
202
+ debugLog("qBittorrent", "Setting WebUI username/password")
203
+ prefs.web_ui_username = auth.user
204
+ prefs.web_ui_password = auth.pass
205
+ }
206
+
207
+ await this.setPreferences(prefs)
196
208
 
197
209
  // 2. Create categories for each enabled media type
198
210
  for (const cat of categories) {
@@ -247,6 +247,20 @@ export const APPS: Record<AppId, AppDefinition> = {
247
247
  // TRaSH: Mount full /data for consistent paths with *arr apps (enables hardlinks)
248
248
  volumes: (root) => [`${root}/config/qbittorrent:/config`, `${root}/data:/data`],
249
249
  environment: { WEBUI_PORT: "8080" },
250
+ secrets: [
251
+ {
252
+ name: "QBITTORRENT_USER",
253
+ description: "Username for qBittorrent WebUI",
254
+ required: false,
255
+ default: "admin",
256
+ },
257
+ {
258
+ name: "QBITTORRENT_PASSWORD",
259
+ description: "Password for qBittorrent WebUI",
260
+ required: false,
261
+ mask: true,
262
+ },
263
+ ],
250
264
  trashGuide: "docs/Downloaders/qBittorrent/",
251
265
  },
252
266
 
@@ -296,10 +296,10 @@ export class FullAutoSetup extends BoxRenderable {
296
296
  const host = "localhost"
297
297
  const port = qbConfig.port || 8080
298
298
  const user = this.env["QBITTORRENT_USER"] || "admin"
299
- const pass = this.env["QBITTORRENT_PASS"] || ""
299
+ const pass = this.env["QBITTORRENT_PASSWORD"] || this.env["QBITTORRENT_PASS"] || ""
300
300
 
301
301
  if (!pass) {
302
- this.updateStep("qBittorrent", "skipped", "No QBITTORRENT_PASS in .env")
302
+ this.updateStep("qBittorrent", "skipped", "No QBITTORRENT_PASSWORD in .env")
303
303
  this.refreshContent()
304
304
  return
305
305
  }
@@ -319,7 +319,7 @@ export class FullAutoSetup extends BoxRenderable {
319
319
  savePath: `/data/torrents/${cat.name}`,
320
320
  }))
321
321
 
322
- await client.configureTRaSHCompliant(categories)
322
+ await client.configureTRaSHCompliant(categories, { user, pass })
323
323
  this.updateStep("qBittorrent", "success")
324
324
  } catch (e) {
325
325
  this.updateStep("qBittorrent", "error", `${e}`)
@@ -162,7 +162,7 @@ export class QBittorrentSetup extends BoxRenderable {
162
162
  savePath: `/data/torrents/${cat.name}`,
163
163
  }))
164
164
 
165
- await client.configureTRaSHCompliant(categories)
165
+ await client.configureTRaSHCompliant(categories, { user: this.user, pass: this.pass })
166
166
 
167
167
  const catNames = categories.map((c) => c.name).join(", ") || "none"
168
168
  this.statusMessage = `✅ Done!\n\n save_path: /data/torrents\n Categories: ${catNames}\n\n Press Enter to continue.`