From 1653baa76ecf3300713a68a6f777a0f7f89d7989 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Thu, 22 Apr 2021 03:54:31 -0500 Subject: [PATCH] Update IPC path and fix logging issue --- services/torrent-webui/.env.example | 2 +- services/torrent-webui/Dockerfile | 1 + services/torrent-webui/src/server/services/TorrentClientIpc.ts | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/torrent-webui/.env.example b/services/torrent-webui/.env.example index 02eeb13..60277d4 100644 --- a/services/torrent-webui/.env.example +++ b/services/torrent-webui/.env.example @@ -1,2 +1,2 @@ SERVER_PORT = 3300 -TORRENT_CLIENT_IPC_SOCKET = /tmp/torrent_client.sock +TORRENT_CLIENT_IPC_SOCKET = /var/autoplex/ipc/torrent_client.sock diff --git a/services/torrent-webui/Dockerfile b/services/torrent-webui/Dockerfile index eb2b428..f5285e6 100644 --- a/services/torrent-webui/Dockerfile +++ b/services/torrent-webui/Dockerfile @@ -1,5 +1,6 @@ FROM node:14-alpine AS base WORKDIR /app +RUN mkdir /var/autoplex && chown node:node -R /var/autoplex # An image containing necessary components for building FROM base AS builder diff --git a/services/torrent-webui/src/server/services/TorrentClientIpc.ts b/services/torrent-webui/src/server/services/TorrentClientIpc.ts index be4be1b..1e589a3 100644 --- a/services/torrent-webui/src/server/services/TorrentClientIpc.ts +++ b/services/torrent-webui/src/server/services/TorrentClientIpc.ts @@ -35,6 +35,7 @@ export default class TorrentClientIpc */ public boot() { return new Promise((resolve, reject) => { + console.log(process.env["TORRENT_CLIENT_IPC_SOCKET"]); ipc.connectTo("torrent_client", process.env["TORRENT_CLIENT_IPC_SOCKET"], () => { this.socket = ipc.of["torrent_client"]; this.installSocketEventHandlers(this.socket); @@ -60,7 +61,7 @@ export default class TorrentClientIpc // Socket Event Handlers ----------------------------------------------------------------------- protected onConnect() { - if (this.__isConnected) { + if (!this.__isConnected) { console.log("IPC: Connection established"); } this.__isConnected = true;