aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2017-02-01 15:30:17 +0000
committerMelanie Thielker2017-02-01 15:30:17 +0000
commit5ceb315e3463eaa50abf43a4c07cb37d9486b1fd (patch)
treea77a4a317cb395ee6544c13c1267d7ba7c1892ec
parentMake negative asset caching actually work (diff)
downloadopensim-SC-5ceb315e3463eaa50abf43a4c07cb37d9486b1fd.zip
opensim-SC-5ceb315e3463eaa50abf43a4c07cb37d9486b1fd.tar.gz
opensim-SC-5ceb315e3463eaa50abf43a4c07cb37d9486b1fd.tar.bz2
opensim-SC-5ceb315e3463eaa50abf43a4c07cb37d9486b1fd.tar.xz
Secure sim stats with an (optional) password.
There is way too much in these stats to expose them to the world, at least for some of us.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs13
-rw-r--r--OpenSim/Region/Application/OpenSim.cs1
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs2
3 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index 55c3276..a6b341f 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -47,6 +47,8 @@ namespace OpenSim.Framework.Monitoring
47 // Subcommand used to list other stats. 47 // Subcommand used to list other stats.
48 public const string ListSubCommand = "list"; 48 public const string ListSubCommand = "list";
49 49
50 public static string StatsPassword { get; set; }
51
50 // All subcommands 52 // All subcommands
51 public static HashSet<string> SubCommands = new HashSet<string> { AllSubCommand, ListSubCommand }; 53 public static HashSet<string> SubCommands = new HashSet<string> { AllSubCommand, ListSubCommand };
52 54
@@ -302,6 +304,17 @@ namespace OpenSim.Framework.Monitoring
302 int response_code = 200; 304 int response_code = 200;
303 string contenttype = "text/json"; 305 string contenttype = "text/json";
304 306
307 if (StatsPassword != String.Empty && (!request.ContainsKey("pass") || request["pass"].ToString() != StatsPassword))
308 {
309 responsedata["int_response_code"] = response_code;
310 responsedata["content_type"] = "text/plain";
311 responsedata["keepalive"] = false;
312 responsedata["str_response_string"] = "Access denied";
313 responsedata["access_control_allow_origin"] = "*";
314
315 return responsedata;
316 }
317
305 string pCategoryName = StatsManager.AllSubCommand; 318 string pCategoryName = StatsManager.AllSubCommand;
306 string pContainerName = StatsManager.AllSubCommand; 319 string pContainerName = StatsManager.AllSubCommand;
307 string pStatName = StatsManager.AllSubCommand; 320 string pStatName = StatsManager.AllSubCommand;
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 8022b1e..58178bc 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -211,6 +211,7 @@ namespace OpenSim
211 if (managedStatsURI != String.Empty) 211 if (managedStatsURI != String.Empty)
212 { 212 {
213 string urlBase = String.Format("/{0}/", managedStatsURI); 213 string urlBase = String.Format("/{0}/", managedStatsURI);
214 StatsManager.StatsPassword = managedStatsPassword;
214 MainServer.Instance.AddHTTPHandler(urlBase, StatsManager.HandleStatsRequest); 215 MainServer.Instance.AddHTTPHandler(urlBase, StatsManager.HandleStatsRequest);
215 m_log.InfoFormat("[OPENSIM] Enabling remote managed stats fetch. URL = {0}", urlBase); 216 m_log.InfoFormat("[OPENSIM] Enabling remote managed stats fetch. URL = {0}", urlBase);
216 } 217 }
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index b33e2c2..34a9246 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -88,6 +88,7 @@ namespace OpenSim
88 88
89 public string userStatsURI = String.Empty; 89 public string userStatsURI = String.Empty;
90 public string managedStatsURI = String.Empty; 90 public string managedStatsURI = String.Empty;
91 public string managedStatsPassword = String.Empty;
91 92
92 protected bool m_autoCreateClientStack = true; 93 protected bool m_autoCreateClientStack = true;
93 94
@@ -239,6 +240,7 @@ namespace OpenSim
239 m_permsModules = new List<string>(permissionModules.Split(',')); 240 m_permsModules = new List<string>(permissionModules.Split(','));
240 241
241 managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty); 242 managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty);
243 managedStatsPassword = startupConfig.GetString("ManagedStatsRemoteFetchPassword", String.Empty);
242 } 244 }
243 245
244 // Load the simulation data service 246 // Load the simulation data service