From 367dfd104a399a1b0c34e684b2aabd9847c03a24 Mon Sep 17 00:00:00 2001 From: sumeyyeKurtulus Date: Tue, 19 Nov 2024 11:58:59 +0300 Subject: [PATCH 01/11] update: `theme-shared` package for preventing possible injection context errors --- .../src/lib/services/abstract-menu.service.ts | 8 ++++++-- .../theme-shared/src/lib/services/toaster.service.ts | 9 ++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/services/abstract-menu.service.ts b/npm/ng-packs/packages/theme-shared/src/lib/services/abstract-menu.service.ts index 4c3137b332..1af504f0ee 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/services/abstract-menu.service.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/services/abstract-menu.service.ts @@ -1,12 +1,12 @@ import { BehaviorSubject, Observable } from 'rxjs'; import { NavItem } from '../models/nav-item'; import { inject, Type } from '@angular/core'; -import { SORT_COMPARE_FUNC } from '@abp/ng.core'; +import { SORT_COMPARE_FUNC, SortableItem } from '@abp/ng.core'; export abstract class AbstractMenuService { protected abstract baseClass: Type; - protected readonly sortFn = inject(SORT_COMPARE_FUNC); + protected readonly sortFn: (a: SortableItem, b: SortableItem) => number; protected _items$ = new BehaviorSubject([]); @@ -18,6 +18,10 @@ export abstract class AbstractMenuService { return this._items$.asObservable(); } + constructor() { + this.sortFn = inject(SORT_COMPARE_FUNC); + } + addItems(newItems: T[]) { const items = [...this.items]; newItems.forEach(item => { diff --git a/npm/ng-packs/packages/theme-shared/src/lib/services/toaster.service.ts b/npm/ng-packs/packages/theme-shared/src/lib/services/toaster.service.ts index 9b45be4d1b..7b5496d879 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/services/toaster.service.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/services/toaster.service.ts @@ -4,7 +4,7 @@ import { PROJECTION_STRATEGY, Strict, } from '@abp/ng.core'; -import { ComponentRef, Injectable } from '@angular/core'; +import { ComponentRef, inject, Injectable } from '@angular/core'; import { ReplaySubject } from 'rxjs'; import { ToastContainerComponent } from '../components/toast-container/toast-container.component'; import { Toaster } from '../models'; @@ -20,8 +20,7 @@ export class ToasterService implements ToasterContract { private toasts = [] as Toaster.Toast[]; private containerComponentRef!: ComponentRef; - - constructor(private contentProjectionService: ContentProjectionService) {} + private contentProjectionService: ContentProjectionService; private setContainer() { this.containerComponentRef = this.contentProjectionService.projectContent( @@ -34,6 +33,10 @@ export class ToasterService implements ToasterContract { this.containerComponentRef.changeDetectorRef.detectChanges(); } + constructor() { + this.contentProjectionService = inject(ContentProjectionService); + } + /** * Creates an info toast with given parameters. * @param message Content of the toast From 68714ffe5af7663532b9ab14456fc4c303e00cb0 Mon Sep 17 00:00:00 2001 From: sumeyyeKurtulus Date: Tue, 19 Nov 2024 12:00:14 +0300 Subject: [PATCH 02/11] update: `components` package for preventing possible null `firstCreatePass` error --- npm/ng-packs/packages/components/page/src/page.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/components/page/src/page.component.ts b/npm/ng-packs/packages/components/page/src/page.component.ts index d0a48b145c..06a8e3af6d 100644 --- a/npm/ng-packs/packages/components/page/src/page.component.ts +++ b/npm/ng-packs/packages/components/page/src/page.component.ts @@ -45,7 +45,8 @@ export class PageComponent { this.breadcrumb || this.customTitle || this.customBreadcrumb || - this.customToolbar + this.customToolbar || + this.pageParts ); } } From c035e6a061ef11b514084f3aa26a565accc59cbc Mon Sep 17 00:00:00 2001 From: Volosoft Agent <43883821+voloagent@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:03:24 +0300 Subject: [PATCH 03/11] Update latest-versions.json to version 9.0.0 --- latest-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latest-versions.json b/latest-versions.json index fa2c98b342..b99c7202b6 100644 --- a/latest-versions.json +++ b/latest-versions.json @@ -1,6 +1,6 @@ [ { - "version": "8.3.3", + "version": "9.0.0", "releaseDate": "", "type": "stable", "message": "" From c31add4e085b9ad91a520bf1d5464d73b25d5d1c Mon Sep 17 00:00:00 2001 From: Fahri Gedik Date: Tue, 19 Nov 2024 15:32:59 +0300 Subject: [PATCH 04/11] Update en.json --- .../AbpIoLocalization/Admin/Localization/Resources/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json index 22cfb792b5..204aced00a 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json @@ -512,6 +512,7 @@ "QuotationTemplate.BankAccount": "Our bank account information can be found at {0}", "Permission:Raffles": "Raffle", "Permission:Draw": "Draw", + "Permission:ExportAttendeesAsExcel": "Export at attendees as Excel", "Menu:Raffles": "Raffles", "RaffleIsNotDrawable": "Raffle is not drawable", "WinnerCountMustBeGreaterThanZero": "Winner count must be greater than zero", From 3cb350cfd0e7eb4a51a07a4293e3d526d0962283 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 21 Nov 2024 14:29:05 +0800 Subject: [PATCH 05/11] Add `Forwarded Headers` to `deployment` document. --- docs/en/deployment/forwarded-headers.md | 84 +++++++++++++++++++++++++ docs/en/deployment/index.md | 1 + 2 files changed, 85 insertions(+) create mode 100644 docs/en/deployment/forwarded-headers.md diff --git a/docs/en/deployment/forwarded-headers.md b/docs/en/deployment/forwarded-headers.md new file mode 100644 index 0000000000..b6b74205c3 --- /dev/null +++ b/docs/en/deployment/forwarded-headers.md @@ -0,0 +1,84 @@ +# Forwarded Headers + +Reverse proxies and load balancers play a crucial role in modern web application architectures. When an application is deployed behind these proxies and load balancers, several specific issues can arise. This document will discuss these issues in detail, explain how ASP.NET Core's forwarded headers middleware can address them, and provide a code example for configuring forwarded headers in an ABP application. + +## Possible problem in a Reverse Proxy Environment + +When requests pass through a reverse proxy or load balancer, the following common issues can occur: + +### 1. Loss of Original Request Information + +A reverse proxy or load balancer typically modifies the original HTTP request headers. For example, the proxy may replace the client's `X-Forwarded-For` header, or the `Host` header might be set to the proxy's address. This can result in the backend application being unable to directly access the client's IP address, the true hostname, and the protocol used. + +### 2. HTTPS vs HTTP Protocol Confusion + +When a request is forwarded by a proxy server, it is often upgraded to HTTPS to ensure secure transmission. The proxy server will send a header like `X-Forwarded-Proto` to indicate whether the original request was HTTP or HTTPS. If the backend application does not correctly handle this header, it may generate URLs with the wrong protocol. + +### 3. Path Handling Issues + +Since load balancers and proxies might modify or map the request URL paths differently, the backend application could encounter path inconsistencies. For example, a reverse proxy might forward a request from `/api` to `/myapp/api`. If the backend application is not correctly configured, path parsing errors may occur. + +### 4. IP Address and Security + +Reverse proxies might replace the original client IP address with their own, which can affect logging, authentication, and access control mechanisms. To retrieve the actual client IP address, the `X-Forwarded-For` header must be correctly parsed and trusted. + +### 5. Load Balancer Impact + +Load balancers might distribute requests to different backend servers using different algorithms. This can create session affinity problems. If session data is stored on a single server and the load balancer directs subsequent requests to different servers, session loss or inconsistency may occur. + +## Forwarded Headers Middleware in ABP web application + +To resolve the above issues, ASP.NET Core provides a built-in middleware, `ForwardedHeadersMiddleware`, which processes the headers forwarded by reverse proxies. This middleware helps the application recover the correct original request information, such as the client’s IP address, protocol, and host. + +### Configuring `ForwardedHeadersMiddleware` + +ASP.NET Core’s `ForwardedHeadersMiddleware` supports several HTTP headers: + +- **X-Forwarded-For**: Contains the original client’s IP address. +- **X-Forwarded-Proto**: Indicates whether the original request was HTTP or HTTPS. +- **X-Forwarded-Host**: Contains the original host requested by the client. +- **X-Forwarded-Port**: Indicates the original port of the request. + +To configure this middleware: + +1. In the `ConfigureServices` method of your module, configure the `ForwardedHeadersOptions`: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.Configure(options => + { + options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; + }); +} +``` + +2. In the `OnApplicationInitialization` method of your module, add the middleware: + +> Forwarded Headers Middleware should run before other middleware. This ordering ensures that the middleware relying on forwarded headers information can consume the header values for processing. Forwarded Headers Middleware can run after diagnostics and error handling, but it must be run before calling UseHsts: + +```csharp +public override void OnApplicationInitialization(ApplicationInitializationContext context) +{ + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + app.UseForwardedHeaders(); + } + else + { + app.UseErrorPage(); + app.UseForwardedHeaders(); + app.UseHsts(); + } + + // Other middleware configurations... +} +``` + +## References + +- [ASP.NET Core Proxy and Load Balancer Configuration](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-9.0) diff --git a/docs/en/deployment/index.md b/docs/en/deployment/index.md index 3537e4593e..245c8bdaf0 100644 --- a/docs/en/deployment/index.md +++ b/docs/en/deployment/index.md @@ -12,3 +12,4 @@ However, there are some topics that you should care about when you are deploying * [Optimization for Production](./optimizing-production.md): Tips and suggestions for optimizing your application in production environments. * [Deploying to a Clustered Environment](./clustered-environment.md): Explains how to configure your application when you want to run multiple instances of your application concurrently. * [Deploying Distributed / Microservice Solutions](./distributed-microservice.md): Deployment notes for solutions consisting of multiple applications and/or services. +* [Forwarded Headers](./forwarded-headers): Explains how to configure the application to trust headers forwarded by reverse proxies and recover the original request information from the `X-Forwarded-For` and `X-Forwarded-Proto` headers. \ No newline at end of file From a0acc006b0050fffc8b1a253d095f5c635f895e7 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 21 Nov 2024 13:47:16 +0300 Subject: [PATCH 06/11] Added `Using Existing Configuration` section to new command samples resolves https://github.com/volosoft/abp-studio/issues/1051 --- docs/en/cli/new-command-samples.md | 73 ++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/docs/en/cli/new-command-samples.md b/docs/en/cli/new-command-samples.md index 6b168b538c..14cbcb8a27 100644 --- a/docs/en/cli/new-command-samples.md +++ b/docs/en/cli/new-command-samples.md @@ -221,6 +221,79 @@ As seen below, ABP libraries are local project references. ``` +## Using Existing Configuration + +If you want to programmaticaly create solutions, you can use an existing configuration instead of passing parameters to CLI one by one. ABP Studio keeps the solution creation history locally in `(UserProfile)\.abp\studio\solution-creation-history.json` file, there you can find the configurations of the solutions in your machine. + +### Using a Solution Id + +In `*.abpsln` file of the solutions, there is an ID field that you can use to recreate a solution. To do this, pass the id to cli using `-shi or --solution-history-id` parameters. + +```bash +abp new -shi dbb1afa9-190e-419a-842d-2780bb1bad1f +abp new -shi dbb1afa9-190e-419a-842d-2780bb1bad1f -o D:\test\Acme.BookStore +``` + +### Using a JSON Configuration File + +You can also use a configuration file to create solutions. You need to use `-rcp or ready-config-path` parameters to do that. + +```bash +abp new -rcp MyTests\config.json +abp new -rcp D:\MyTests\config.json +abp new -rcp D:\MyTests\config.json -o D:\test\Acme.BookStore +``` + +To prepare a config file, you can check the records in `solution-creation-history.json` file mentioned above. An example config file would look like that: + +```json +{ + "solutionName": { + "fullName": "Acme.BookStore", + "companyName": "Acme", + "projectName": "BookStore" + }, + "pro": true, + "useOpenSourceTemplate": false, + "booksSample": false, + "databaseProvider": "ef", + "createInitialMigration": true, + "runDbMigrator": true, + "uiFramework": "angular", + "theme": "leptonx", + "themeStyle": "system", + "mobileFramework": "none", + "databaseManagementSystem": "sqlserver", + "databaseManagementSystemBuilderExtensionMethod": "UseSqlServer", + "connectionString": "Server=(LocalDb)\\\\MSSQLLocalDB;Database=AbpSoludegdf;Trusted_Connection=True;TrustServerCertificate=true", + "mauiBlazorApplicationIdGuid": "d3499a09-f3d4-4bb7-9d58-4c7b1caee331", + "tiered": false, + "publicWebsite": false, + "cmskit": false, + "openIddictAdmin": true, + "languageManagement": true, + "textTemplateManagement": true, + "multiTenancy": true, + "auditLogging": false, + "gdpr": true, + "chat": false, + "fileManagement": false, + "socialLogins": true, + "includeTests": true, + "distributedEventBus": "none", + "publicRedis": false, + "separateTenantSchema": false, + "progressiveWebApp": false, + "runProgressiveWebAppSupport": false, + "runInstallLibs": false, + "runBundling": false, + "kubernetesConfiguration": true, + "templateName": "app" + } +``` + + + ## See Also * [ABP CLI documentation](../cli/index.md) From d14fa938bb34bb0613d0f80c15b6c256052f98d5 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 21 Nov 2024 13:48:12 +0300 Subject: [PATCH 07/11] Update new-command-samples.md --- docs/en/cli/new-command-samples.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/cli/new-command-samples.md b/docs/en/cli/new-command-samples.md index 14cbcb8a27..a8d469b10b 100644 --- a/docs/en/cli/new-command-samples.md +++ b/docs/en/cli/new-command-samples.md @@ -223,7 +223,7 @@ As seen below, ABP libraries are local project references. ## Using Existing Configuration -If you want to programmaticaly create solutions, you can use an existing configuration instead of passing parameters to CLI one by one. ABP Studio keeps the solution creation history locally in `(UserProfile)\.abp\studio\solution-creation-history.json` file, there you can find the configurations of the solutions in your machine. +If you want to programmaticaly create solutions, you can use an existing configuration instead of passing parameters to CLI one by one. ABP Studio keeps the solution creation history locally in `(UserProfile)\.abp\studio\solution-creation-history.json` file, there you can find the configurations of the solutions created in your machine. ### Using a Solution Id @@ -265,7 +265,7 @@ To prepare a config file, you can check the records in `solution-creation-histor "mobileFramework": "none", "databaseManagementSystem": "sqlserver", "databaseManagementSystemBuilderExtensionMethod": "UseSqlServer", - "connectionString": "Server=(LocalDb)\\\\MSSQLLocalDB;Database=AbpSoludegdf;Trusted_Connection=True;TrustServerCertificate=true", + "connectionString": "Server=(LocalDb)\\\\MSSQLLocalDB;Database=BookStore;Trusted_Connection=True;TrustServerCertificate=true", "mauiBlazorApplicationIdGuid": "d3499a09-f3d4-4bb7-9d58-4c7b1caee331", "tiered": false, "publicWebsite": false, From 8771a540bf702ea75e538ca2c19b930e1fc0a126 Mon Sep 17 00:00:00 2001 From: Fahri Gedik Date: Thu, 21 Nov 2024 15:15:28 +0300 Subject: [PATCH 08/11] add localization. --- .../AbpIoLocalization/Admin/Localization/Resources/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json index 22cfb792b5..802293fe50 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json @@ -658,6 +658,7 @@ "DrawModal": "Private draw on the modal", "SetAsDrawable": "Set as drawable", "SetAsNoDrawable": "Set as non-drawable", + "SetAsCompleted": "Set as completed", "RemoveAllWinners": "Remove all winners", "EditWinners": "Edit winners", "EditAttendees": "Edit attendees", From a355220e28d2ea652a3d2d921e843a082a5ab78c Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Thu, 21 Nov 2024 17:15:24 +0300 Subject: [PATCH 09/11] Update studio docs for v0.9.10 --- docs/en/studio/release-notes.md | 13 +++++++++++++ docs/en/studio/version-mapping.md | 1 + 2 files changed, 14 insertions(+) diff --git a/docs/en/studio/release-notes.md b/docs/en/studio/release-notes.md index 5937a556ed..a8d7ea3581 100644 --- a/docs/en/studio/release-notes.md +++ b/docs/en/studio/release-notes.md @@ -2,6 +2,19 @@ This document contains **brief release notes** for each ABP Studio release. Release notes only include **major features** and **visible enhancements**. Therefore, they don't include all the development done in the related version. +## 0.9.10 (2024-11-21) + +* Added shortcut for Build & Start operation (CTRL + Click) +* Fixed extension loading loop problem in v0.9.9 +* Fixed MAUI template for android + +## 0.9.9 (2024-11-21) + +> Recommended to use v0.9.10 for .NET 9. + +* Upgraded templates to .NET 9 +* Fixed blazor wasm bundle problem in microservice template + ## 0.9.8 (2024-11-20) * Upgraded templates to version `8.3.4` diff --git a/docs/en/studio/version-mapping.md b/docs/en/studio/version-mapping.md index 63c6bd7f0f..3398260053 100644 --- a/docs/en/studio/version-mapping.md +++ b/docs/en/studio/version-mapping.md @@ -4,6 +4,7 @@ This document provides a general overview of the relationship between various ve | **ABP Studio Version** | **ABP Version of Startup Template** | |------------------------|---------------------------| +| 0.9.9 - 0.9.10 | 9.0.0 | | 0.9.8 | 8.3.4 | | 0.9.5 to 0.9.7 | 8.3.3 | | 0.9.2 to 0.9.4 | 8.3.2 | From b9490bc659ad4d51614656a8598522aaa141b653 Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Thu, 21 Nov 2024 18:36:42 +0300 Subject: [PATCH 10/11] Update studio docs for v0.9.11 --- docs/en/studio/release-notes.md | 8 +++++++- docs/en/studio/version-mapping.md | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/en/studio/release-notes.md b/docs/en/studio/release-notes.md index a8d7ea3581..ed828a5141 100644 --- a/docs/en/studio/release-notes.md +++ b/docs/en/studio/release-notes.md @@ -2,15 +2,21 @@ This document contains **brief release notes** for each ABP Studio release. Release notes only include **major features** and **visible enhancements**. Therefore, they don't include all the development done in the related version. +## 0.9.11 (2024-11-21) + +* Fixed the extension loading problem occured in v0.9.9 & v0.9.10. + ## 0.9.10 (2024-11-21) +> Recommended to use v0.9.11+ for .NET 9. + * Added shortcut for Build & Start operation (CTRL + Click) * Fixed extension loading loop problem in v0.9.9 * Fixed MAUI template for android ## 0.9.9 (2024-11-21) -> Recommended to use v0.9.10 for .NET 9. +> Recommended to use v0.9.11+ for .NET 9. * Upgraded templates to .NET 9 * Fixed blazor wasm bundle problem in microservice template diff --git a/docs/en/studio/version-mapping.md b/docs/en/studio/version-mapping.md index 3398260053..c00b09ee95 100644 --- a/docs/en/studio/version-mapping.md +++ b/docs/en/studio/version-mapping.md @@ -4,7 +4,7 @@ This document provides a general overview of the relationship between various ve | **ABP Studio Version** | **ABP Version of Startup Template** | |------------------------|---------------------------| -| 0.9.9 - 0.9.10 | 9.0.0 | +| 0.9.9 to 0.9.11 | 9.0.0 | | 0.9.8 | 8.3.4 | | 0.9.5 to 0.9.7 | 8.3.3 | | 0.9.2 to 0.9.4 | 8.3.2 | From dbcce7840bed28cd984fbfeffd59784cbb476261 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 22 Nov 2024 10:26:39 +0300 Subject: [PATCH 11/11] Added Build & Start hint to running applications document --- docs/en/studio/running-applications.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/studio/running-applications.md b/docs/en/studio/running-applications.md index a41f15207d..a4dc4f8388 100644 --- a/docs/en/studio/running-applications.md +++ b/docs/en/studio/running-applications.md @@ -187,6 +187,8 @@ We have several options in C# applications. Those options are `Start`(If the app > When *Watch* is enable you should see an *eye* icon next to the application name. +> Hint: Performing CTRL+Click on the start icon left to a stopped C# application equals to `Build & Start` command. Same applies for folders. + ![csharp-application-context-menu-run-connection](images/solution-runner/csharp-application-context-menu-run-connection.png) ### Build