Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nightly Update #317

Merged
merged 39 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bc8e9b5
Update issue templates
jacobsen9026 Apr 14, 2024
55e4cf8
Bump SixLabors.ImageSharp.Web and SixLabors.ImageSharp
dependabot[bot] Apr 15, 2024
403a84e
Bump Microsoft.AspNetCore.Identity.EntityFrameworkCore
dependabot[bot] Apr 15, 2024
cddcf7c
Bump Microsoft.AspNetCore.Authentication.Negotiate from 6.0.28 to 6.0.29
dependabot[bot] Apr 15, 2024
8adfe2e
Bump Microsoft.EntityFrameworkCore.Analyzers from 7.0.17 to 7.0.18
dependabot[bot] Apr 15, 2024
b7f282f
Bump Microsoft.EntityFrameworkCore.Tools, Microsoft.EntityFrameworkCo…
dependabot[bot] Apr 15, 2024
da2da53
Remove InstallType as it was never used
jacobsen9026 Apr 16, 2024
1d71ece
Merge pull request #306 from Blazam-App/dependabot/nuget/Microsoft.En…
jacobsen9026 Apr 16, 2024
8021591
Merge pull request #305 from Blazam-App/dependabot/nuget/Microsoft.As…
jacobsen9026 Apr 16, 2024
107fd54
Merge branch 'Beta-Dev' into dependabot/nuget/Microsoft.AspNetCore.Id…
jacobsen9026 Apr 16, 2024
6e2e7cf
Merge pull request #304 from Blazam-App/dependabot/nuget/Microsoft.As…
jacobsen9026 Apr 16, 2024
7f9321d
Merge pull request #303 from Blazam-App/dependabot/nuget/multi-267dc1…
jacobsen9026 Apr 16, 2024
3fe3728
Merge branch 'Beta-Dev' into dependabot/nuget/multi-68f4d97d92
jacobsen9026 Apr 16, 2024
ba737ca
Merge pull request #307 from Blazam-App/dependabot/nuget/multi-68f4d9…
jacobsen9026 Apr 16, 2024
0740df4
Add input auto-focusing for most applicable places
Apr 17, 2024
a035dda
Improve status elements presentation
jacobsen9026 Apr 19, 2024
8e11520
Merge pull request #310 from Blazam-App/v0.9.2-General
jacobsen9026 Apr 19, 2024
58048f4
Update some colors in dark themes
jacobsen9026 Apr 19, 2024
029d02d
Merge pull request #311 from Blazam-App/v0.9.2-General
jacobsen9026 Apr 19, 2024
8a539a7
Minor GUI improvements
jacobsen9026 Apr 19, 2024
b00a52f
Add developer usage-tracking and logging opt-outs
jacobsen9026 Apr 19, 2024
b5d5e66
Merge pull request #312 from Blazam-App/v0.9.2-General
jacobsen9026 Apr 19, 2024
7baacd2
Change error logging for no DN
jacobsen9026 Apr 19, 2024
79c09e6
Optimize uri searching for directory entries
jacobsen9026 Apr 19, 2024
ed18620
Code merge of AD and OU tree views
jacobsen9026 Apr 21, 2024
d9f6643
Fix for null exception during custom user creation #308
jacobsen9026 Apr 21, 2024
4e8ba25
Show and allow only the OU's a user has permission to create users in…
jacobsen9026 Apr 21, 2024
9c5e6b6
Cleanup of treeview code merge
jacobsen9026 Apr 21, 2024
172ddf2
Add InstallationID which is derived from MS OS UUID
jacobsen9026 Apr 21, 2024
948817e
Merge pull request #313 from Blazam-App/v0.9.2-General
jacobsen9026 Apr 21, 2024
ec0ff4f
Fix for home drive dropdown being ineffective
jacobsen9026 Apr 21, 2024
7a6b7e4
Merge pull request #314 from Blazam-App/v0.9.2-General
jacobsen9026 Apr 21, 2024
edd9f70
Improved settings page presentation
jacobsen9026 Apr 21, 2024
742d426
Merge pull request #315 from Blazam-App/v0.9.2-General
jacobsen9026 Apr 21, 2024
39eba40
Minor dashboard improvements
jacobsen9026 Apr 21, 2024
d6f3b0a
Disable impersonating in demo
jacobsen9026 Apr 21, 2024
a7967db
Changes for moved treeview components
jacobsen9026 Apr 21, 2024
4143683
Partial changes for code-merged treeviews
jacobsen9026 Apr 21, 2024
4ec022c
Merge pull request #316 from Blazam-App/v0.9.2-General
jacobsen9026 Apr 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,27 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
labels: 'bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
**To Reproduce (Required for complex issues)**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Environment (please complete the following information):**
- Blazam Version
- Running under IIS/Service

**Additional context**
Add any other context about the problem here.
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@ A clear and concise description of what the problem is. Ex. I'm always frustrate
**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
30 changes: 15 additions & 15 deletions BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>0.9.1</AssemblyVersion>
<Version>2024.04.13.2102</Version>
<Version>2024.04.21.1638</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
Expand Down Expand Up @@ -55,26 +55,26 @@
<ItemGroup>
<PackageReference Include="BlazorTemplater" Version="1.5.1" />
<PackageReference Include="Cassia" Version="2.0.0.60" />
<PackageReference Include="DuoUniversal" Version="1.2.2" />
<PackageReference Include="MailKit" Version="4.4.0" />
<PackageReference Include="DuoUniversal" Version="1.2.3" />
<PackageReference Include="MailKit" Version="4.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.28" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.28" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.28" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.28" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.17">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.29" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.29" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.29" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.29" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.18">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.4" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.16" />
<PackageReference Include="MudBlazor.Markdown" Version="0.1.3" />
Expand All @@ -83,7 +83,7 @@
<PackageReference Include="Octokit" Version="10.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.1" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
<PackageReference Include="System.DirectoryServices" Version="8.0.0" />

<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.0" />
Expand Down
8 changes: 8 additions & 0 deletions BLAZAM/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>", Scope = "member", Target = "~M:BLAZAM.Server.ProgramHelpers.GetInstallationId~System.Guid")]
19 changes: 11 additions & 8 deletions BLAZAM/Pages/Groups/CreateGroup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


<OUTreeView Label="Parent Organizational Unit"
SelectedOUChanged="OUSelected">
SelectedEntryChanged="OUSelected">
@* <NodeContent>
@context.Name
</NodeContent>*@
Expand Down Expand Up @@ -73,7 +73,7 @@

int selectedStep;





Expand All @@ -89,17 +89,20 @@
templates = await Context?.DirectoryTemplates.ToListAsync();
await InvokeAsync(StateHasChanged);
}
async void OUSelected(IADOrganizationalUnit ou)
async void OUSelected(IDirectoryEntryAdapter entry)
{
if (parentOU == null)
if (entry is IADOrganizationalUnit ou)
{
if (parentOU == null)
{
parentOU = ou;
return;
}
parentOU = ou;
return;
}
parentOU = ou;


await InvokeAsync(StateHasChanged);
await InvokeAsync(StateHasChanged);
}
}

async void CreateNewGroup()
Expand Down
9 changes: 1 addition & 8 deletions BLAZAM/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@

@if (ApplicationInfo.InDebugMode)
{
<MudContextMenu Text="Test Context Menu">
<MenuContents>

<MudMenuItem>Test Item</MudMenuItem>
<MudMenuItem>Test Item</MudMenuItem>
<MudMenuItem>Test Item</MudMenuItem>
</MenuContents>
</MudContextMenu><br/>

<MudButton Variant="Variant.Filled" OnClick="testJob">Run Test Job</MudButton>
}

Expand Down
18 changes: 11 additions & 7 deletions BLAZAM/Pages/OU/CreateOU.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


<OUTreeView Label="Parent Organizational Unit"
SelectedOUChanged="OUSelected">
SelectedEntryChanged="OUSelected">
@* <NodeContent>
@context.Name
</NodeContent>*@
Expand Down Expand Up @@ -84,19 +84,23 @@
return false;
}
*/
async void OUSelected(IADOrganizationalUnit ou)
async void OUSelected(IDirectoryEntryAdapter entry)
{
if (parentOU == null)
if (entry is IADOrganizationalUnit ou)
{
if (parentOU == null)
{
parentOU = ou;
return;
}
parentOU = ou;
return;
}
parentOU = ou;


await InvokeAsync(StateHasChanged);
await InvokeAsync(StateHasChanged);
}
}


async void CreateNewOU()
{
LoadingData = true;
Expand Down
32 changes: 23 additions & 9 deletions BLAZAM/Pages/Users/CreateUser.razor
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,18 @@
@AppLocalization["OU"]
</TabContent>
<ChildContent>
<OUTreeView SelectedOUChanged="OUSelected" />
@* <ADTreeView ShowAllEntries=false SelectedEntryChanged="OUSelected"/> *@
<OUTreeView AdditionalVisibilityFilters=@(AdditionalShow) StartRootExpanded=true SelectedEntryChanged="OUSelected" />

<MudTextField Label="@AppLocalization["Display Name"]" @bind-Value="@customUserDisplayName" />



<MudButton Color=Color.Primary OnClick="@(()=>{SelectedStep=0;})">Back</MudButton>
<MudButton Disabled=@(customUserDisplayName.IsNullOrEmpty()&& selectedOU!=null) Color=Color.Success OnClick="@(async()=>{await CreateCustomUser();selectedStep=5;})">Next</MudButton>
<MudButton Disabled=@(customUserDisplayName.IsNullOrEmpty()|| selectedOU==null) Color=Color.Success OnClick="@(async()=>{
await CreateCustomUser();
selectedStep=5;
})">Next</MudButton>


</ChildContent>
Expand Down Expand Up @@ -214,15 +218,17 @@ newUser?.StagePasswordChange(customConfirmPassword.ToSecureString());
await InvokeAsync(StateHasChanged);
}

async void OUSelected(IADOrganizationalUnit ou)
async void OUSelected(IDirectoryEntryAdapter entry)
{
if (selectedOU == null)
if (entry is IADOrganizationalUnit ou)
{
selectedOU = ou;
return;
if(ou.CanCreateUser)
selectedOU = ou;
else
{
SnackBarService.Warning(AppLocalization["You do not have permission to create users in that location"]);
}
}
selectedOU = ou;


await InvokeAsync(StateHasChanged);
}
Expand Down Expand Up @@ -334,5 +340,13 @@ newUser?.StagePasswordChange(customConfirmPassword.ToSecureString());
SelectedStep = 1;
await InvokeAsync(StateHasChanged);
}

bool AdditionalShow(IDirectoryEntryAdapter entry)
{
if(entry is IADOrganizationalUnit ou)
{
if (ou.CanCreateUser) return true;
if (ou.CanCreateUserInSubOUs) return true;
}
return false;
}
}
2 changes: 1 addition & 1 deletion BLAZAM/Pages/Users/ViewUser.razor
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
}
@if (User.CanReadField(ActiveDirectoryFields.HomeDrive))
{
<HomeDriveSelect Label="@AppLocalization["Home Drive"]" @bind-Value="@User.HomeDrive" Disabled=@(!EditMode || !User.CanEditField(ActiveDirectoryFields.HomeDrive)) />
<HomeDriveSelect Label="@AppLocalization["Home Drive"]" @bind-DriveLetter="@User.HomeDrive" Disabled=@(!EditMode || !User.CanEditField(ActiveDirectoryFields.HomeDrive)) />
}
@if (User.CanReadField(ActiveDirectoryFields.ScriptPath))
{
Expand Down
2 changes: 1 addition & 1 deletion BLAZAM/Pages/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.server.js"></script>
@if (!!ApplicationInfo.InDemoMode && !ApplicationInfo.InDebugMode && !Debugger.IsAttached)
@if (!!ApplicationInfo.InDemoMode && !ApplicationInfo.InDebugMode && !Debugger.IsAttached && DatabaseCache.ApplicationSettings?.SendDeveloperAnalytics == true)
{
<!-- BLAZAM Dev Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-415DR9ZVBH"></script>
Expand Down
28 changes: 28 additions & 0 deletions BLAZAM/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,18 @@ public static void Main(string[] args)
_ = new Encryption(Configuration?.GetValue<string>("EncryptionKey"));

//Setup host logging so it can catch the earliest logs possible
Loggers.SeqServerUri = "http://logs.blazam.org:5341";
if (Debugger.IsAttached)
{
Loggers.SeqAPIKey = "xE50e1ljqtgLzHcu8pYC";

}
else
{
Loggers.SeqAPIKey = "8TeLknA8XBk5ybamT5m9";

}

Loggers.SetupLoggers(WritablePath + @"logs\", ApplicationInfo.runningVersion.ToString());
builder.Host.UseSerilog(Log.Logger);

Expand All @@ -106,6 +117,23 @@ public static void Main(string[] args)
ApplicationInfo.services = AppInstance.Services;


try
{
var context = AppInstance.Services.GetRequiredService<IAppDatabaseFactory>().CreateDbContext();
if(context!=null && context.AppSettings.FirstOrDefault()?.SendLogsToDeveloper != null)
{
Loggers.SendToSeqServer = context.AppSettings.FirstOrDefault().SendLogsToDeveloper;

}

}catch (Exception ex)
{
Loggers.SystemLogger.Error(ex.Message + " {@Error}", ex);
}
Loggers.SetupLoggers(WritablePath + @"logs\", ApplicationInfo.runningVersion.ToString());



// Configure the HTTP request pipeline.


Expand Down
36 changes: 34 additions & 2 deletions BLAZAM/ProgramHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Org.BouncyCastle.Ocsp;
using System.Management;

namespace BLAZAM.Server
{
Expand All @@ -37,10 +38,12 @@ public static class ProgramHelpers
public static WebApplicationBuilder IntializeProperties(this WebApplicationBuilder builder)
{
//Set DebugMode flag from configuration
ApplicationInfo ApplicationInfo = new(builder);
//ApplicationInfo ApplicationInfo = new(builder);
ApplicationInfo.inDebugMode = builder.Configuration.GetValue<bool>("DebugMode");
ApplicationInfo.inDemoMode = builder.Configuration.GetValue<bool>("DemoMode");


//Set the installation ID
ApplicationInfo.installationId =GetInstallationId();

//Set application directories
//Program.RootDirectory = new SystemDirectory(builder.Environment.ContentRootPath);
Expand All @@ -61,6 +64,35 @@ public static WebApplicationBuilder IntializeProperties(this WebApplicationBuild
return builder;
}

private static Guid GetInstallationId()
{
//Try and get os id
try
{
string ComputerName = "localhost";
ManagementScope Scope;
Scope = new ManagementScope(String.Format("\\\\{0}\\root\\CIMV2", ComputerName), null);
Scope.Connect();
ObjectQuery Query = new ObjectQuery("SELECT UUID FROM Win32_ComputerSystemProduct");
ManagementObjectSearcher Searcher = new ManagementObjectSearcher(Scope, Query);

foreach (ManagementObject WmiObject in Searcher.Get())
{
return Guid.Parse(WmiObject["UUID"].ToString());

}
throw new ApplicationException("Searched but could not find a CSProduct UUID");
}

catch (Exception ex)
{
Console.WriteLine("Failed to get client ID (GUID). Error: " + ex.Message);
throw ex;
}


}

public static WebApplicationBuilder InjectServices(this WebApplicationBuilder builder)
{

Expand Down
Loading
Loading