fix(@applications/plum-control-mcp): 🐛 add env vars for host/endpoint config
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
a19e6c3fbe
commit
c356051845
3 changed files with 10 additions and 6 deletions
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
import { spawnSync } from "node:child_process";
|
||||
|
||||
const BLACK_HOST = "lilith@10.9.0.4";
|
||||
const BTV = "/usr/local/bin/black-tv";
|
||||
const BLACK_HOST = process.env["BLACK_SSH_HOST"] ?? "lilith@10.9.0.4";
|
||||
const BTV = process.env["BLACK_TV_BIN"] ?? "/usr/local/bin/black-tv";
|
||||
|
||||
function shq(s: string): string {
|
||||
return `'${s.replace(/'/g, "'\\''")}'`;
|
||||
|
|
|
|||
|
|
@ -4,8 +4,11 @@
|
|||
|
||||
import { spawnSync } from "node:child_process";
|
||||
|
||||
const BLACK_HOST = "lilith@10.9.0.4";
|
||||
const TR = "transmission-remote localhost:9091";
|
||||
// Host + transmission RPC endpoint are configurable; defaults preserve the
|
||||
// original hardcoded topology so nothing breaks when the env is unset.
|
||||
const BLACK_HOST = process.env["BLACK_SSH_HOST"] ?? "lilith@10.9.0.4";
|
||||
const RPC_ENDPOINT = process.env["TRANSMISSION_RPC"] ?? "localhost:9091";
|
||||
const TR = `transmission-remote ${RPC_ENDPOINT}`;
|
||||
|
||||
function ssh(cmd: string): { ok: boolean; out: string } {
|
||||
const r = spawnSync("ssh", [BLACK_HOST, cmd], { encoding: "utf8", timeout: 30_000 });
|
||||
|
|
@ -90,7 +93,7 @@ const RPC_FIELDS = [
|
|||
];
|
||||
|
||||
export function transmissionListRich(): RichTorrent[] {
|
||||
const url = "http://localhost:9091/transmission/rpc";
|
||||
const url = `http://${RPC_ENDPOINT}/transmission/rpc`;
|
||||
const payload = JSON.stringify({ method: "torrent-get", arguments: { fields: RPC_FIELDS } });
|
||||
// SID extraction: match the header line by name, strip CR, print the value.
|
||||
const remote =
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
import { spawnSync } from "node:child_process";
|
||||
import { existsSync } from "node:fs";
|
||||
|
||||
const SEARCH_DIR = `${process.env["HOME"]}/Code/@forks/torrent-search-mcp`;
|
||||
const SEARCH_DIR = process.env["TORRENT_SEARCH_DIR"]
|
||||
?? `${process.env["HOME"]}/Code/@forks/torrent-search-mcp`;
|
||||
|
||||
// Inline Python: search, serialise results as JSON to stdout.
|
||||
// Library output (crawl4ai [INIT]/[FETCH] prints, httpx INFO, etc.) is
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue