Skip to content

Commit

Permalink
Merge pull request #51 from Resgrid/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ucswift authored Mar 20, 2022
2 parents 9b2fc24 + 86de62a commit a72fdec
Show file tree
Hide file tree
Showing 682 changed files with 41,344 additions and 12,440 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "develop"
schedule:
interval: "weekly"
110 changes: 110 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,113 @@ Common/resgrid.local.pfx
Web/Resgrid.Web.ServicesCore/Properties/serviceDependencies.json
Web/Resgrid.Web.ServicesCore/Properties/serviceDependencies.local.json
Web/Resgrid.Web.ServicesCore/Properties/ServiceDependencies/local/appInsights1.arm.json

Docker/docker-data/dms/mail-state/lib-clamav/bytecode.cvd

Docker/docker-data/dms/mail-state/lib-clamav/daily.cvd

Docker/docker-data/dms/mail-state/lib-clamav/freshclam.dat

Docker/docker-data/dms/mail-state/lib-clamav/main.cvd
Docker/docker-data/dms/config/dovecot-quotas.cf
Docker/docker-data/dms/config/mailconfig
Docker/docker-data/dms/config/postfix-aliases.cf
Docker/docker-data/dms/mail-data/maildata
Docker/docker-data/dms/mail-logs/maillogs
Docker/docker-data/dms/mail-state/mailstate
Docker/docker-data/dms/mail-state/lib-amavis/.razor/identity
Docker/docker-data/dms/mail-state/lib-amavis/.razor/identity-ruYtA-SdhH
Docker/docker-data/dms/mail-state/lib-amavis/.razor/server.n001.cloudmark.com.conf
Docker/docker-data/dms/mail-state/lib-amavis/.razor/server.n004.cloudmark.com.conf
Docker/docker-data/dms/mail-state/lib-amavis/.razor/servers.catalogue.lst
Docker/docker-data/dms/mail-state/lib-amavis/.razor/servers.discovery.lst
Docker/docker-data/dms/mail-state/lib-amavis/.razor/servers.nomination.lst
Docker/docker-data/dms/mail-state/lib-spamassassin/sa-update-keys/pubring.kbx
Docker/docker-data/dms/mail-state/lib-spamassassin/sa-update-keys/trustdb.gpg
Docker/docker-data/sql/backup/sqlbackups
Docker/docker-data/sql/data/Entropy.bin
Docker/docker-data/sql/data/master.mdf
Docker/docker-data/sql/data/mastlog.ldf
Docker/docker-data/sql/data/model_msdbdata.mdf
Docker/docker-data/sql/data/model_msdblog.ldf
Docker/docker-data/sql/data/model_replicatedmaster.ldf
Docker/docker-data/sql/data/model_replicatedmaster.mdf
Docker/docker-data/sql/data/model.mdf
Docker/docker-data/sql/data/modellog.ldf
Docker/docker-data/sql/data/msdbdata.mdf
Docker/docker-data/sql/data/msdblog.ldf
Docker/docker-data/sql/data/Resgrid_log.ldf
Docker/docker-data/sql/data/Resgrid.mdf
Docker/docker-data/sql/data/ResgridOIDC_log.ldf
Docker/docker-data/sql/data/ResgridOIDC.mdf
Docker/docker-data/sql/data/ResgridWorkers_log.ldf
Docker/docker-data/sql/data/ResgridWorkers.mdf
Docker/docker-data/sql/data/sqldata
Docker/docker-data/sql/data/tempdb.mdf
Docker/docker-data/sql/data/templog.ldf
Docker/docker-data/sql/log/errorlog
Docker/docker-data/sql/log/errorlog.1
Docker/docker-data/sql/log/errorlog.2
Docker/docker-data/sql/log/errorlog.3
Docker/docker-data/sql/log/errorlog.4
Docker/docker-data/sql/log/errorlog.5
Docker/docker-data/sql/log/errorlog.6
Docker/docker-data/sql/log/errorlog.7
Docker/docker-data/sql/log/errorlog.8
Docker/docker-data/sql/log/errorlog.9
Docker/docker-data/sql/log/errorlog.10
Docker/docker-data/sql/log/errorlog.11
Docker/docker-data/sql/log/errorlog.12
Docker/docker-data/sql/log/errorlog.13
Docker/docker-data/sql/log/errorlog.14
Docker/docker-data/sql/log/errorlog.15
Docker/docker-data/sql/log/errorlog.16
Docker/docker-data/sql/log/errorlog.17
Docker/docker-data/sql/log/errorlog.18
Docker/docker-data/sql/log/errorlog.19
Docker/docker-data/sql/log/HkEngineEventFile_0_132921975549100000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922007317990000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922009309080000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922013218750000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922018741370000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922033212920000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922067366660000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922075764680000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922088137910000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922111474730000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922117751690000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922122624170000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922132763460000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922142267410000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922152684910000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922153785260000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922154586090000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922155443490000.xel
Docker/docker-data/sql/log/HkEngineEventFile_0_132922211494070000.xel
Docker/docker-data/sql/log/log_16.trc
Docker/docker-data/sql/log/log_17.trc
Docker/docker-data/sql/log/log_18.trc
Docker/docker-data/sql/log/log_19.trc
Docker/docker-data/sql/log/log_20.trc
Docker/docker-data/sql/log/sqllogs
Docker/docker-data/sql/log/system_health_0_132922111481530000.xel
Docker/docker-data/sql/log/system_health_0_132922117759410000.xel
Docker/docker-data/sql/log/system_health_0_132922122632370000.xel
Docker/docker-data/sql/log/system_health_0_132922132771730000.xel
Docker/docker-data/sql/log/system_health_0_132922142272820000.xel
Docker/docker-data/sql/log/system_health_0_132922152690110000.xel
Docker/docker-data/sql/log/system_health_0_132922153791210000.xel
Docker/docker-data/sql/log/system_health_0_132922154593260000.xel
Docker/docker-data/sql/log/system_health_0_132922155450540000.xel
Docker/docker-data/sql/log/system_health_0_132922211502270000.xel
Docker/docker-data/dms/config/mailconfig
Docker/docker-data/dms/mail-data/maildata
Docker/docker-data/dms/mail-logs/maillogs
Docker/docker-data/dms/mail-state/mailstate
Docker/docker-data/sql/backup/sqlbackups
Docker/docker-data/sql/data/sqldata
Docker/docker-data/sql/log/sqllogs
Docker/docker-data/dms/config/mailconfig
Docker/docker-data/dms/mail-data/maildata
Docker/docker-data/dms/mail-logs/maillogs
Docker/docker-data/dms/mail-state/mailstate
9 changes: 9 additions & 0 deletions Core/Resgrid.Config/ExternalErrorConfig.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
namespace Resgrid.Config
{
/// <summary>
/// Configuration for working with external error tracking systems like Elk and Sentry
/// </summary>
public static class ExternalErrorConfig
{
/// <summary>
/// The current operating enviorment for the code, i.e. prod, qa, dev
/// </summary>
public static string Environment = "dev";

#region Elk Settings
public static string ElkServiceUrl = "http://localhost:9200";
#endregion Elk Settings

#region Sentry Settings
public static string ExternalErrorServiceUrl = "";
public static string ExternalErrorServiceUrlForWebsite = "";
public static string ExternalErrorServiceUrlForWebjobs = "";
#endregion Sentry Settings
}

Expand Down
16 changes: 16 additions & 0 deletions Core/Resgrid.Config/JwtConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Resgrid.Config
{
/// <summary>
/// Config settings for JWT's used in the website and api
/// </summary>
public static class JwtConfig
{
public static string Key = "";

public static string Issuer = "resgrid.local";

public static string Audience = "resgrid.local";

public static int Duration = 30;
}
}
20 changes: 20 additions & 0 deletions Core/Resgrid.Config/OidcConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Resgrid.Config
{
/// <summary>
/// Configuration for OpenID Connect (https://documentation.openiddict.com/)
/// </summary>
public static class OidcConfig
{
public static string Key = "";

public static string ConnectionString = "Server=rgdevserver;Database=ResgridOIDC;User Id=resgrid_app;Password=resgrid123;MultipleActiveResultSets=True;";

public static int AccessTokenExpiryMinutes = 1440;

public static int RefreshTokenExpiryDays = 30;

public static string EncryptionCert = "";

public static string SigningCert = "";
}
}
2 changes: 1 addition & 1 deletion Core/Resgrid.Config/Resgrid.Config.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyName>Resgrid.Config</AssemblyName>
<RootNamespace>Resgrid.Config</RootNamespace>
</PropertyGroup>
Expand Down
3 changes: 3 additions & 0 deletions Core/Resgrid.Config/ServiceBusConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static class ServiceBusConfig
public static string EmailBroadcastQueueName = "resgridemails";
public static string SystemQueueName = "resgridsys";
public static string PaymentQueueName = "payment";
public static string AuditQueueName = "audit";

#region Azure Service Bus Values
public static string SignalRServiceBusConnectionString = "";
Expand Down Expand Up @@ -49,6 +50,8 @@ public static class ServiceBusConfig

#region RabbitMQ Bus Values
public static string RabbitHostname = "localhost";
public static string RabbitHostname2 = ""; // For 3 host cluster, node 2
public static string RabbitHostname3 = ""; // For 3 host cluster, node 3
public static string RabbitUsername = "guest";
public static string RabbbitPassword = "guest";
public static string RabbbitExchange = "";
Expand Down
10 changes: 10 additions & 0 deletions Core/Resgrid.Config/SystemBehaviorConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ public static class SystemBehaviorConfig
/// </summary>
public static LinksProviderTypes LinkProviderType = LinksProviderTypes.Polr;

/// <summary>
/// Sets the type of voip provider to use
/// </summary>
public static VoipProviderTypes VoipProviderType = VoipProviderTypes.Kazoo;

/// <summary>
/// Sets the type of sms provider to use
/// </summary>
Expand Down Expand Up @@ -150,6 +155,11 @@ public static class SystemBehaviorConfig
/// </summary>
public static string SiteKey = "";

/// <summary>
/// A notice to display on the login page
/// </summary>
public static string LoginPageNotice = "";

public static string GetEnvPrefix()
{
switch (Environment)
Expand Down
7 changes: 7 additions & 0 deletions Core/Resgrid.Config/TelemetryConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Resgrid.Config
{
public static class TelemetryConfig
{
public static string Exporter = "";
}
}
34 changes: 34 additions & 0 deletions Core/Resgrid.Config/VoipConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace Resgrid.Config
{
/// <summary>
/// Configuration for using a VOIP system for voice communication between applications
/// </summary>
public static class VoipConfig
{
public static int BaseChannelExtensionNumber = 15;
public static int BaseChannelExtensionBump = 15;

public static string VoipDomain = "";
public static string VoipServerAddress = "";
public static string VoipServerWebsocketAddress = "";
public static string VoipServerWebsocketSslAddress = "";

public static string KazooUsername = "";
public static string KazooPassword = "";
public static string KazzoAccount = "";
public static string KazooCrossbarApiUrl = @"";
public static string KazooCrossbarApiVersion = "";

public static string OpenViduUrl = "";
public static string OpenViduSecret = "";
}

/// <summary>
/// Possible backend voip providers
/// </summary>
public enum VoipProviderTypes
{
Kazoo = 0,
OpenVidu = 1
}
}
15 changes: 15 additions & 0 deletions Core/Resgrid.Framework/ConfigHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Resgrid.Config;

namespace Resgrid.Framework
{
public static class ConfigHelper
{
public static bool CanTransmit(int departmentId)
{
if (SystemBehaviorConfig.BypassDoNotBroadcastDepartments.Contains(departmentId))
return true;

return !SystemBehaviorConfig.DoNotBroadcast;
}
}
}
60 changes: 60 additions & 0 deletions Core/Resgrid.Framework/Hashing.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using Resgrid.Config;
using System.Security.Cryptography;
using System.Text;

namespace Resgrid.Framework
{
public static class Hashing
{
public static string ComputeSha256Hash(string rawData)
{
// Create a SHA256
using (SHA256 sha256Hash = SHA256.Create())
{
// ComputeHash - returns byte array
byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(rawData + SymmetricEncryptionConfig.SaltValue));

// Convert byte array to a string
StringBuilder builder = new StringBuilder();
for (int i = 0; i < bytes.Length; i++)
{
builder.Append(bytes[i].ToString("x2"));
}
return builder.ToString();
}
}

public static string ComputeMD5Hash(string input)
{
using (MD5 md5 = MD5.Create())
{
byte[] inputBytes = Encoding.ASCII.GetBytes(input);
byte[] hashBytes = md5.ComputeHash(inputBytes);

StringBuilder sb = new StringBuilder();
for (int i = 0; i < hashBytes.Length; i++)
{
sb.Append(hashBytes[i].ToString("x2"));
}
return sb.ToString();
}
}

public static string ComputeSHA1Hash(string input)
{
using (SHA1Managed sha1 = new SHA1Managed())
{
var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(input));
var sb = new StringBuilder(hash.Length * 2);

foreach (byte b in hash)
{
// can be "x2" if you want lowercase
sb.Append(b.ToString("x2"));
}

return sb.ToString();
}
}
}
}
8 changes: 6 additions & 2 deletions Core/Resgrid.Framework/LocationHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ public static double ConvertDegreeAngleToDouble(string point)

var multiplier = (point.Contains("S") || point.Contains("W")) ? -1 : 1; //handle south and west

point = Regex.Replace(point, "[^0-9. ]", ""); //remove the characters
var newPoint = point.Replace("°", " ");
newPoint = newPoint.Replace("'", " ");
newPoint = newPoint.Replace(" ", " ");

var pointArray = point.Trim().Split(' '); //split the string.
newPoint = Regex.Replace(newPoint, "[^0-9. ]", ""); //remove the characters

var pointArray = newPoint.Trim().Split(' '); //split the string.

//Decimal degrees =
// whole number of degrees,
Expand Down
Loading

0 comments on commit a72fdec

Please sign in to comment.