Skip to content

Commit

Permalink
Merge pull request #3 from m3sserschmitt/azure-integration
Browse files Browse the repository at this point in the history
Azure integration
  • Loading branch information
m3sserschmitt authored Oct 12, 2024
2 parents d7e9341 + f220116 commit ae0d028
Show file tree
Hide file tree
Showing 174 changed files with 4,575 additions and 174 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
*/bin/*
*/obj/*
*.sqlite*
Enigma5.App/logs/*
Enigma5.App/logs/*
*.pem
build
Enigma5.App/aenigma_*
22 changes: 21 additions & 1 deletion Client/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
using System.Text;
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

using System.Text;
using Enigma5.App.Common.Contracts.Hubs;
using Enigma5.Crypto.DataProviders;
using Enigma5.Structures;
Expand Down
22 changes: 21 additions & 1 deletion Enigma5.App.Common/Constants/DataPersistencePeriod.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
namespace Enigma5.App.Common.Constants;
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

namespace Enigma5.App.Common.Constants;

public static class DataPersistencePeriod
{
Expand Down
22 changes: 21 additions & 1 deletion Enigma5.App.Common/Constants/Endpoints.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
namespace Enigma5.App.Common.Constants;
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

namespace Enigma5.App.Common.Constants;

public static class Endpoints
{
Expand Down
22 changes: 21 additions & 1 deletion Enigma5.App.Common/Contracts/Hubs/IHub.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
using Enigma5.App.Models;
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

using Enigma5.App.Models;
using Enigma5.App.Models.HubInvocation;

namespace Enigma5.App.Common.Contracts.Hubs;
Expand Down
20 changes: 20 additions & 0 deletions Enigma5.App.Common/Contracts/Hubs/IOnionParsingHub.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

namespace Enigma5.App.Common.Contracts.Hubs;

public interface IOnionParsingHub
Expand Down
20 changes: 20 additions & 0 deletions Enigma5.App.Common/Contracts/Hubs/IOnionRoutingHub.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

namespace Enigma5.App.Common.Contracts.Hubs;

public interface IOnionRoutingHub
Expand Down
50 changes: 41 additions & 9 deletions Enigma5.App.Common/Extensions/ConfigurationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
using Microsoft.Extensions.Configuration;
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

using Microsoft.Extensions.Configuration;

namespace Enigma5.App.Common.Extensions;

Expand All @@ -8,29 +28,32 @@ public static List<string> GetPeers(this IConfiguration configuration)
=> configuration.GetSection("Peers").Get<List<string>>() ?? [];

public static string? GetLocalListenAddress(this IConfiguration configuration)
=> configuration.GetValue<string>("Kestrel:EndPoints:Http:Url");
=> configuration.GetValue<string?>("Kestrel:EndPoints:Http:Url", null);

public static string? GetHostname(this IConfiguration configuration)
=> configuration.GetValue<string>("Hostname");
=> configuration.GetValue<string?>("Hostname", null);

public static string? GetPrivateKeyPath(this IConfiguration configuration)
=> configuration.GetValue<string>("PrivateKeyPath");
=> configuration.GetValue<string?>("PrivateKeyPath", null);

public static string? GetPublicKeyPath(this IConfiguration configuration)
=> configuration.GetValue<string>("PublicKeyPath");
=> configuration.GetValue<string?>("PublicKeyPath", null);

public static string? GetPassphraseKeyPath(this IConfiguration configuration)
=> configuration.GetValue<string?>("PassphrasePath", null);

public static bool GetRetryConnection(this IConfiguration configuration)
=> configuration.GetValue<bool>("RetryConnection");
=> configuration.GetValue("RetryConnection", false);

public static int GetConnectionRetriesCount(this IConfiguration configuration)
=> configuration.GetValue<int>("ConnectionRetriesCount");
=> configuration.GetValue("ConnectionRetriesCount", 0);

public static int GetDelayBetweenConnectionRetries(this IConfiguration configuration)
=> configuration.GetValue<int>("DelayBetweenConnectionRetries");
=> configuration.GetValue("DelayBetweenConnectionRetries", 0);

public static TimeSpan? GetNonActiveLeafsLifetime(this IConfiguration configuration)
{
var value = configuration.GetValue<string>("NonActiveLeafsLifetime");
var value = configuration.GetValue<string?>("NonActiveLeafsLifetime", null);

if (value is null)
{
Expand All @@ -44,4 +67,13 @@ public static int GetDelayBetweenConnectionRetries(this IConfiguration configura

return null;
}

public static string? GetAzureVaultUrl(this IConfiguration configuration)
=> configuration.GetValue<string?>("AzureVaultUrl", null);

public static bool UseAzureVaultForKeys(this IConfiguration configuration)
=> configuration.GetValue("UseAzureVaultForKeys", false);

public static bool UseAzureVaultForPassphrase(this IConfiguration configuration)
=> configuration.GetValue("UseAzureVaultForPassphrase", false);
}
22 changes: 21 additions & 1 deletion Enigma5.App.Common/Extensions/CopyExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
using System.Text.Json;
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

using System.Text.Json;

namespace Enigma5.App.Common.Extensions;

Expand Down
20 changes: 20 additions & 0 deletions Enigma5.App.Common/Utils/SingleThreadExecutor.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

using System.Collections.Concurrent;

namespace Enigma5.App.Common.Utils;
Expand Down
20 changes: 20 additions & 0 deletions Enigma5.App.Common/Utils/SingleThreadExecutorAction.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

namespace Enigma5.App.Common.Utils;

public class SingleThreadExecutorAction(Action action)
Expand Down
20 changes: 20 additions & 0 deletions Enigma5.App.Common/Utils/SingleThreadExecutorResult.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

namespace Enigma5.App.Common.Utils;

public record class SingleThreadExecutorResult<T>(T? Value, Exception? Exception);
20 changes: 20 additions & 0 deletions Enigma5.App.Common/Utils/ThreadSafeExecution.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

namespace Enigma5.App.Common.Utils;

public static class ThreadSafeExecution
Expand Down
20 changes: 20 additions & 0 deletions Enigma5.App.Models/AdjacencyList.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
Aenigma - Onion Routing based messaging application
Copyright (C) 2024 Romulus-Emanuel Ruja <romulus-emanuel.ruja@tutanota.com>
This file is part of Aenigma project.
Aenigma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aenigma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Aenigma. If not, see <https://www.gnu.org/licenses/>.
*/

using Enigma5.App.Models.Contracts;
using Enigma5.App.Models.Extensions;

Expand Down
Loading

0 comments on commit ae0d028

Please sign in to comment.