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

Release of v1.1.4 #164

Merged
merged 16 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.suo
*.user
*.sln.docstates
.idea/

# Build results

Expand Down Expand Up @@ -225,7 +226,6 @@ out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
Expand Down Expand Up @@ -275,3 +275,9 @@ user-uploads/

# Azure publish file
src/Raytha.Web/Properties/ServiceDependencies/*

# Raytha javascript and theme files
src/Raytha.Web/wwwroot/raytha_admin/**/*.map
src/Raytha.Web/wwwroot/raytha_admin/**/*.ts
src/Raytha.Web/wwwroot/raytha_admin/**/*.scss
src/Raytha.Web/wwwroot/raytha_admin/**/*.txt
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS publish
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS publish
WORKDIR /src

RUN apt install -y curl
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y nodejs
RUN apt update
RUN apt install -y curl ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt update
RUN apt install -y nodejs

COPY ["src/Raytha.Domain/Raytha.Domain.csproj", "src/Raytha.Domain/"]
COPY ["src/Raytha.Application/Raytha.Application.csproj", "src/Raytha.Application/"]
Expand All @@ -14,13 +18,9 @@ COPY ["src/Raytha.Web/Raytha.Web.csproj", "src/Raytha.Web/"]
COPY ["tests/Raytha.Domain.UnitTests/Raytha.Domain.UnitTests.csproj", "tests/Raytha.Domain.UnitTests/"]
COPY ["Raytha.sln", ""]

ARG DOTNET_RESTORE_CLI_ARGS=
RUN dotnet restore "Raytha.sln" $DOTNET_RESTORE_CLI_ARGS

COPY . .
RUN dotnet build "Raytha.sln" -c Release --no-restore

RUN dotnet publish -c Release --no-build -o /app "src/Raytha.Web/Raytha.Web.csproj"
RUN dotnet publish -c Release -o /app "src/Raytha.Web/Raytha.Web.csproj"

FROM base AS final
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion docfx_project/articles/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A priority of Raytha is to keep the technology footprint small for getting up and running as quickly as possible. However, you do need the minimum requirements listed below:

* .NET 6+
* .NET 8+
* npm for compiling javascript
* SQL Server Express
* [SMTP](/articles/smtp.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Validator(IRaythaDbContext db)
RuleFor(x => x.Id).NotEmpty();
RuleFor(x => x).Custom((request, context) =>
{
if (request.NewPassword.Length < PasswordUtility.PASSWORD_MIN_CHARACTER_LENGTH)
if (string.IsNullOrEmpty(request.NewPassword) || request.NewPassword.Length < PasswordUtility.PASSWORD_MIN_CHARACTER_LENGTH)
{
context.AddFailure("NewPassword", $"Password must be at least {PasswordUtility.PASSWORD_MIN_CHARACTER_LENGTH} characters.");
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Raytha.Application/Login/Commands/CreateUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Validator(IRaythaDbContext db)
RuleFor(x => x.EmailAddress).NotEmpty().EmailAddress();
RuleFor(x => x).Custom((request, context) =>
{
if (request.Password.Length < PasswordUtility.PASSWORD_MIN_CHARACTER_LENGTH)
if (string.IsNullOrEmpty(request.Password) || request.Password.Length < PasswordUtility.PASSWORD_MIN_CHARACTER_LENGTH)
{
context.AddFailure("Password", $"Password must be at least {PasswordUtility.PASSWORD_MIN_CHARACTER_LENGTH} characters.");
return;
Expand Down
20 changes: 10 additions & 10 deletions src/Raytha.Application/Raytha.Application.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Raytha.Application</RootNamespace>
<AssemblyName>Raytha.Application</AssemblyName>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -18,15 +18,15 @@
<PackageReference Include="CsvExport" Version="2.0.0" />
<PackageReference Include="LumenWorksCsvReader2" Version="4.3.0" />
<PackageReference Include="MediatR" Version="11.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.4.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.25.1" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.0" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="7.0.0" />
<PackageReference Include="TimeZoneConverter" Version="6.0.1" />
<PackageReference Include="TimeZoneNames" Version="6.0.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.4.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.0.3" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.7" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="8.0.0" />
<PackageReference Include="TimeZoneConverter" Version="6.1.0" />
<PackageReference Include="TimeZoneNames" Version="6.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Raytha.Domain/Raytha.Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Raytha.Domain</RootNamespace>
<AssemblyName>Raytha.Domain</AssemblyName>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
10 changes: 5 additions & 5 deletions src/Raytha.Infrastructure/Raytha.Infrastructure.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Raytha.Infrastructure</RootNamespace>
<AssemblyName>Raytha.Infrastructure</AssemblyName>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -17,10 +17,10 @@
<PackageReference Include="AWSSDK.S3" Version="3.7.101.50" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.14.1" />
<PackageReference Include="Dapper.SqlBuilder" Version="2.0.78" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="6.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1" />
<PackageReference Include="Microsoft.OData.Core" Version="7.13.0" />
<PackageReference Include="Microsoft.AspNetCore.OData" Version="8.0.12" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Microsoft.OData.Core" Version="7.20.0" />
<PackageReference Include="Microsoft.AspNetCore.OData" Version="8.2.3" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 11 additions & 2 deletions src/Raytha.Infrastructure/Services/Emailer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public void SendEmail(EmailMessage message)
int smtpPort;
string smtpPassword;
string smtpUsername;
string smtpFromName;
string smtpFromAddress;
string smtpReplyToName;
string smtpReplyToAddress;
if (entity.SmtpOverrideSystem)
{
smtpHost = entity.SmtpHost;
Expand All @@ -40,6 +44,11 @@ public void SendEmail(EmailMessage message)
smtpPassword = _configuration["SMTP_PASSWORD"];
}

smtpFromAddress = _configuration["SMTP_FROM_ADDRESS"].IfNullOrEmpty(entity.SmtpDefaultFromAddress);
smtpFromName = _configuration["SMTP_FROM_NAME"].IfNullOrEmpty(entity.SmtpDefaultFromName);
smtpReplyToName = message.FromName.IfNullOrEmpty(entity.SmtpDefaultFromName);
smtpReplyToAddress = message.FromEmailAddress.IfNullOrEmpty(entity.SmtpDefaultFromAddress);

using (var smtpClient = new SmtpClient(smtpHost)
{
Port = smtpPort,
Expand All @@ -48,8 +57,8 @@ public void SendEmail(EmailMessage message)
})
{
var messageToSend = new MailMessage();
messageToSend.From = new MailAddress(message.FromEmailAddress.IfNullOrEmpty(entity.SmtpDefaultFromAddress),
message.FromName.IfNullOrEmpty(entity.SmtpDefaultFromName));
messageToSend.From = new MailAddress(smtpFromAddress, smtpFromName);
messageToSend.ReplyToList.Add(new MailAddress(smtpReplyToAddress, smtpReplyToName));

foreach (var to in message.To)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Raytha.Application.UserGroups.Queries;
using Raytha.Domain.Entities;
using Raytha.Domain.ValueObjects;
using Raytha.Web.Areas.Admin.Views.Roles;
using Raytha.Web.Areas.Admin.Views.Shared.ViewModels;
using Raytha.Web.Areas.Admin.Views.UserGroups;
using Raytha.Web.Filters;
Expand Down Expand Up @@ -90,7 +89,7 @@ public async Task<IActionResult> Edit(string id)
[Route(RAYTHA_ROUTE_PREFIX + "/users/groups/edit/{id}", Name = "usergroupsedit")]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(EditRole_ViewModel model, string id)
public async Task<IActionResult> Edit(EditUserGroup_ViewModel model, string id)
{
var input = new EditUserGroup.Command
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</div>
<hr/>
<h5>Default email settings</h5>
<p>When the platform sends emails out, the email will appear to come from the name and email address specified below. You will have the opportunity to override these settings on each individual email template.</p>
<p>When your platform sends emails, choose the name people see when they hit 'Reply' and the email where the replies will land. It helps control the conversation flow when recipients respond to your emails.</p>
<div class="col-lg-12">
<div class="mb-3">
<label class="form-label raytha-required" asp-for="SmtpDefaultFromName"></label>
Expand Down
4 changes: 1 addition & 3 deletions src/Raytha.Web/Areas/Admin/Views/Setup/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@
</div>
<hr />
<h5>Default email settings</h5>
<p>When the platform sends emails out, the email will appear to come from the name and email
address specified below. You will have the opportunity to override these settings on
each individual email template.</p>
<p>When your platform sends emails, choose the name people see when they hit 'Reply' and the email where the replies will land. It helps control the conversation flow when recipients respond to your emails.</p>
<div class="col-lg-12">
<div class="mb-3">
<label class="form-label raytha-required" asp-for="SmtpDefaultFromName"></label>
Expand Down
3 changes: 2 additions & 1 deletion src/Raytha.Web/Areas/Admin/Views/Shared/Error.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
@ViewData["ErrorMessage"]
</div>
}
</div>
</div>
</div>
</div>
</section>
</section>
3 changes: 2 additions & 1 deletion src/Raytha.Web/Areas/Admin/Views/Shared/Forbidden.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
@ViewData["ErrorMessage"]
</div>
}
</div>
</div>
</div>
</div>
</section>
</section>
4 changes: 2 additions & 2 deletions src/Raytha.Web/Areas/Admin/Views/Templates/Email/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarSupportedContent">
<form class="d-flex" asp-action="EmailTemplatesIndex" method="get">
<form class="d-flex" asp-route="EmailTemplatesIndex" method="get">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search" name="search" value="@Model.Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
Expand Down Expand Up @@ -106,4 +106,4 @@
<partial name="_TablePagination" model="@Model" />
</div>
</div>
</div>
</div>
3 changes: 2 additions & 1 deletion src/Raytha.Web/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//Force build and push
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
Expand All @@ -18,4 +19,4 @@ public static void Main(string[] args)
{
webBuilder.UseStartup<Startup>();
});
}
}
26 changes: 14 additions & 12 deletions src/Raytha.Web/Raytha.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>7e3df06b-f996-4ba5-8631-62cd855692f8</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<Configurations>Debug;Release;Debug without JS</Configurations>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EFCore.BulkExtensions" Version="6.6.5" />
<PackageReference Include="EFCore.BulkExtensions" Version="8.0.0" />
<PackageReference Include="MediatR" Version="11.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.9" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="6.0.13" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.4.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.1">
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.1.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.3.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Fluid.Core" Version="2.3.1" />
<PackageReference Include="Fluid.ViewEngine" Version="2.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="Fluid.Core" Version="2.5.0" />
<PackageReference Include="Fluid.ViewEngine" Version="2.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.Core" Version="5.6.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>
Expand Down Expand Up @@ -84,7 +86,7 @@
</ItemGroup>
</Target>

<Target Name="BuildJsAppDebug" BeforeTargets="BeforeBuild" DependsOnTargets="RestoreNpmPackages" Inputs="@(JsApplicationSourceFiles)" Outputs="$(JsApplicationBundleFile)" Condition="'$(Configuration)' == 'Debug'">
<Target Name="BuildJsAppDebug" BeforeTargets="BeforeBuild" DependsOnTargets="RestoreNpmPackages" Inputs="@(JsApplicationSourceFiles)" Outputs="$(JsApplicationBundleFile)" Condition="'$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Release'">
<Message Importance="high" Text="Building javascript application..." />
<Exec WorkingDirectory="$(JsApplicationRoot)" Command="npm run build" />
</Target>
Expand Down
2 changes: 1 addition & 1 deletion src/Raytha.Web/Services/CurrentVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ namespace Raytha.Web.Services;

public class CurrentVersion : ICurrentVersion
{
public string Version => "1.1.3";
public string Version => "1.1.4";
}
2 changes: 2 additions & 0 deletions src/Raytha.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"SMTP_PORT": 25,
"SMTP_USERNAME": "",
"SMTP_PASSWORD": "",
"SMTP_FROM_NAME": "", //optional, if you want to always use this value regardless of what is specified in org settings.
"SMTP_FROM_ADDRESS": "", //optional, if you want to always use this value regardless of what is specified in org settings.

//File storage settings
//Local storage should only be used for low traffic sites with small files (< 20 mb)
Expand Down
3 changes: 3 additions & 0 deletions src/Raytha.Web/wwwroot/raytha_admin/js/dist/288.main.js

Large diffs are not rendered by default.