Compare commits

...

10 Commits

Author SHA1 Message Date
khwezi fbde2ea1a9 Merge pull request 'Updated handling of fowarded header and fixed base64 encoding of certificate' (#81) from cart into main
Reviewed-on: #81
2026-06-14 22:56:51 +02:00
Khwezi Mngoma d323bd866c Updated handling of fowarded header and fixed base64 encoding of certificate
continuous-integration/drone/pr Build is passing
2026-06-14 22:56:23 +02:00
khwezi 651682156c Merge pull request 'Moved kerstel definition to the service defitniton section' (#80) from cart into main
Reviewed-on: #80
2026-06-14 18:02:28 +02:00
Khwezi Mngoma a6a41eaeac Moved kerstel definition to the service defitniton section
continuous-integration/drone/pr Build is failing
2026-06-14 18:01:42 +02:00
khwezi e81789f8c6 Merge pull request 'Refactore the entire k8s manifest for pure https routing' (#79) from cart into main
Reviewed-on: #79
2026-06-14 17:49:17 +02:00
Khwezi Mngoma 17a74ca750 Refactore the entire k8s manifest for pure https routing
continuous-integration/drone/pr Build is failing
2026-06-14 17:48:39 +02:00
khwezi b9f3274633 Merge pull request 'Update cookie policies' (#78) from cart into main
Reviewed-on: #78
2026-06-14 13:16:05 +02:00
Khwezi Mngoma 53b3018d9e Update cookie policies
continuous-integration/drone/pr Build is passing
2026-06-14 13:15:30 +02:00
khwezi 552e9ff1b4 Merge pull request 'Updated cookie policies' (#77) from cart into main
Reviewed-on: #77
2026-06-14 12:56:36 +02:00
Khwezi Mngoma 8002920a07 Updated cookie policies
continuous-integration/drone/pr Build is passing
2026-06-14 12:56:09 +02:00
4 changed files with 48 additions and 18 deletions
+2 -2
View File
@@ -18,13 +18,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="LiteCharms.Features" Version="1.130.0" /> <PackageReference Include="LiteCharms.Features" Version="1.133.0" />
</ItemGroup> </ItemGroup>
<!-- UI --> <!-- UI -->
<ItemGroup> <ItemGroup>
<PackageReference Include="ANM.Blazored.Toast" Version="0.1.1" /> <PackageReference Include="ANM.Blazored.Toast" Version="0.1.1" />
<PackageReference Include="LiteCharms.Features.MidrandBooks" Version="1.130.0" /> <PackageReference Include="LiteCharms.Features.MidrandBooks" Version="1.133.0" />
<!-- Global Usings --> <!-- Global Usings -->
<Using Include="Blazored.Toast.Services" /> <Using Include="Blazored.Toast.Services" />
+21
View File
@@ -4,6 +4,7 @@ using LiteCharms.Features.MidrandBooks.Extensions;
using LiteCharms.Features.MidrandBooks.Payments; using LiteCharms.Features.MidrandBooks.Payments;
using LiteCharms.Features.Postgres; using LiteCharms.Features.Postgres;
using MidrandBookshop.Components; using MidrandBookshop.Components;
using System.Security.Cryptography.X509Certificates;
using static LiteCharms.Features.Extensions.Quartz; using static LiteCharms.Features.Extensions.Quartz;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@@ -47,9 +48,29 @@ builder.Services.Configure<ForwardedHeadersOptions>(options =>
options.KnownProxies.Clear(); options.KnownProxies.Clear();
}); });
builder.WebHost.ConfigureKestrel(options =>
{
var certBase64 = builder.Configuration["DataProtection:Certificate"];
var certPassword = builder.Configuration["DataProtection:Password"];
if (!string.IsNullOrWhiteSpace(certBase64))
{
var rawBytes = Convert.FromBase64String(certBase64);
var kestrelCert = X509CertificateLoader.LoadPkcs12(rawBytes, certPassword);
options.ListenAnyIP(8443, listenOptions =>
{
listenOptions.UseHttps(kestrelCert);
});
}
else
options.ListenAnyIP(8080);
});
var app = builder.Build(); var app = builder.Build();
app.UseForwardedHeaders(); app.UseForwardedHeaders();
app.UseCookiePolicy();
using var security = app.Services.CreateScope(); using var security = app.Services.CreateScope();
{ {
@@ -14,7 +14,7 @@
"commandName": "Project", "commandName": "Project",
"dotnetRunMessages": true, "dotnetRunMessages": true,
"launchBrowser": false, "launchBrowser": false,
"applicationUrl": "https://localhost:7021;http://localhost:5053", "applicationUrl": "https://localhost:8440;http://localhost:8083",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
+24 -15
View File
@@ -10,8 +10,8 @@ metadata:
name: midrandbooks-config name: midrandbooks-config
namespace: midrandbooks-uat namespace: midrandbooks-uat
data: data:
ASPNETCORE_ENVIRONMENT: "Development" ASPNETCORE_ENVIRONMENT: "Development"
ASPNETCORE_URLS: "http://0.0.0.0:8080" ASPNETCORE_URLS: "https://0.0.0.0:8443"
Monitoring__Address: "http://aspire-dashboard-service.aspire.svc.cluster.local:18889" Monitoring__Address: "http://aspire-dashboard-service.aspire.svc.cluster.local:18889"
Monitoring__ServiceName: "MidrandBooks.Uat" Monitoring__ServiceName: "MidrandBooks.Uat"
HasherSettings__MinHashLength: "11" HasherSettings__MinHashLength: "11"
@@ -27,7 +27,6 @@ data:
PayfastSettings__ValidHosts__4: "payment.payfast.io" PayfastSettings__ValidHosts__4: "payment.payfast.io"
LiteCharmsSettings__Authority: "https://sts.security.khongisa.co.za" LiteCharmsSettings__Authority: "https://sts.security.khongisa.co.za"
LiteCharmsSettings__Audience: "midrandbooks-api" LiteCharmsSettings__Audience: "midrandbooks-api"
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
LiteCharmsClientSettings__Authority: "https://sts.security.khongisa.co.za" LiteCharmsClientSettings__Authority: "https://sts.security.khongisa.co.za"
LiteCharmsClientSettings__GrantType: "client_credentials" LiteCharmsClientSettings__GrantType: "client_credentials"
LiteCharmsClientSettings__Scope: "midrandbooks-api" LiteCharmsClientSettings__Scope: "midrandbooks-api"
@@ -74,7 +73,7 @@ metadata:
name: midrandbooks name: midrandbooks
namespace: midrandbooks-uat namespace: midrandbooks-uat
spec: spec:
replicas: 2 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: midrandbooks app: midrandbooks
@@ -102,7 +101,7 @@ spec:
memory: "256Mi" memory: "256Mi"
cpu: "100m" cpu: "100m"
ports: ports:
- containerPort: 8080 - containerPort: 8443
envFrom: envFrom:
- configMapRef: - configMapRef:
name: midrandbooks-config name: midrandbooks-config
@@ -194,13 +193,15 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /health path: /health
port: 8080 port: 8443
scheme: HTTPS
initialDelaySeconds: 5 initialDelaySeconds: 5
periodSeconds: 10 periodSeconds: 10
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /health path: /health
port: 8080 port: 8443
scheme: HTTPS
initialDelaySeconds: 3 initialDelaySeconds: 3
periodSeconds: 5 periodSeconds: 5
volumes: volumes:
@@ -214,14 +215,20 @@ metadata:
name: midrandbooks-service name: midrandbooks-service
namespace: midrandbooks-uat namespace: midrandbooks-uat
spec: spec:
type: ClusterIP ports:
- name: https
port: 443
targetPort: 8443
selector: selector:
app: midrandbooks app: midrandbooks
ports: ---
- name: http apiVersion: traefik.io/v1alpha1
protocol: TCP kind: ServersTransport
port: 80 metadata:
targetPort: 8080 name: midrandbooks-bypass-backend-validation
namespace: midrandbooks-uat
spec:
insecureSkipVerify: true
--- ---
apiVersion: traefik.io/v1alpha1 apiVersion: traefik.io/v1alpha1
kind: IngressRoute kind: IngressRoute
@@ -236,10 +243,12 @@ spec:
kind: Rule kind: Rule
services: services:
- name: midrandbooks-service - name: midrandbooks-service
port: 80 port: 443
scheme: https
serversTransport: midrandbooks-bypass-backend-validation
sticky: sticky:
cookie: cookie:
name: "lp-sticky-session" name: "lp-sticky-session"
httpOnly: true httpOnly: true
secure: true secure: true
tls: {} tls: {}