Skip to content

Commit 2836d6c

Browse files
committed
fix: Redis config
1 parent 5f6d8c9 commit 2836d6c

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

src/data/composeTemplates.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ const generateEditorEnv = (config, deploymentType) => {
7979
if (deploymentType !== 'aio') {
8080
if (redisExternal) {
8181
// External Redis - editor connects to m3u-redis container
82+
// Disable embedded Redis since we're using external
83+
addEnvVar(envVars, 'REDIS_ENABLED', false);
8284
addEnvVar(envVars, 'REDIS_HOST', 'm3u-redis');
8385
addEnvVar(envVars, 'REDIS_SERVER_PORT', config.REDIS_SERVER_PORT || '6379');
8486
addEnvVar(envVars, 'REDIS_PASSWORD', config.REDIS_PASSWORD);
@@ -138,9 +140,9 @@ const generateVolumes = (config) => {
138140
// Generate m3u-proxy service
139141
const generateProxyService = (config, useVpnNetwork = false) => {
140142
const redisExternal = isRedisExternal(config);
141-
const redisAddr = redisExternal
142-
? `m3u-redis:${config.REDIS_SERVER_PORT || '6379'}`
143-
: `m3u-editor:${config.REDIS_SERVER_PORT || '6379'}`;
143+
// When redis is external, proxy connects to m3u-redis container
144+
// When redis is internal (embedded in editor), proxy connects to m3u-editor container
145+
const redisHost = redisExternal ? 'm3u-redis' : 'm3u-editor';
144146

145147
let service = `
146148
m3u-proxy:
@@ -155,13 +157,22 @@ const generateProxyService = (config, useVpnNetwork = false) => {
155157
service += `
156158
environment:
157159
- API_TOKEN=\${M3U_PROXY_TOKEN:-${config.M3U_PROXY_TOKEN}}
158-
- REDIS_ADDR=${redisAddr}`;
160+
- REDIS_ENABLED=true
161+
- REDIS_HOST=${redisHost}
162+
- REDIS_SERVER_PORT=${config.REDIS_SERVER_PORT || '6379'}
163+
- REDIS_DB=6`;
159164

160165
if (redisExternal && config.REDIS_PASSWORD) {
161166
service += `
162167
- REDIS_PASSWORD=\${REDIS_PASSWORD:-${config.REDIS_PASSWORD}}`;
163168
}
164169

170+
// Only add ENABLE_TRANSCODING_POOLING if it's enabled (default true)
171+
if (config.ENABLE_TRANSCODING_POOLING !== false) {
172+
service += `
173+
- ENABLE_TRANSCODING_POOLING=true`;
174+
}
175+
165176
service += `
166177
- LOG_LEVEL=${config.M3U_PROXY_LOG_LEVEL || 'INFO'}`;
167178

@@ -181,6 +192,9 @@ const generateProxyService = (config, useVpnNetwork = false) => {
181192
if (redisExternal) {
182193
service += `
183194
- m3u-redis`;
195+
} else {
196+
service += `
197+
- m3u-editor`;
184198
}
185199
} else {
186200
if (redisExternal) {

src/data/composeWizardConfig.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,15 @@ export const WIZARD_SECTIONS = [
234234
],
235235
deploymentTypes: ['modular', 'vpn', 'external-nginx', 'external-caddy'],
236236
},
237+
{
238+
name: 'ENABLE_TRANSCODING_POOLING',
239+
label: 'Enable Transcoding Pooling',
240+
description: 'Enable connection pooling for transcoding streams (requires Redis)',
241+
type: FIELD_TYPES.BOOLEAN,
242+
default: true,
243+
showWhen: { field: 'M3U_PROXY_ENABLED', value: 'external' },
244+
deploymentTypes: ['modular', 'vpn', 'external-nginx', 'external-caddy'],
245+
},
237246
],
238247
},
239248
{

0 commit comments

Comments
 (0)