From 8755a48cde6ee77f421bef07e8b95cf8b68a76ed Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 6 May 2011 00:34:04 +0100 Subject: fix command display for debugging 'emergency-monitoring' --- OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs index db17d8f..bdebbfb 100644 --- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs @@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden scene.AddCommand( this, "emergency-monitoring", - "Go on/off emergency monitoring mode", + "emergency-monitoring", "Go on/off emergency monitoring mode", "Go on/off emergency monitoring mode", EmergencyMonitoring); -- cgit v1.1 From 8ca793875318efc8db3339b25bf7fa5ddeeac218 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 1 May 2011 14:44:09 -0400 Subject: Adding ssl support Adding ssl support for "Out of Band" applications such as the remote admin module or Robust services --- OpenSim/Region/ClientStack/RegionApplicationBase.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index ea1317a..6e3a58e 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -96,6 +96,22 @@ namespace OpenSim.Region.ClientStack MainServer.Instance = m_httpServer; + // "OOB" Server + if (m_networkServersInfo.ssl_listener) + { + BaseHttpServer server = null; + server = new BaseHttpServer( + m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, + m_networkServersInfo.cert_pass); + // Add the server to m_Servers + if(server != null) + { + m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); + MainServer.AddHttpServer(server); + server.Start(); + } + } + base.StartupSpecific(); } -- cgit v1.1 From e4e95706d52fad2bab4a725955449f6bdb523a29 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Mon, 2 May 2011 14:35:44 -0400 Subject: Add support for llRequestSecureURL() if ssl is enabled --- .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 61 ++++++++++++++++++++-- 1 file changed, 56 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 9b565ed..a552a28 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -78,7 +78,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp private int m_TotalUrls = 100; + private uint https_port = 0; private IHttpServer m_HttpServer = null; + private IHttpServer m_HttpsServer = null; private string m_ExternalHostNameForLSL = ""; @@ -100,6 +102,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public void Initialise(IConfigSource config) { m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName); + bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener",false); + if (ssl_enabled) + { + https_port = (uint) config.Configs["Network"].GetInt("https_port",0); + } } public void PostInitialise() @@ -113,6 +120,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp // There can only be one // m_HttpServer = MainServer.Instance; + // + // We can use the https if it is enabled + if (https_port > 0) + { + m_HttpsServer = MainServer.GetHttpServer(https_port); + } } scene.RegisterModuleInterface(this); @@ -171,7 +184,40 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp { UUID urlcode = UUID.Random(); - engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); + if (m_HttpsServer == null) + { + engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); + return urlcode; + } + + lock (m_UrlMap) + { + if (m_UrlMap.Count >= m_TotalUrls) + { + engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); + return urlcode; + } + string url = "https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/"; + + UrlData urlData = new UrlData(); + urlData.hostID = host.UUID; + urlData.itemID = itemID; + urlData.engine = engine; + urlData.url = url; + urlData.urlcode = urlcode; + urlData.requests = new Dictionary(); + + + m_UrlMap[url] = urlData; + + string uri = "/lslhttps/" + urlcode.ToString() + "/"; + + m_HttpsServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, + new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, + urlcode)); + + engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); + } return urlcode; } @@ -345,7 +391,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp } private Hashtable GetEvents(UUID requestID, UUID sessionID, string request) { - UrlData url = null; + UrlData url = null; RequestData requestData = null; lock (m_RequestMap) @@ -391,11 +437,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp lock (request) { string uri = request["uri"].ToString(); - + bool is_ssl = uri.Contains("lslhttps"); + try { Hashtable headers = (Hashtable)request["headers"]; - + // string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/"; int pos1 = uri.IndexOf("/");// /lslhttp @@ -409,7 +456,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp pathInfo = uri.Substring(pos3); - UrlData url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp]; + UrlData url = null; + if (!is_ssl) + url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp]; + else + url = m_UrlMap["https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp]; //for llGetHttpHeader support we need to store original URI here //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers -- cgit v1.1 From fd44540c023e7df35308a40df9e61d7f9273eba4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 6 May 2011 01:06:28 +0100 Subject: add descriptive explanations for region restart functionality --- .../Region/CoreModules/World/Region/RestartModule.cs | 19 +++++++++++++------ .../Agent/UDP/Linden/LindenUDPInfoModule.cs | 1 - 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs index ab6a598..e983239 100644 --- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs @@ -64,19 +64,26 @@ namespace OpenSim.Region.CoreModules.World.Region public void AddRegion(Scene scene) { m_Scene = scene; + scene.RegisterModuleInterface(this); MainConsole.Instance.Commands.AddCommand("RestartModule", false, "region restart bluebox", - "region restart bluebox