main v1.1.7
吴顺明 10 months ago
parent b8864af880
commit 0729d7a288

@ -299,11 +299,12 @@ namespace UMC.ITME
{
lock (_bridgeClients)
{
for (var i = 0; i < _bridgeClients.Count; i++)
var cls = _bridgeClients.Values.ToArray();
for (var i = 0; i < cls.Length; i++)
{
try
{
_bridgeClients[i]?._Stop();
cls[i]._Stop();
}
catch
{
@ -338,7 +339,7 @@ namespace UMC.ITME
void _Stop()
{
_stoped = true;
base.Close();
this.Close();
}
HttpMimeRequest Bridge(int pid)
{

@ -888,32 +888,32 @@ namespace UMC.ITME
}
private void Cert()
{
var secret = UMC.Data.WebResource.Instance().Provider["appSecret"];
int nextIndex = 0;
// private void Cert()
// {
// var secret = UMC.Data.WebResource.Instance().Provider["appSecret"];
// int nextIndex = 0;
if (String.IsNullOrEmpty(secret) == false)
{
var now = Utility.TimeSpan(DateTime.Now.AddDays(5));
while (nextIndex >= 0)
{
// if (String.IsNullOrEmpty(secret) == false)
// {
// var now = Utility.TimeSpan(DateTime.Now.AddDays(5));
// while (nextIndex >= 0)
// {
var fs = HotCache.Find(new SiteCert(), false, 0, 500, out nextIndex);
foreach (var r in fs)
{
if ((r.IsApiumc ?? false) == false && String.IsNullOrEmpty(r.PrivateKey) == false && String.IsNullOrEmpty(r.PublicKey) == false)
{
if (r.ExpirationTime < now)
{
CheckSSl(secret, r.Domain, false);
}
}
};
// var fs = HotCache.Find(new SiteCert(), false, 0, 500, out nextIndex);
// foreach (var r in fs)
// {
// if ((r.IsApiumc ?? false) == false && String.IsNullOrEmpty(r.PrivateKey) == false && String.IsNullOrEmpty(r.PublicKey) == false)
// {
// if (r.ExpirationTime < now)
// {
// CheckSSl(secret, r.Domain, false);
// }
// }
// };
}
}
}
// }
// }
// }
private void Unix(object sender, SocketAsyncEventArgs eventArgs)
{
var client = eventArgs.AcceptSocket;

@ -285,7 +285,7 @@ namespace UMC.ITME
{
Excel("main");
}
break;
break;
case "restart":
if (IsRun())
{
@ -370,7 +370,7 @@ namespace UMC.ITME
};
if (OperatingSystem.IsWindows())
{
thread.SetApartmentState(ApartmentState.STA);
thread.SetApartmentState(ApartmentState.STA);
}
thread.Start();
Thread.Sleep(5000);
@ -545,7 +545,10 @@ namespace UMC.ITME
AppDomain.CurrentDomain.UnhandledException += UnhandledException;
var p = typeof(Program).Assembly.GetCustomAttributes().FirstOrDefault(r => r is System.Reflection.AssemblyInformationalVersionAttribute) as System.Reflection.AssemblyInformationalVersionAttribute;
APIProxy.Version = p?.InformationalVersion ?? "1.0.0";
// using Microsoft.Extensions.PlatformAbstractions;
// string version = PlatformServices.Default.Application.ApplicationVersion;
// AppDomain.CurrentDomain.
Register();
// UMC.Data.HotCache.Namespace(typeof(UMC.Proxy.Entities.Cookie).Namespace);

@ -16,7 +16,7 @@ namespace UMC.ITME.Activities
/// <summary>
/// 应用管理
/// </summary>
[UMC.Web.Apiumc("Proxy", "Site", Auth = WebAuthType.User)]
[UMC.Web.Apiumc("ITME", "Site", Auth = WebAuthType.User)]
public class SiteActivity : WebActivity
{
@ -75,7 +75,7 @@ namespace UMC.ITME.Activities
}
}
this.Context.Response.Redirect("Proxy", "Market", site.Root);
this.Context.Response.Redirect("ITME", "Market", site.Root);
}
public static WebMeta PutMarket(Site site, string secret)
{

@ -9,7 +9,7 @@ using UMC.Data;
namespace UMC.ITME.Activities
{
[UMC.Web.Apiumc("Proxy", "App", Auth = WebAuthType.User)]
[UMC.Web.Apiumc("ITME", "App", Auth = WebAuthType.User)]
public class SiteAppActivity : UMC.Web.WebActivity
{
public override void ProcessActivity(WebRequest request, WebResponse response)
@ -57,6 +57,7 @@ namespace UMC.ITME.Activities
sts.Columns.Add("target");
sts.Columns.Add("badge");
sts.Columns.Add("desktop", typeof(bool));
sts.Columns.Add("group");
var user = this.Context.Token.Identity();
@ -74,8 +75,8 @@ namespace UMC.ITME.Activities
sts.Rows.Add("应用管理", "Market", "/Apps",
"/css/images/icon/appmgr.png", "max", "", true);
sts.Rows.Add("发布应用", "Add", "javascript:void(0)",
"/css/images/icon/add.png", "max", "", true);
sts.Rows.Add("发布应用", "Market", "/Apps?Create",
"/css/images/icon/add.png", "max", "", true, "应用管理");
}
sts.Rows.Add("堡垒机", "WebSSH", "/WebSSH",
@ -140,14 +141,14 @@ namespace UMC.ITME.Activities
else
{
strUrl = $"{request.Url.Scheme}://{d.Root}{union}{home}{d.Home}";
strUrl = $"{request.Url.Scheme}://{d.Root}{union}{home}{d.Home}";
}
}
else if (authCnf.Contains("*") || d.AuthType == WebAuthType.All)
{
strUrl = $"{request.Url.Scheme}://{d.Root}{union}{home}{d.Home}";
}
}
}
var isDesktop = desktop.ContainsKey(d.Root);
if (d.IsDesktop == true)
{

@ -14,7 +14,7 @@ namespace UMC.ITME.Activities
/// <summary>
/// 邮箱账户
/// </summary>
[UMC.Web.Apiumc("Proxy", "Auth", Auth = WebAuthType.Guest)]
[UMC.Web.Apiumc("ITME", "Auth", Auth = WebAuthType.Guest)]
public class SiteAuthActivity : WebActivity
{

@ -7,7 +7,7 @@ namespace UMC.ITME.Activities
/// <summary>
/// 邮箱账户
/// </summary>
[UMC.Web.Apiumc("Proxy", "Conf", Auth = WebAuthType.User)]
[UMC.Web.Apiumc("ITME", "Conf", Auth = WebAuthType.User)]
public class SiteConfActivity : WebActivity
{
public override void ProcessActivity(WebRequest request, WebResponse response)

@ -8,7 +8,7 @@ namespace UMC.ITME.Activities
/// <summary>
/// 图片处理配置
/// </summary>
[UMC.Web.Apiumc("Proxy", "ConfImage", Auth = WebAuthType.User)]
[UMC.Web.Apiumc("ITME", "ConfImage", Auth = WebAuthType.User)]
public class SiteConfImageActivity : WebActivity
{
string GetPostion(String m)

@ -8,7 +8,7 @@ namespace UMC.ITME.Activities
/// <summary>
/// 应用管理
/// </summary>
[UMC.Web.Apiumc("Proxy", "Log", Auth = WebAuthType.User)]
[UMC.Web.Apiumc("ITME", "Log", Auth = WebAuthType.User)]
public class SiteLogActivity : WebActivity
{

@ -6,7 +6,7 @@ using UMC.Web.UI;
namespace UMC.ITME
{
// [Mapping("Proxy", "LogConf", Auth = WebAuthType.Admin, Desc = "服务器日志")]
// [Mapping("ITME", "LogConf", Auth = WebAuthType.Admin, Desc = "服务器日志")]
class SiteLogConfActivity : WebActivity
{

@ -13,7 +13,7 @@ using UMC.Net;
namespace UMC.ITME.Activities
{
[Apiumc("Proxy", "Market", Desc = "我的出售", Auth = WebAuthType.Admin)]
[Apiumc("ITME", "Market", Desc = "我的出售", Auth = WebAuthType.Admin)]
class SiteMarketActivity : UMC.Web.WebActivity
{
public override void ProcessActivity(UMC.Web.WebRequest request, UMC.Web.WebResponse response)

@ -15,7 +15,7 @@ namespace UMC.ITME.Activities
/// <summary>
/// 邮箱账户
/// </summary>
[UMC.Web.Apiumc("Proxy", "Mime", Auth = WebAuthType.User)]
[UMC.Web.Apiumc("ITME", "Mime", Auth = WebAuthType.User)]
public class SiteMimeActivity : WebActivity
{
bool Check(Hashtable login)

@ -11,7 +11,7 @@ using UMC.Net;
namespace UMC.ITME.Activities;
[Apiumc("Proxy", "SSH", Auth = WebAuthType.User)]
[Apiumc("ITME", "SSH", Auth = WebAuthType.User)]
class SiteSSHActivities : Web.WebActivity
{

@ -11,7 +11,7 @@ using UMC.Web.UI;
namespace UMC.ITME.Activities
{
[UMC.Web.Apiumc("Proxy", "Search", Auth = WebAuthType.User)]
[UMC.Web.Apiumc("ITME", "Search", Auth = WebAuthType.User)]
public class SiteSearchActivity : UMC.Web.WebActivity
{
public override void ProcessActivity(WebRequest request, WebResponse response)

@ -17,7 +17,7 @@ using UMC.Web.UI;
namespace UMC.ITME.Activities
{
[Apiumc("Proxy", "Server", Auth = WebAuthType.Admin, Desc = "Http服务配置")]
[Apiumc("ITME", "Server", Auth = WebAuthType.Admin, Desc = "Http服务配置")]
public class SiteServerActivity : WebActivity
{

@ -17,7 +17,7 @@ namespace UMC.ITME.Activities
/// <summary>
/// 邮箱账户
/// </summary>
[UMC.Web.Apiumc("Proxy", "Setup", Auth = WebAuthType.Admin)]
[UMC.Web.Apiumc("ITME", "Setup", Auth = WebAuthType.Admin)]
class SiteSetupActivity : WebActivity
{

@ -6,7 +6,7 @@ using UMC.Web.UI;
namespace UMC.ITME.Activities
{
[UMC.Web.Apiumc("Proxy", "UI", Auth = WebAuthType.User)]
[UMC.Web.Apiumc("ITME", "UI", Auth = WebAuthType.User)]
public class SiteUIActivity : UMC.Web.WebActivity
{
public override void ProcessActivity(WebRequest request, WebResponse response)
@ -26,12 +26,11 @@ namespace UMC.ITME.Activities
ui.UIHeader = new UIHeader().Slider(new WebMeta[] { new WebMeta().Put("src", surl) });
UMC.Web.UI.UIIcon iIcon = new Web.UI.UIIcon();
if (request.IsMaster)
{//Icon('\uf108', 0x34bfa3)//.Icon('\uf085', 0x40c9c6)
iIcon.Add(new UIEventText("堡垒机").Src(new Uri(request.Url, "/css/images/icon/computer.png").AbsoluteUri).Click(new UIClick("Proxy", "SSH")));
iIcon.Add(new UIEventText("应用管理").Src(new Uri(request.Url, "/css/images/icon/appmgr.png").AbsoluteUri).Click(new UIClick("Proxy", "Site")));
{
iIcon.Add(new UIEventText("堡垒机").Src(new Uri(request.Url, "/css/images/icon/computer.png").AbsoluteUri).Click(new UIClick("ITME", "SSH")));
iIcon.Add(new UIEventText("应用管理").Src(new Uri(request.Url, "/css/images/icon/appmgr.png").AbsoluteUri).Click(new UIClick("ITME", "Site")));
iIcon.Add(new UIEventText("组织账户").Icon('\uf0c0', 0x36a3f7).Click(new UIClick("Settings", "Organize")));
iIcon.Add(new UIEventText("功能授权").Icon('\uf214', 0xf4516c).Click(new UIClick("Settings", "AuthKey")));
//css/images/icon/market.png
ui.Add(iIcon);
}

@ -17,7 +17,7 @@ namespace UMC.ITME.Activities
/// <summary>
/// 邮箱账户
/// </summary>
[UMC.Web.Apiumc("Proxy", "UMC", Auth = WebAuthType.Admin)]
[UMC.Web.Apiumc("ITME", "UMC", Auth = WebAuthType.Admin)]
class SiteUMCActivity : WebActivity
{

@ -9,7 +9,7 @@ using UMC.Data.Entities;
namespace UMC.ITME.Activities
{
[UMC.Web.Apiumc("Proxy", "User", Auth = WebAuthType.User)]
[UMC.Web.Apiumc("ITME", "User", Auth = WebAuthType.User)]
public class SiteUserActivity : WebActivity
{

@ -26,8 +26,8 @@ namespace UMC.ITME.Activities
var footBar = new List<WebMeta>
{
new WebMeta().Put("text", "云桌面", "key", "Pager", "cmd", "UI", "model", "Proxy", "icon", "\uf1b3", "RefreshEvent", "Proxy.Site"),
new WebMeta("text", "发布应用", "icon", "\ue907").Put("max", true).Put("click", new UIClick("Proxy", "Setup")),
new WebMeta().Put("text", "云桌面", "key", "Pager", "cmd", "UI", "model", "ITME", "icon", "\uf1b3", "RefreshEvent", "ITME.Site"),
new WebMeta("text", "发布应用", "icon", "\ue907").Put("max", true).Put("click", new UIClick("ITME", "Setup")),
new WebMeta().Put("text", "我的", "key", "Pager", "cmd", "Self", "model", "Account", "icon", "", "RefreshEvent", "UI.Setting").Put("search", new WebMeta("Type", "Setting"))
};
this.Context.Reset(new WebMeta().Put("footBar", footBar));
@ -48,7 +48,7 @@ namespace UMC.ITME.Activities
if (url.AbsolutePath.StartsWith("/UMC/Platform/Apper"))
{
var Setup = System.Web.HttpUtility.ParseQueryString(url.Query).Get("Setup");
this.Context.Send(new UIClick("Proxy", "Setup").Send(new WebMeta("_", Setup)), true);
this.Context.Send(new UIClick("ITME", "Setup").Send(new WebMeta("_", Setup)), true);
}

@ -225,7 +225,7 @@ namespace UMC.ITME
var webReq = httpProxy.Reqesut(content.Transfer(httpProxy.Domain));
httpProxy.AuthBridge(webReq.Headers);
// webReq.Headers[]
webReq.Headers["x-forwarded-proto"] = request.Url.Scheme;
webReq.Headers[System.Net.HttpRequestHeader.Host] = request.Url.Authority;
webReq.RawUrl = $"/UMC/{Utility.Guid(this.Context.Token.Device.Value)}/{query}";
webReq.ContentType = "application/x-www-form-urlencoded";

@ -36,7 +36,7 @@ namespace UMC.ITME
}
else
{
Error(context, "签发证书", "Apiumc域名证书服务<br/><br/>建议:请在云桌面->应用设置->网关服务中集中管理证书", $"$.UI.Command('Proxy','Server',{{Model:'CSR',Domain:'{host}'}})");
Error(context, "签发证书", "ITME域名证书服务<br/><br/>建议:请在云桌面->应用设置->网关服务中集中管理证书", $"$.UI.Command('ITME','Server',{{Model:'CSR',Domain:'{host}'}})");
}
}
void Unauthorized(Net.NetContext context)

@ -119,7 +119,7 @@
<a class="umc-task_bar-app el-dropdown hide"><span></span></a>
<ul role="menu">
<li>
<a model="Proxy" cmd="App" class="icon-data" data-icon="&#xf05a;"> 关于</a>
<a model="ITME" cmd="App" class="icon-data" data-icon="&#xf05a;"> 关于</a>
</li>
<li>
<a data-key="hide" class="icon-data" data-icon="&#xf24d;">隐藏其他</a>

@ -146,7 +146,7 @@
}, text: '应用菜单'
}, {
click: {
model: 'Proxy',
model: 'ITME',
cmd: 'Site',
send: key
}, text: '应用配置'

@ -13,7 +13,7 @@
window.Auth = function (xhr) {
location.href = ['/!/', xhr.AuthKey, location.pathname, location.search].join('');
}
location.href = 'umc://Proxy/Auth?oauth_callback=' + encodeURIComponent(location.href);
location.href = 'umc://ITME/Auth?oauth_callback=' + encodeURIComponent(location.href);
});</script>
<style>

Loading…
Cancel
Save