Compare commits

...

20 Commits
0.1.12 ... main

Author SHA1 Message Date
Simon Diesenreiter
6b9c383697 feat(auth): initial auth added part 2, refs NOISSUE
Some checks failed
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m28s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
SonarQube Scan / SonarQube Trigger (push) Failing after 5m32s
2025-04-26 14:04:28 +02:00
Simon Diesenreiter
92828a90e2 feat(auth): initial auth added, refs NOISSUE
Some checks failed
CI / tests_linux (9.0.X, ubuntu-latest) (push) Blocked by required conditions
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
2025-04-26 14:00:19 +02:00
Simon Diesenreiter
9fe4613be7 release: version 0.1.21 🚀
Some checks failed
Build Docker image / Create Release (push) Successful in 25s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / deploy (push) Successful in 2m20s
2025-04-15 15:33:04 +02:00
Simon Diesenreiter
a09e27281e fix: fix new user saving refs NOISSUE 2025-04-15 15:33:02 +02:00
Simon Diesenreiter
8417003ea7 release: version 0.1.20 🚀
Some checks failed
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / Create Release (push) Successful in 20s
Build Docker image / deploy (push) Successful in 1m32s
2025-04-15 15:24:51 +02:00
Simon Diesenreiter
8412cc13df fix: remove unnecessary dotnet runtime download in CI job refs NOISSUE 2025-04-15 15:24:47 +02:00
Simon Diesenreiter
7dabcb71f8 release: version 0.1.19 🚀
Some checks failed
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / Create Release (push) Successful in 19s
Build Docker image / deploy (push) Failing after 1m56s
2025-04-15 15:18:40 +02:00
Simon Diesenreiter
001711487c fix: improve Docker build refs NOISSUE 2025-04-15 15:18:37 +02:00
Simon Diesenreiter
bf4bcebfb8 release: version 0.1.18 🚀
Some checks failed
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / Create Release (push) Successful in 12s
Build Docker image / deploy (push) Failing after 1m48s
2025-04-15 15:10:23 +02:00
Simon Diesenreiter
0561eb757c fix: remove broken Crontimer NuGet feed reference refs NOISSUE 2025-04-15 15:10:18 +02:00
Simon Diesenreiter
5510832538 release: version 0.1.17 🚀
Some checks failed
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / Create Release (push) Successful in 17s
Build Docker image / deploy (push) Failing after 1m18s
2025-04-15 15:07:10 +02:00
Simon Diesenreiter
604e8dfe70 fix: remove uinnecessary NuGet login refs NOISSUE 2025-04-15 15:07:03 +02:00
Simon Diesenreiter
2c2a58975e release: version 0.1.16 🚀
Some checks failed
CI / tests_linux (9.0.X, ubuntu-latest) (push) Blocked by required conditions
Build Docker image / Create Release (push) Successful in 20s
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / deploy (push) Has been cancelled
2025-04-15 15:06:32 +02:00
Simon Diesenreiter
7572a66ae2 fix: add direct CronTimer reference refs NOISSUE 2025-04-15 15:06:29 +02:00
Simon Diesenreiter
3ed6c4c54f release: version 0.1.15 🚀
Some checks failed
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / Create Release (push) Successful in 10s
Build Docker image / deploy (push) Failing after 52s
2025-04-15 14:56:01 +02:00
Simon Diesenreiter
f2472a3ea2 fix: login to NuGet feed at build refs NOISSUE 2025-04-15 14:55:56 +02:00
Simon Diesenreiter
4d657cf887 release: version 0.1.14 🚀
Some checks failed
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / Create Release (push) Successful in 12s
Build Docker image / deploy (push) Failing after 1m13s
2025-04-15 14:38:19 +02:00
Simon Diesenreiter
1388ce80db fix: fix typo refs NOISSUE 2025-04-15 14:38:16 +02:00
Simon Diesenreiter
d335ddfd0d release: version 0.1.13 🚀
Some checks failed
Build Docker image / Create Release (push) Successful in 21s
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m2s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / deploy (push) Failing after 1m57s
2025-04-15 14:34:56 +02:00
Simon Diesenreiter
68caf0a329 fix: really fix Crontab dependency refs NOISSUE 2025-04-15 14:34:51 +02:00
13 changed files with 402 additions and 15 deletions

View File

@ -38,10 +38,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.X'
- name: Check version match
run: |
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
@ -61,5 +57,5 @@ jobs:
run: |
REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}' | tr '[:upper:]' '[:lower:]')
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
docker build -t "git.disi.dev/$REPOSITORY_OWNER/song-of-the-day:$(cat $REPOSITORY_NAME/VERSION)" ./song_of_the_day
docker build -t "git.disi.dev/$REPOSITORY_OWNER/song-of-the-day:$(cat $REPOSITORY_NAME/VERSION)" ./
docker push "git.disi.dev/$REPOSITORY_OWNER/song-of-the-day:$(cat $REPOSITORY_NAME/VERSION)"

View File

@ -0,0 +1,6 @@
using System;
public class CronTimerEventArgs : EventArgs
{
public DateTime At { get; set; }
}

78
CronTimer/CronTimer.cs Normal file
View File

@ -0,0 +1,78 @@
using System;
using System.Threading;
using NCrontab;
public class CronTimer
{
public const string UTC = "Etc/UTC";
static readonly TimeSpan InfiniteTimeSpan = TimeSpan.FromMilliseconds(Timeout.Infinite); // net 3.5
readonly CrontabSchedule schedule;
readonly TimeZoneInfo tzi;
readonly string id;
readonly Timer t;
public string tz { get; }
public string Expression { get; }
public event EventHandler<CronTimerEventArgs> OnOccurence;
public DateTime Next { get; private set; }
public CronTimer(string expression, string tz = UTC, bool includingSeconds = false)
{
Expression = expression;
this.tz = tz;
id = TimeZoneConverter.TZConvert.IanaToWindows(tz);
tzi = TimeZoneInfo.FindSystemTimeZoneById(id);
schedule = CrontabSchedule.Parse(expression, new CrontabSchedule.ParseOptions { IncludingSeconds = includingSeconds });
Next = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, tzi);
OnOccurence += OnOccurenceScheduleNext;
t = new Timer(s =>
{
var ea = new CronTimerEventArgs
{
At = Next
};
OnOccurence(this, ea);
}, null, InfiniteTimeSpan, InfiniteTimeSpan);
}
void OnOccurenceScheduleNext(object sender, EventArgs e)
{
var delay = CalculateDelay();
//Console.WriteLine($"Next for [{tz} {expression}] in {delay}.");
t.Change(delay, InfiniteTimeSpan);
}
public void Start()
{
var delay = CalculateDelay();
//Console.WriteLine($"Next for [{tz} {expression}] in {delay}.");
t.Change(delay, InfiniteTimeSpan);
}
TimeSpan CalculateDelay()
{
var nowUtc = DateTime.UtcNow;
Next = schedule.GetNextOccurrence(Next);
TimeSpan delay;
if (tz != UTC)
{
var nextUtc = TimeZoneInfo.ConvertTimeToUtc(Next, tzi);
delay = nextUtc - nowUtc;
}
else
{
delay = Next - nowUtc;
}
//Console.WriteLine($"Now: {nowUtc} [utc] {now} [{tz}], Next: {next} [{tz}] {nextUtc} [utc], Delay: {delay}");
if (delay < TimeSpan.Zero) delay = TimeSpan.Zero;
return delay;
}
public void Stop()
{
t.Change(InfiniteTimeSpan, InfiniteTimeSpan);
}
}

View File

@ -0,0 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net461;netstandard2.1</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<!-- AssemblyFileVersionAttribute -->
<FileVersion>2.0.1</FileVersion>
<!-- AssemblyInformationalVersionAttribute -->
<Version>$(FileVersion)</Version>
<!-- AssemblyVersionAttribute -->
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<!-- Nuget -->
<PackageVersion>$(Version)</PackageVersion>
<PackageId>CronTimer</PackageId>
<Company>https://github.com/ramonsmits</Company>
<Authors>ramonsmits</Authors>
<Description>Simple .net Timer that is based on cron expressions with second accuracy to fire timer events to a very specific schedule.</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageProjectUrl>https://github.com/ramonsmits/CronTimer/tree/$(PackageVersion)</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSource>True</IncludeSource>
<RepositoryUrl>https://github.com/ramonsmits/CronTimer</RepositoryUrl>
<Copyright>Copyright 2022 (c) Ramon Smits</Copyright>
<PackageTags>cron timer</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ncrontab" Version="3.3.1" />
<PackageReference Include="TimeZoneConverter" Version="6.0.1" />
</ItemGroup>
<!--<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions">
<Version>3.1.4</Version>
</PackageReference>
</ItemGroup>-->
</Project>

36
CronTimer/CronTimer.sln Normal file
View File

@ -0,0 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30717.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CronTimer", "CronTimer.csproj", "{FB64C227-8615-4AE1-94E3-F9F9DF192B72}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CCDD0B34-653C-430C-9B17-5129618F8D7D}"
ProjectSection(SolutionItems) = preProject
..\README.md = ..\README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "..\Demo\Demo.csproj", "{C2638357-1621-4422-8701-B55BFB37ACCF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FB64C227-8615-4AE1-94E3-F9F9DF192B72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB64C227-8615-4AE1-94E3-F9F9DF192B72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB64C227-8615-4AE1-94E3-F9F9DF192B72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB64C227-8615-4AE1-94E3-F9F9DF192B72}.Release|Any CPU.Build.0 = Release|Any CPU
{C2638357-1621-4422-8701-B55BFB37ACCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2638357-1621-4422-8701-B55BFB37ACCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2638357-1621-4422-8701-B55BFB37ACCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2638357-1621-4422-8701-B55BFB37ACCF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A639B164-6581-40DF-ADC4-479DAB467CFE}
EndGlobalSection
EndGlobal

View File

@ -3,10 +3,13 @@ WORKDIR /App
# Copy everything
COPY . ./
RUN apt upgrade && apt install libldap -y
# Restore as distinct layers
RUN dotnet restore
RUN dotnet restore ./song_of_the_day/song_of_the_day.csproj
# Build and publish a release
RUN dotnet publish -o out
RUN dotnet publish ./song_of_the_day/song_of_the_day.csproj -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:9.0

View File

@ -5,10 +5,111 @@ Changelog
(unreleased)
------------
Fix
~~~
- Fix new user saving refs NOISSUE. [Simon Diesenreiter]
0.1.20 (2025-04-15)
-------------------
Fix
~~~
- Remove unnecessary dotnet runtime download in CI job refs NOISSUE.
[Simon Diesenreiter]
Other
~~~~~
0.1.19 (2025-04-15)
-------------------
Fix
~~~
- Improve Docker build refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.1.18 (2025-04-15)
-------------------
Fix
~~~
- Remove broken Crontimer NuGet feed reference refs NOISSUE. [Simon
Diesenreiter]
Other
~~~~~
0.1.17 (2025-04-15)
-------------------
Fix
~~~
- Remove uinnecessary NuGet login refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.1.16 (2025-04-15)
-------------------
Fix
~~~
- Add direct CronTimer reference refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.1.15 (2025-04-15)
-------------------
Fix
~~~
- Login to NuGet feed at build refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.1.14 (2025-04-15)
-------------------
Fix
~~~
- Fix typo refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.1.13 (2025-04-15)
-------------------
Fix
~~~
- Really fix Crontab dependency refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.1.12 (2025-04-15)
-------------------
Fix
~~~
- Hotfixed CronTab dependencyrefs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.1.11 (2025-04-15)
-------------------

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<!--add key="gitea-projects" value="https://git.disi.dev/api/packages/Projects/nuget/index.json" /-->
<add key="gitea-homelab" value="https://git.disi.dev/api/packages/Homelab/nuget/index.json" />
<!--add key="gitea-artifacts" value="https://git.disi.dev/api/packages/Artifacts/nuget/index.json" /-->
<add key="HomeLab" value="https://git.disi.dev/api/packages/HomeLab/nuget/index.json" />
</packageSources>
</configuration>
</configuration>

View File

@ -0,0 +1,16 @@
public class ConfigurationAD
{
public int Port { get; set; } = 389;
public string Zone { get; set; } = string.Empty;
public string Domain { get; set; } = string.Empty;
public string Subdomain { get; set; } = string.Empty;
public string Username { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string LDAPserver { get; set; } = string.Empty;
public string LDAPQueryBase { get; set; } = string.Empty;
public string Crew { get; set; } = string.Empty;
public string Managers { get; set; } = string.Empty;
}

View File

@ -16,8 +16,22 @@ public class AppConfiguration
this.SignalGroupId = Environment.GetEnvironmentVariable("SIGNAL_GROUP_ID") ?? "group.Wmk1UTVQTnh0Sjd6a0xiOGhnTnMzZlNkc2p2Q3c0SXJiQkU2eDlNU0hyTT0=";
this.WebUIBaseURL = Environment.GetEnvironmentVariable("WEB_BASE_URL") ?? "https://sotd.disi.dev/";
this.UseBotTag = bool.Parse(Environment.GetEnvironmentVariable("USE_BOT_TAG") ?? "true");
var managersGroupName = Environment.GetEnvironmentVariable("LDAP_ADMINGROUP") ?? "admins";
var userGroupName = Environment.GetEnvironmentVariable("LDAP_USERGROUP") ?? "everyone";
this.LDAPConfig = new ConfigurationAD() {
Username = Environment.GetEnvironmentVariable("LDAP_BIND") ?? "cn=admin.dc=disi,dc=dev",
Password = Environment.GetEnvironmentVariable("LDAP_PASS") ?? "adminPass2022!",
Port = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("LDAP_BIND")) ? int.Parse(Environment.GetEnvironmentVariable("LDAP_BIND")) : 389,
LDAPserver = Environment.GetEnvironmentVariable("LDAP_URL") ?? "192.168.1.108",
LDAPQueryBase = Environment.GetEnvironmentVariable("LDAP_BASE") ?? "dc=disi,dc=dev",
Crew = $"cn={userGroupName},ou=groups,dc=disi,dc=dev",
Managers = $"cn={managersGroupName},ou=groups,dc=disi,dc=dev"
};
}
public string Crew { get; set; } = string.Empty;
public string Managers { get; set; } = string.Empty;
public string SignalAPIEndpointUri
{
get; private set;
@ -72,4 +86,8 @@ public class AppConfiguration
{
get; private set;
}
public ConfigurationAD LDAPConfig {
get; private set;
}
}

View File

@ -2,6 +2,9 @@
using Scalar.AspNetCore;
using Microsoft.AspNetCore.OpenApi;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using System.DirectoryServices.Protocols;
SignalIntegration.Instance = new SignalIntegration(AppConfiguration.Instance.SignalAPIEndpointUri,
int.Parse(AppConfiguration.Instance.SignalAPIEndpointPort),
@ -33,6 +36,7 @@ userCheckTimer.OnOccurence += async (s, ea) =>
NickName = string.Empty,
IsIntroduced = false
};
dci.Users.Add(newUser);
needsSaving = true;
}
}
@ -43,7 +47,7 @@ userCheckTimer.OnOccurence += async (s, ea) =>
}
await dci.DisposeAsync();
};
userCheckTimer.Start();
//userCheckTimer.Start();
Console.WriteLine("Setting up user intro timer");
var userIntroTimer = new CronTimer("*/1 * * * *", "Europe/Vienna", includingSeconds: false);
@ -65,7 +69,7 @@ userIntroTimer.OnOccurence += async (s, ea) =>
}
await dci.DisposeAsync();
};
userIntroTimer.Start();
//userIntroTimer.Start();
Console.WriteLine("Setting up pick of the day timer");
@ -81,7 +85,84 @@ pickOfTheDayTimer.OnOccurence += async (s, ea) =>
SignalIntegration.Instance.SendMessageToUserAsync($"Today's (optional) suggestion helper to help you pick a song is:\n\n**{suggestion.Title}**\n\n*{suggestion.Description}*", luckyUser.SignalMemberId);
SignalIntegration.Instance.SendMessageToUserAsync($"For now please just share your suggestion with the group - in the future I might ask you to share directly with me or via the website to help me keep track of past suggestions!", luckyUser.SignalMemberId);
};
pickOfTheDayTimer.Start();
//pickOfTheDayTimer.Start();
var connection = new LdapConnection(AppConfiguration.Instance.LDAPConfig.LDAPserver)
{
Credential = new(
AppConfiguration.Instance.LDAPConfig.Username,
AppConfiguration.Instance.LDAPConfig.Password
)
};
var attributesToQuery = new string[]
{
"objectGUID",
"sAMAccountName",
"displayName",
"mail",
"whenCreated"
};
SearchResponse SearchInAD(
string ldapServer,
int ldapPort,
string domainForAD,
string username,
string password,
string targetOU,
string query,
SearchScope scope,
params string[] attributeList
)
{
// on Windows the authentication type is Negotiate, so there is no need to prepend
// AD user login with domain. On other platforms at the moment only
// Basic authentication is supported
var authType = AuthType.Basic;
//var connection = new LdapConnection(ldapServer)
var connection = new LdapConnection(
new LdapDirectoryIdentifier(ldapServer, ldapPort)
)
{
AuthType = authType,
Credential = new(username, password)
};
// the default one is v2 (at least in that version), and it is unknown if v3
// is actually needed, but at least Synology LDAP works only with v3,
// and since our Exchange doesn't complain, let it be v3
connection.SessionOptions.ProtocolVersion = 3;
// this is for connecting via LDAPS (636 port). It should be working,
// according to https://github.com/dotnet/runtime/issues/43890,
// but it doesn't (at least with Synology DSM LDAP), although perhaps
// for a different reason
//connection.SessionOptions.SecureSocketLayer = true;
connection.Bind();
var request = new SearchRequest(targetOU, query, scope, attributeList);
return (SearchResponse)connection.SendRequest(request);
}
var searchResults = SearchInAD(
AppConfiguration.Instance.LDAPConfig.LDAPserver,
AppConfiguration.Instance.LDAPConfig.Port,
AppConfiguration.Instance.LDAPConfig.Username,
AppConfiguration.Instance.LDAPConfig.Password,
AppConfiguration.Instance.LDAPConfig.LDAPQueryBase,
new StringBuilder("(&")
.Append("(objectCategory=person)")
.Append("(objectClass=user)")
.Append($"(memberOf={_configurationAD.Crew})")
.Append("(!(userAccountControl:1.2.840.113556.1.4.803:=2))")
.Append(")")
.ToString(),
SearchScope.Subtree,
attributesToQuery
);
// Add services to the container.
builder.Services.AddRazorPages();

View File

@ -1 +1 @@
0.1.12
0.1.21

View File

@ -16,9 +16,12 @@
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
<PackageReference Include="NSwag.ApiDescription.Client" Version="13.0.5" />
<PackageReference Include="Scalar.AspNetCore" Version="2.1.*" />
<PackageReference Include="CronTimer" Version="2.0.0" />
<PackageReference Include="System.DirectoryServices.Protocols" Version="*" />
</ItemGroup>
<ItemGroup>
<OpenApiReference Include="swagger.json" SourceUrl="https://bbernhard.github.io/signal-cli-rest-api/src/docs/swagger.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CronTimer\CronTimer.csproj" />
</ItemGroup>
</Project>