Compare commits

..

8 Commits
0.2.1 ... main

Author SHA1 Message Date
8c1bbc9866 release: version 0.2.5 🚀
Some checks failed
Build Docker image / Create Release (push) Successful in 24s
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m11s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
Build Docker image / deploy (push) Successful in 2m16s
SonarQube Scan / SonarQube Trigger (push) Failing after 4m52s
2025-05-18 11:59:55 +02:00
8100998732 fix: install dependencies in runtime container not only build container, refs NOISSUE 2025-05-18 11:59:52 +02:00
4a77a0d33a release: version 0.2.4 🚀
Some checks failed
Build Docker image / Create Release (push) Successful in 35s
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m36s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
Build Docker image / deploy (push) Successful in 2m37s
SonarQube Scan / SonarQube Trigger (push) Failing after 5m5s
2025-05-18 11:44:06 +02:00
3acd4ad9d9 fix: build errors, refs NOISSUE 2025-05-18 11:44:01 +02:00
33aae65647 release: version 0.2.3 🚀
Some checks failed
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m29s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
Build Docker image / Create Release (push) Successful in 1m18s
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / deploy (push) Has been cancelled
2025-05-18 11:42:19 +02:00
083038d76c fix: resolve linting errors, refs NOISSUE 2025-05-18 11:42:09 +02:00
055cf79354 release: version 0.2.2 🚀
Some checks failed
Build Docker image / Create Release (push) Successful in 18s
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m3s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
Build Docker image / deploy (push) Failing after 2m0s
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
2025-05-18 11:39:32 +02:00
b4a893d936 fix: also send pick suggestion to the group, refs NOISSUE 2025-05-18 11:39:27 +02:00
8 changed files with 65 additions and 14 deletions

View File

@ -14,5 +14,6 @@ RUN dotnet publish ./song_of_the_day/song_of_the_day.csproj -o out
# Build runtime image # Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:9.0 FROM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /App WORKDIR /App
RUN apt update && apt install libldap-2.5-0 -y
COPY --from=build /App/out . COPY --from=build /App/out .
ENTRYPOINT ["dotnet", "song_of_the_day.dll"] ENTRYPOINT ["dotnet", "song_of_the_day.dll"]

View File

@ -5,10 +5,56 @@ Changelog
(unreleased) (unreleased)
------------ ------------
Fix
~~~
- Install dependencies in runtime container not only build container,
refs NOISSUE. [Simon Diesenreiter]
0.2.4 (2025-05-18)
------------------
Fix
~~~
- Build errors, refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.2.3 (2025-05-18)
------------------
Fix
~~~
- Resolve linting errors, refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.2.2 (2025-05-18)
------------------
Fix
~~~
- Also send pick suggestion to the group, refs NOISSUE. [Simon
Diesenreiter]
Other
~~~~~
0.2.1 (2025-05-17)
------------------
Fix Fix
~~~ ~~~
- Fix Docker build, refs NOISSUE. [Simon Diesenreiter] - Fix Docker build, refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.2.0 (2025-05-17) 0.2.0 (2025-05-17)
------------------ ------------------

View File

@ -1,4 +1,4 @@
public interface IAuthenticationService public interface IAuthenticationService
{ {
bool Authenticate(string userName, string password); bool Authenticate(string userName, string password);
} }

View File

@ -34,7 +34,7 @@ public class PhoneClaimCodeProviderService
SignalIntegration.Instance.SendMessageToUserAsync("Your phone number validation code is: " + generatedCode, phoneNumber); SignalIntegration.Instance.SendMessageToUserAsync("Your phone number validation code is: " + generatedCode, phoneNumber);
} }
public string ValidateClaimCodeForUser(string code, string username) public string ValidateClaimCodeForUser(string code, string username)
{ {
var result = false; var result = false;
@ -50,7 +50,7 @@ public class PhoneClaimCodeProviderService
return string.Empty; return string.Empty;
} }
public bool IsCodeGeneratedForUser(string username) public bool IsCodeGeneratedForUser(string username)
{ {
return _phoneClaimCodes.ContainsKey(username); return _phoneClaimCodes.ContainsKey(username);

View File

@ -19,7 +19,8 @@ public class AppConfiguration
this.AverageDaysBetweenRequests = int.Parse(Environment.GetEnvironmentVariable("AVERAGE_DAYS_BETWEEN_REQUESTS") ?? "2"); this.AverageDaysBetweenRequests = int.Parse(Environment.GetEnvironmentVariable("AVERAGE_DAYS_BETWEEN_REQUESTS") ?? "2");
var managersGroupName = Environment.GetEnvironmentVariable("LDAP_ADMINGROUP") ?? "admins"; var managersGroupName = Environment.GetEnvironmentVariable("LDAP_ADMINGROUP") ?? "admins";
var userGroupName = Environment.GetEnvironmentVariable("LDAP_USERGROUP") ?? "everybody"; var userGroupName = Environment.GetEnvironmentVariable("LDAP_USERGROUP") ?? "everybody";
this.LDAPConfig = new ConfigurationAD() { this.LDAPConfig = new ConfigurationAD()
{
Username = Environment.GetEnvironmentVariable("LDAP_BIND") ?? "cn=admin,dc=disi,dc=dev", Username = Environment.GetEnvironmentVariable("LDAP_BIND") ?? "cn=admin,dc=disi,dc=dev",
Password = Environment.GetEnvironmentVariable("LDAP_PASS") ?? "adminPass2022!", Password = Environment.GetEnvironmentVariable("LDAP_PASS") ?? "adminPass2022!",
Port = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("LDAP_BIND")) ? int.Parse(Environment.GetEnvironmentVariable("LDAP_BIND")) : 389, Port = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("LDAP_BIND")) ? int.Parse(Environment.GetEnvironmentVariable("LDAP_BIND")) : 389,
@ -91,7 +92,8 @@ public class AppConfiguration
get; private set; get; private set;
} }
public ConfigurationAD LDAPConfig { public ConfigurationAD LDAPConfig
{
get; private set; get; private set;
} }
} }

View File

@ -107,9 +107,10 @@ public class LdapIntegration
var userList = new List<LdapUser>(); var userList = new List<LdapUser>();
foreach(SearchResultEntry result in response.Entries) foreach (SearchResultEntry result in response.Entries)
{ {
userList.Add(new LdapUser() { userList.Add(new LdapUser()
{
UserId = result.Attributes["uid"][0].ToString(), UserId = result.Attributes["uid"][0].ToString(),
FirstName = result.Attributes["givenName"][0].ToString(), FirstName = result.Attributes["givenName"][0].ToString(),
LastName = result.Attributes["sn"][0].ToString(), LastName = result.Attributes["sn"][0].ToString(),

View File

@ -91,15 +91,16 @@ pickOfTheDayTimer.OnOccurence += async (s, ea) =>
if (mod > 0) if (mod > 0)
{ {
Console.WriteLine("Skipping pick of the day today!"); Console.WriteLine("Skipping pick of the day today!");
return; return;
} }
var dci = DataContext.Instance; var dci = DataContext.Instance;
var luckyUser = await dci.Users.ElementAtAsync((new Random()).Next(await dci.Users.CountAsync())); var luckyUser = await dci.Users.ElementAtAsync((new Random()).Next(await dci.Users.CountAsync()));
var userName = string.IsNullOrEmpty(luckyUser.NickName) ? luckyUser.Name : luckyUser.NickName; var userName = string.IsNullOrEmpty(luckyUser.NickName) ? luckyUser.Name : luckyUser.NickName;
SignalIntegration.Instance.SendMessageToGroupAsync($"Today's chosen person to share a song is: **{userName}**");
SignalIntegration.Instance.SendMessageToUserAsync($"Congratulations, you have been chosen to share a song today!", luckyUser.SignalMemberId);
var suggestion = await dci.SuggestionHelpers.ElementAtAsync((new Random()).Next(await dci.SuggestionHelpers.CountAsync())); var suggestion = await dci.SuggestionHelpers.ElementAtAsync((new Random()).Next(await dci.SuggestionHelpers.CountAsync()));
SignalIntegration.Instance.SendMessageToGroupAsync($"Today's chosen person to share a song is: **{userName}**");
SignalIntegration.Instance.SendMessageToGroupAsync($"Today's (optional) suggestion helper to help you pick a song is:\n\n**{suggestion.Title}**\n\n*{suggestion.Description}*");
SignalIntegration.Instance.SendMessageToUserAsync($"Congratulations, you have been chosen to share a song today!", luckyUser.SignalMemberId);
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($"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); 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);
}; };
@ -123,7 +124,7 @@ ldapAssociationTimer.OnOccurence += async (s, ea) =>
foreach (var user in nonAssociatedUsers) foreach (var user in nonAssociatedUsers)
{ {
user.AssociationInProgress = true; user.AssociationInProgress = true;
startUserAssociationProcess(user); startUserAssociationProcess(user);
user.IsIntroduced = true; user.IsIntroduced = true;
needsSaving = true; needsSaving = true;

View File

@ -1 +1 @@
0.2.1 0.2.5