Compare commits
7
Commits
0.2.3
..
d9da54653e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9da54653e | ||
|
|
859e96a706 | ||
|
|
0135b89f01 | ||
|
|
8c1bbc9866 | ||
|
|
8100998732 | ||
|
|
4a77a0d33a | ||
|
|
3acd4ad9d9 |
@@ -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"]
|
||||||
|
|||||||
+42
@@ -5,10 +5,48 @@ Changelog
|
|||||||
(unreleased)
|
(unreleased)
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Bugfixes, refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
- Reduce number of emitted logs. [simon]
|
||||||
|
|
||||||
|
|
||||||
|
0.2.5 (2025-05-18)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Install dependencies in runtime container not only build container,
|
||||||
|
refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.2.4 (2025-05-18)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Build errors, refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
0.2.3 (2025-05-18)
|
||||||
|
------------------
|
||||||
|
|
||||||
Fix
|
Fix
|
||||||
~~~
|
~~~
|
||||||
- Resolve linting errors, refs NOISSUE. [Simon Diesenreiter]
|
- Resolve linting errors, refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
0.2.2 (2025-05-18)
|
0.2.2 (2025-05-18)
|
||||||
------------------
|
------------------
|
||||||
@@ -178,6 +216,10 @@ Other
|
|||||||
0.1.9 (2025-04-15)
|
0.1.9 (2025-04-15)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|
||||||
|
0.1.8 (2025-04-15)
|
||||||
|
------------------
|
||||||
|
|
||||||
Fix
|
Fix
|
||||||
~~~
|
~~~
|
||||||
- Additional debug outputs refs NOISSUE. [Simon Diesenreiter]
|
- Additional debug outputs refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|||||||
+15
-12
@@ -18,6 +18,10 @@ LdapIntegration.Instance = new LdapIntegration(AppConfiguration.Instance.LDAPCon
|
|||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
var rand = new Random();
|
||||||
|
var num = rand.NextInt64();
|
||||||
|
var mod = num % AppConfiguration.Instance.AverageDaysBetweenRequests;
|
||||||
|
|
||||||
Console.WriteLine("Setting up user check timer");
|
Console.WriteLine("Setting up user check timer");
|
||||||
var userCheckTimer = new CronTimer("*/1 * * * *", "Europe/Vienna", includingSeconds: false);
|
var userCheckTimer = new CronTimer("*/1 * * * *", "Europe/Vienna", includingSeconds: false);
|
||||||
userCheckTimer.OnOccurence += async (s, ea) =>
|
userCheckTimer.OnOccurence += async (s, ea) =>
|
||||||
@@ -27,7 +31,6 @@ userCheckTimer.OnOccurence += async (s, ea) =>
|
|||||||
var needsSaving = false;
|
var needsSaving = false;
|
||||||
foreach (var memberId in memberList)
|
foreach (var memberId in memberList)
|
||||||
{
|
{
|
||||||
Console.WriteLine("found member: " + memberId);
|
|
||||||
var foundUser = dci.Users.Where(u => u.SignalMemberId == memberId).SingleOrDefault();
|
var foundUser = dci.Users.Where(u => u.SignalMemberId == memberId).SingleOrDefault();
|
||||||
if (foundUser == null)
|
if (foundUser == null)
|
||||||
{
|
{
|
||||||
@@ -97,21 +100,21 @@ pickOfTheDayTimer.OnOccurence += async (s, ea) =>
|
|||||||
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.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);
|
|
||||||
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.SendMessageToUserAsync($"Today's (optional) suggestion helper to help you pick a song is:\n\n**{suggestion.Title}**\n\n*{suggestion.Description}*", luckyUser.SignalMemberId);
|
await SignalIntegration.Instance.SendMessageToGroupAsync($"Today's chosen person to share a song is: **{userName}**");
|
||||||
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);
|
await SignalIntegration.Instance.SendMessageToGroupAsync($"Today's (optional) suggestion helper to help you pick a song is:\n\n**{suggestion.Title}**\n\n*{suggestion.Description}*");
|
||||||
|
await SignalIntegration.Instance.SendMessageToUserAsync($"Congratulations, you have been chosen to share a song today!", luckyUser.SignalMemberId);
|
||||||
|
await 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);
|
||||||
|
await 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 startUserAssociationProcess = (User userToAssociate) =>
|
var startUserAssociationProcess = async (User userToAssociate) =>
|
||||||
{
|
{
|
||||||
SignalIntegration.Instance.SendMessageToUserAsync($"Hi, I see you are not associated with any website user yet.", userToAssociate.SignalMemberId);
|
await SignalIntegration.Instance.SendMessageToUserAsync($"Hi, I see you are not associated with any website user yet.", userToAssociate.SignalMemberId);
|
||||||
SignalIntegration.Instance.SendMessageToUserAsync($"If you haven't yet, please navigate to https://users.disi.dev to create a new account.", userToAssociate.SignalMemberId);
|
await SignalIntegration.Instance.SendMessageToUserAsync($"If you haven't yet, please navigate to https://users.disi.dev to create a new account.", userToAssociate.SignalMemberId);
|
||||||
SignalIntegration.Instance.SendMessageToUserAsync($"Once you have done so, go to https://sotd.disi.dev, login, navigate to \"Unclaimed Phone Numbers\" and click on the \"Claim\" button to start the claim process.", userToAssociate.SignalMemberId);
|
await SignalIntegration.Instance.SendMessageToUserAsync($"Once you have done so, go to https://sotd.disi.dev, login, navigate to \"Unclaimed Phone Numbers\" and click on the \"Claim\" button to start the claim process.", userToAssociate.SignalMemberId);
|
||||||
SignalIntegration.Instance.SendMessageToUserAsync($"With a future update you will be required to submit songs via your user account - at that point you will be skipped during the selection process if you have not yet claimed your phone number!", userToAssociate.SignalMemberId);
|
await SignalIntegration.Instance.SendMessageToUserAsync($"With a future update you will be required to submit songs via your user account - at that point you will be skipped during the selection process if you have not yet claimed your phone number!", userToAssociate.SignalMemberId);
|
||||||
};
|
};
|
||||||
|
|
||||||
Console.WriteLine("Setting up LdapAssociation timer");
|
Console.WriteLine("Setting up LdapAssociation timer");
|
||||||
@@ -125,7 +128,7 @@ ldapAssociationTimer.OnOccurence += async (s, ea) =>
|
|||||||
{
|
{
|
||||||
user.AssociationInProgress = true;
|
user.AssociationInProgress = true;
|
||||||
|
|
||||||
startUserAssociationProcess(user);
|
await startUserAssociationProcess(user);
|
||||||
user.IsIntroduced = true;
|
user.IsIntroduced = true;
|
||||||
needsSaving = true;
|
needsSaving = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
0.2.3
|
0.2.6
|
||||||
|
|||||||
Reference in New Issue
Block a user