Compare commits
No commits in common. "main" and "v3.1.1" have entirely different histories.
|
@ -1,4 +1,4 @@
|
|||
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
|
||||
WORKDIR /jjj
|
||||
COPY ./JobsJobsJobs.sln ./
|
||||
COPY ./JobsJobsJobs/Directory.Build.props ./JobsJobsJobs/
|
||||
|
@ -14,13 +14,12 @@ RUN dotnet restore
|
|||
COPY . ./
|
||||
WORKDIR /jjj/JobsJobsJobs/Application
|
||||
RUN dotnet publish -c Release -r linux-x64
|
||||
RUN rm bin/Release/net8.0/linux-x64/publish/appsettings.*.json
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine as final
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine as final
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache icu-libs
|
||||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
||||
COPY --from=build /jjj/JobsJobsJobs/Application/bin/Release/net8.0/linux-x64/publish/ ./
|
||||
COPY --from=build /jjj/JobsJobsJobs/Application/bin/Release/net7.0/linux-x64/publish/ ./
|
||||
|
||||
EXPOSE 80
|
||||
CMD [ "dotnet", "/app/JobsJobsJobs.Application.dll" ]
|
||||
|
|
|
@ -59,9 +59,6 @@ let main args =
|
|||
opts.Cookie.HttpOnly <- true
|
||||
opts.Cookie.IsEssential <- true)
|
||||
|
||||
let emailCfg = cfg.GetSection "Email"
|
||||
if (emailCfg.GetChildren >> Seq.isEmpty >> not) () then ConfigurationBinder.Bind(emailCfg, Email.options)
|
||||
|
||||
let app = builder.Build ()
|
||||
|
||||
// Unify the endpoints from all features
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="FSharp.Core" Version="8.0.300" />
|
||||
<PackageReference Update="FSharp.Core" Version="7.0.300" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BitBadger.AspNetCore.CanonicalDomains" Version="1.0.0" />
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BitBadger.AspNetCore.CanonicalDomains" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="FSharp.Core" Version="8.0.300" />
|
||||
<PackageReference Update="FSharp.Core" Version="7.0.300" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -360,7 +360,7 @@ let registered =
|
|||
txt "register again."
|
||||
]
|
||||
p [] [
|
||||
txt "If you encounter issues, feel free to reach out to @daniel@fedi.summershome.org for assistance."
|
||||
txt "If you encounter issues, feel free to reach out to @danieljsummers on No Agenda Social for assistance."
|
||||
]
|
||||
]
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ type OtherContact =
|
|||
{ /// The type of contact
|
||||
ContactType : ContactType
|
||||
|
||||
/// The name of the contact (Email, Mastodon, LinkedIn, etc.)
|
||||
/// The name of the contact (Email, No Agenda Social, LinkedIn, etc.)
|
||||
Name : string option
|
||||
|
||||
/// The value for the contact (e-mail address, user name, URL, etc.)
|
||||
|
|
|
@ -3,41 +3,17 @@ module JobsJobsJobs.Email
|
|||
open System.Net
|
||||
open JobsJobsJobs.Domain
|
||||
open MailKit.Net.Smtp
|
||||
open MailKit.Security
|
||||
open MimeKit
|
||||
|
||||
/// Options to use when sending e-mail
|
||||
type EmailOptions() =
|
||||
/// The hostname of the SMTP server
|
||||
member val SmtpHost : string = "localhost" with get, set
|
||||
|
||||
/// The port over which SMTP communication should occur
|
||||
member val Port : int = 25 with get, set
|
||||
|
||||
/// Whether to use SSL when communicating with the SMTP server
|
||||
member val UseSsl : bool = false with get, set
|
||||
|
||||
/// The authentication to use with the SMTP server
|
||||
member val Authentication : string = "" with get, set
|
||||
|
||||
/// The e-mail address from which messages should be sent
|
||||
member val FromAddress : string = "nobody@noagendacareers.com" with get, set
|
||||
|
||||
/// The name from which messages should be sent
|
||||
member val FromName : string = "Jobs, Jobs, Jobs" with get, set
|
||||
|
||||
|
||||
/// The options for the SMTP server
|
||||
let mutable options = EmailOptions ()
|
||||
|
||||
/// Private functions for sending e-mail
|
||||
[<AutoOpen>]
|
||||
module private Helpers =
|
||||
|
||||
/// Create an SMTP client
|
||||
let createClient () = backgroundTask {
|
||||
let smtpClient () = backgroundTask {
|
||||
let client = new SmtpClient ()
|
||||
do! client.ConnectAsync (options.SmtpHost, options.Port, options.UseSsl)
|
||||
do! client.AuthenticateAsync (options.FromAddress, options.Authentication)
|
||||
do! client.ConnectAsync ("localhost", 25, SecureSocketOptions.None)
|
||||
return client
|
||||
}
|
||||
|
||||
|
@ -48,19 +24,13 @@ module private Helpers =
|
|||
msg.To.Add (MailboxAddress (Citizen.name citizen, citizen.Email))
|
||||
msg.Subject <- subject
|
||||
msg
|
||||
|
||||
/// Send a message
|
||||
let sendMessage msg = backgroundTask {
|
||||
use! client = createClient ()
|
||||
let! result = client.SendAsync msg
|
||||
do! client.DisconnectAsync true
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
/// Send an account confirmation e-mail
|
||||
let sendAccountConfirmation citizen security = backgroundTask {
|
||||
let token = WebUtility.UrlEncode security.Token.Value
|
||||
use msg = createMessage citizen "Account Confirmation Request"
|
||||
let token = WebUtility.UrlEncode security.Token.Value
|
||||
use! client = smtpClient ()
|
||||
use msg = createMessage citizen "Account Confirmation Request"
|
||||
|
||||
let text =
|
||||
[ $"ITM, {Citizen.name citizen}!"
|
||||
|
@ -87,13 +57,14 @@ let sendAccountConfirmation citizen security = backgroundTask {
|
|||
use msgText = new TextPart (Text = text)
|
||||
msg.Body <- msgText
|
||||
|
||||
return! sendMessage msg
|
||||
return! client.SendAsync msg
|
||||
}
|
||||
|
||||
/// Send a password reset link
|
||||
let sendPasswordReset citizen security = backgroundTask {
|
||||
let token = WebUtility.UrlEncode security.Token.Value
|
||||
use msg = createMessage citizen "Reset Password for Jobs, Jobs, Jobs"
|
||||
let token = WebUtility.UrlEncode security.Token.Value
|
||||
use! client = smtpClient ()
|
||||
use msg = createMessage citizen "Reset Password for Jobs, Jobs, Jobs"
|
||||
|
||||
let text =
|
||||
[ $"ITM, {Citizen.name citizen}!"
|
||||
|
@ -119,5 +90,5 @@ let sendPasswordReset citizen security = backgroundTask {
|
|||
use msgText = new TextPart (Text = text)
|
||||
msg.Body <- msgText
|
||||
|
||||
return! sendMessage msg
|
||||
return! client.SendAsync msg
|
||||
}
|
||||
|
|
|
@ -16,18 +16,18 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BitBadger.Npgsql.FSharp.Documents" Version="1.0.0-beta3" />
|
||||
<PackageReference Include="FSharp.SystemTextJson" Version="1.3.13" />
|
||||
<PackageReference Include="Giraffe" Version="6.4.0" />
|
||||
<PackageReference Include="Giraffe.Htmx" Version="2.0.0" />
|
||||
<PackageReference Include="FSharp.SystemTextJson" Version="1.1.23" />
|
||||
<PackageReference Include="Giraffe" Version="6.0.0" />
|
||||
<PackageReference Include="Giraffe.Htmx" Version="1.9.2" />
|
||||
<PackageReference Include="Giraffe.ViewEngine" Version="1.4.0" />
|
||||
<PackageReference Include="Giraffe.ViewEngine.Htmx" Version="2.0.0" />
|
||||
<PackageReference Include="MailKit" Version="4.6.0" />
|
||||
<PackageReference Include="Markdig" Version="0.37.0" />
|
||||
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.1.0" />
|
||||
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.2.0" />
|
||||
<PackageReference Include="Giraffe.ViewEngine.Htmx" Version="1.9.2" />
|
||||
<PackageReference Include="MailKit" Version="4.1.0" />
|
||||
<PackageReference Include="Markdig" Version="0.31.0" />
|
||||
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" />
|
||||
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" />
|
||||
<PackageReference Include="Npgsql.FSharp" Version="5.7.0" />
|
||||
<PackageReference Include="Npgsql.NodaTime" Version="8.0.3" />
|
||||
<PackageReference Update="FSharp.Core" Version="8.0.300" />
|
||||
<PackageReference Include="Npgsql.NodaTime" Version="7.0.4" />
|
||||
<PackageReference Update="FSharp.Core" Version="7.0.300" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<DebugType>embedded</DebugType>
|
||||
<GenerateDocumentationFile>false</GenerateDocumentationFile>
|
||||
<AssemblyVersion>3.2.0.0</AssemblyVersion>
|
||||
<FileVersion>3.2.0.0</FileVersion>
|
||||
<AssemblyVersion>3.1.1.0</AssemblyVersion>
|
||||
<FileVersion>3.1.1.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="FSharp.Core" Version="8.0.300" />
|
||||
<PackageReference Update="FSharp.Core" Version="7.0.300" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -984,9 +984,12 @@ module Help =
|
|||
h4 [ mainHeading ] [ txt "Help / Suggestions" ]
|
||||
p [] [
|
||||
txt "This is open-source software "
|
||||
a [ _href "https://git.bitbadger.solutions/bit-badger/jobs-jobs-jobs"; _target "_blank"
|
||||
_rel "noopener" ] [ txt "developed in Git" ]
|
||||
txt "; feel free to ping @daniel@fedi.summershome.org if you run into any issues."
|
||||
a [ _href "https://github.com/bit-badger/jobs-jobs-jobs"; _target "_blank"; _rel "noopener" ] [
|
||||
txt "developed on Github"
|
||||
]; txt "; feel free to "
|
||||
a [ _href "https://github.com/bit-badger/jobs-jobs-jobs/issues"; _target "_blank"; _rel "noopener" ] [
|
||||
txt "create an issue there"
|
||||
]; txt ", or look up @danieljsummers on No Agenda Social."
|
||||
]
|
||||
]
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="FSharp.Core" Version="8.0.300" />
|
||||
<PackageReference Update="FSharp.Core" Version="7.0.300" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="FSharp.Core" Version="8.0.300" />
|
||||
<PackageReference Update="FSharp.Core" Version="7.0.300" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="FSharp.Core" Version="8.0.300" />
|
||||
<PackageReference Update="FSharp.Core" Version="7.0.300" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
Loading…
Reference in New Issue
Block a user