Исправление: том ./mods:/lampac/mods в compose и копии 10 модулей с enable:true; конфиг без SkipModules

This commit is contained in:
2026-10-02 12:11:49 +03:00
parent 8dcbc6bc52
commit 7b8e28b3bf
151 changed files with 68625 additions and 44 deletions
+47
View File
@@ -0,0 +1,47 @@
using Microsoft.AspNetCore.Http;
using Shared.Models.Base;
using Shared.Models.Events;
using Shared.Models.Module;
using Shared.Models.Module.Interfaces;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace ExternalBind
{
public class ModInit : IModuleLoaded
{
static readonly HashSet<string> ExternalBindPaths = new(StringComparer.OrdinalIgnoreCase)
{
"/lite/filmixpro",
"/lite/rhs/bind",
"/lite/kinopubpro",
"/lite/getstv/bind",
"/lite/sakhtv/bind",
"/lite/vokinotk",
"/lite/iptvonline/bind",
};
static readonly Func<bool, EventMiddleware, bool> MiddlewareHandler = OnMiddleware;
public void Loaded(InitspaceModel initspace)
{
EventListener.Middleware += MiddlewareHandler;
}
public void Dispose()
{
EventListener.Middleware -= MiddlewareHandler;
}
static bool OnMiddleware(bool first, EventMiddleware e)
{
var requestInfo = e.httpContext.Features.Get<RequestModel>();
var path = e.httpContext.Request.Path.Value;
if (requestInfo != null && path != null && ExternalBindPaths.Contains(path))
requestInfo.IsLocalIp = true;
return true;
}
}
}