best way to save what you love
Svelte collaborationdownloaderinstagramjavascriptmusicredditsocial-mediasoundcloudsveltetiktoktwittertypescriptvideovimeovkwebappyoutubeyoutube-downloader
api/config: store tunnelPort in env
jj90d57ab6ea86
diff --git a/api/src/config.js b/api/src/config.jsindex 899dfe49..925b51df 100644--- a/api/src/config.js+++ b/api/src/config.js@@ -14,6 +14,7 @@ const enabledServices = new Set(Object.keys(services).filter(e => {const env = {apiURL: process.env.API_URL || '',apiPort: process.env.API_PORT || 9000,+ tunnelPort: process.env.API_PORT || 9000,listenAddress: process.env.API_LISTEN_ADDRESS,freebindCIDR: process.platform === 'linux' && process.env.FREEBIND_CIDR,@@ -56,8 +57,7 @@ const env = {const genericUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36";const cobaltUserAgent = `cobalt/${version} (+https://github.com/imputnet/cobalt)`;-export let tunnelPort = env.apiPort;-export const setTunnelPort = (port) => tunnelPort = port;+export const setTunnelPort = (port) => env.tunnelPort = port;export const isCluster = env.instanceCount > 1;if (env.sessionEnabled && env.jwtSecret.length < 16) {diff --git a/api/src/stream/manage.js b/api/src/stream/manage.jsindex fc6ffe2d..de4a2cf6 100644--- a/api/src/stream/manage.js+++ b/api/src/stream/manage.js@@ -5,7 +5,7 @@ import { randomBytes } from "crypto";import { strict as assert } from "assert";import { setMaxListeners } from "node:events";-import { env, tunnelPort } from "../config.js";+import { env } from "../config.js";import { closeRequest } from "./shared.js";import { decryptStream, encryptStream } from "../misc/crypto.js";import { hashHmac } from "../security/secrets.js";@@ -102,7 +102,7 @@ export function createInternalStream(url, obj = {}) {isHLS: obj.isHLS,});- let streamLink = new URL('/itunnel', `http://127.0.0.1:${tunnelPort}`);+ let streamLink = new URL('/itunnel', `http://127.0.0.1:${env.tunnelPort}`);streamLink.searchParams.set('id', streamID);const cleanup = () => {