From 2070b248b874fe9647c54418072940d5db461884 Mon Sep 17 00:00:00 2001 From: "Matthew Parker [SSW]" <61717342+MattParkerDev@users.noreply.github.com> Date: Mon, 22 May 2023 13:30:25 +1000 Subject: [PATCH 01/11] Update workflow --- .github/workflows/ssw-rulesgpt-stage.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ssw-rulesgpt-stage.yml b/.github/workflows/ssw-rulesgpt-stage.yml index bf40529..87562e9 100644 --- a/.github/workflows/ssw-rulesgpt-stage.yml +++ b/.github/workflows/ssw-rulesgpt-stage.yml @@ -36,11 +36,11 @@ jobs: - name: dotnet publish WebUI run: dotnet publish ./src/WebUI -c Release --property PublishDir=${{env.DOTNET_ROOT}}/myapp/webui -# TODO: Build and run unit tests + # TODO: Build and run unit tests -# Changes the base-tag in index.html from '/' to 'rulesgpt' to match SSW subdirectory -# - name: Change base-tag in index.html from / to rulesgpt -# run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html + # Changes the base-tag in index.html from '/' to 'rulesgpt' to match SSW subdirectory + - name: Change base-tag in index.html from / to /rulesgpt/ + run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html - name: Upload API artifact for deployment job uses: actions/upload-artifact@v3.1.2 From 0c90f6e8a48f906a8af94ce084a955a49c72cf59 Mon Sep 17 00:00:00 2001 From: "Matthew Parker [SSW]" <61717342+MattParkerDev@users.noreply.github.com> Date: Tue, 23 May 2023 12:07:07 +1000 Subject: [PATCH 02/11] comment out lottie player --- src/WebUI/wwwroot/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebUI/wwwroot/index.html b/src/WebUI/wwwroot/index.html index 7e5778f..6b6b50f 100644 --- a/src/WebUI/wwwroot/index.html +++ b/src/WebUI/wwwroot/index.html @@ -53,7 +53,7 @@
- +
From cfd8a80da0fa721eb854df3a37021351986d542d Mon Sep 17 00:00:00 2001 From: "Matthew Parker [SSW]" <61717342+MattParkerDev@users.noreply.github.com> Date: Tue, 23 May 2023 12:30:13 +1000 Subject: [PATCH 03/11] Remove basehref --- .github/workflows/ssw-rulesgpt-stage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ssw-rulesgpt-stage.yml b/.github/workflows/ssw-rulesgpt-stage.yml index 87562e9..842d91a 100644 --- a/.github/workflows/ssw-rulesgpt-stage.yml +++ b/.github/workflows/ssw-rulesgpt-stage.yml @@ -39,8 +39,8 @@ jobs: # TODO: Build and run unit tests # Changes the base-tag in index.html from '/' to 'rulesgpt' to match SSW subdirectory - - name: Change base-tag in index.html from / to /rulesgpt/ - run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html + #- name: Change base-tag in index.html from / to /rulesgpt/ + # run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html - name: Upload API artifact for deployment job uses: actions/upload-artifact@v3.1.2 From e2bffe618548536c69bf4cf4ef664983aee0d4d6 Mon Sep 17 00:00:00 2001 From: "Matthew Parker [SSW]" <61717342+MattParkerDev@users.noreply.github.com> Date: Tue, 23 May 2023 13:08:58 +1000 Subject: [PATCH 04/11] Update workflow --- .github/workflows/ssw-rulesgpt-prod.yml | 6 +++--- .github/workflows/ssw-rulesgpt-stage.yml | 6 +++--- src/WebUI/SignalRClient.cs | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ssw-rulesgpt-prod.yml b/.github/workflows/ssw-rulesgpt-prod.yml index 62e34a7..f3dc565 100644 --- a/.github/workflows/ssw-rulesgpt-prod.yml +++ b/.github/workflows/ssw-rulesgpt-prod.yml @@ -38,9 +38,9 @@ jobs: run: dotnet publish ./src/WebUI -c Release --property PublishDir=${{env.DOTNET_ROOT}}/myapp/webui # TODO: Build and run unit tests - # Changes the base-tag in index.html from '/' to 'rulesgpt' to match SSW subdirectory - # - name: Change base-tag in index.html from / to rulesgpt - # run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html + # Changes the base-tag in index.html from '/' to '/rulesgpt/' to match SSW subdirectory + - name: Change base-tag in index.html from / to /rulesgpt/ + run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html - name: Upload API artifact for deployment job uses: actions/upload-artifact@v3.1.2 diff --git a/.github/workflows/ssw-rulesgpt-stage.yml b/.github/workflows/ssw-rulesgpt-stage.yml index 842d91a..6bc677d 100644 --- a/.github/workflows/ssw-rulesgpt-stage.yml +++ b/.github/workflows/ssw-rulesgpt-stage.yml @@ -38,9 +38,9 @@ jobs: run: dotnet publish ./src/WebUI -c Release --property PublishDir=${{env.DOTNET_ROOT}}/myapp/webui # TODO: Build and run unit tests - # Changes the base-tag in index.html from '/' to 'rulesgpt' to match SSW subdirectory - #- name: Change base-tag in index.html from / to /rulesgpt/ - # run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html + # Changes the base-tag in index.html from '/' to '/rulesgpt/' to match SSW subdirectory + - name: Change base-tag in index.html from / to /rulesgpt/ + run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html - name: Upload API artifact for deployment job uses: actions/upload-artifact@v3.1.2 diff --git a/src/WebUI/SignalRClient.cs b/src/WebUI/SignalRClient.cs index 935f8f2..abfd149 100644 --- a/src/WebUI/SignalRClient.cs +++ b/src/WebUI/SignalRClient.cs @@ -17,8 +17,9 @@ public class SignalRClient public SignalRClient( DataState dataState, IWebAssemblyHostEnvironment hostEnvironment, - NotifierService notifierService, - ILogger logger) + NotifierService notifierService, + ILogger logger + ) { _dataState = dataState; _notifierService = notifierService; @@ -33,7 +34,7 @@ public SignalRClient( { if (exception != null) { - _logger.LogInformation("Connection closed due to an error: {Exception}", exception); + _logger.LogInformation("Connection closed due to an error: {Exception}", exception); } }; } From a3862d17f3ec268c9e7ff73b0795765438a08570 Mon Sep 17 00:00:00 2001 From: "Matthew Parker [SSW]" <61717342+MattParkerDev@users.noreply.github.com> Date: Tue, 23 May 2023 16:21:58 +1000 Subject: [PATCH 05/11] Update Cors and Client api base url --- .github/workflows/ssw-rulesgpt-prod.yml | 2 ++ .github/workflows/ssw-rulesgpt-stage.yml | 2 ++ src/WebAPI/DependencyInjection.cs | 7 ++++++- src/WebUI/Program.cs | 4 +--- src/WebUI/SignalRClient.cs | 19 +++++++------------ src/WebUI/WebUI.csproj | 6 ++++++ .../wwwroot/appsettings.Development.json | 3 +++ 7 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 src/WebUI/wwwroot/appsettings.Development.json diff --git a/.github/workflows/ssw-rulesgpt-prod.yml b/.github/workflows/ssw-rulesgpt-prod.yml index f3dc565..4e2df44 100644 --- a/.github/workflows/ssw-rulesgpt-prod.yml +++ b/.github/workflows/ssw-rulesgpt-prod.yml @@ -103,3 +103,5 @@ jobs: api_location: '' # Api source code path - optional output_location: '' # Built app content directory - optional ###### End of Repository/Build Configurations ###### + env: + ApiBaseUrl: ${{ steps.deploy-to-webapp.outputs.webapp-url }} \ No newline at end of file diff --git a/.github/workflows/ssw-rulesgpt-stage.yml b/.github/workflows/ssw-rulesgpt-stage.yml index 6bc677d..f59126d 100644 --- a/.github/workflows/ssw-rulesgpt-stage.yml +++ b/.github/workflows/ssw-rulesgpt-stage.yml @@ -103,3 +103,5 @@ jobs: api_location: '' # Api source code path - optional output_location: '' # Built app content directory - optional ###### End of Repository/Build Configurations ###### + env: + ApiBaseUrl: ${{ steps.deploy-to-webapp.outputs.webapp-url }} diff --git a/src/WebAPI/DependencyInjection.cs b/src/WebAPI/DependencyInjection.cs index 850f6b6..d1daea3 100644 --- a/src/WebAPI/DependencyInjection.cs +++ b/src/WebAPI/DependencyInjection.cs @@ -39,9 +39,14 @@ string rulesGptCorsPolicy // TODO: Set CORS in Bicep var productionCorsUrls = new string[] { + // Static Web Apps "https://white-desert-00e3fb600.3.azurestaticapps.net", + "https://ashy-meadow-0a2bad900.3.azurestaticapps.net", + // Production "https://rulesgpt.ssw.com.au", - "https://ssw.com.au/rulesgpt" + "https://ssw.com.au/rulesgpt", + // Staging + "https://www.tfs365.com/rulesgpt" }; var developmentCorsUrls = new string[] { "https://localhost:5001" }; diff --git a/src/WebUI/Program.cs b/src/WebUI/Program.cs index 7423e8b..0587f05 100644 --- a/src/WebUI/Program.cs +++ b/src/WebUI/Program.cs @@ -37,9 +37,7 @@ const string ApiClient = nameof(ApiClient); -var apiBaseUrl = builder.HostEnvironment.IsDevelopment() - ? "https://localhost:7104" - : "https://ssw-rulesgpt-api.azurewebsites.net"; +var apiBaseUrl = builder.Configuration["ApiBaseUrl"]; builder.Services .AddHttpClient( diff --git a/src/WebUI/SignalRClient.cs b/src/WebUI/SignalRClient.cs index abfd149..51b164f 100644 --- a/src/WebUI/SignalRClient.cs +++ b/src/WebUI/SignalRClient.cs @@ -3,31 +3,26 @@ using Microsoft.AspNetCore.SignalR.Client; using OpenAI.GPT3.ObjectModels.RequestModels; using WebUI.Models; -using WebUI.Services; namespace WebUI; public class SignalRClient { - private readonly DataState _dataState; - private readonly NotifierService _notifierService; private readonly HubConnection _connection; private readonly ILogger _logger; + private readonly DataState _dataState; public SignalRClient( - DataState dataState, IWebAssemblyHostEnvironment hostEnvironment, - NotifierService notifierService, - ILogger logger + IConfiguration config, + ILogger logger, + DataState dataState ) { - _dataState = dataState; - _notifierService = notifierService; _logger = logger; - var hubeBaseUrl = hostEnvironment.IsDevelopment() - ? "https://localhost:7104" - : "https://ssw-rulesgpt-api.azurewebsites.net"; - var hubUrl = $"{hubeBaseUrl}/ruleshub"; + _dataState = dataState; + var hubBaseUrl = config["ApiBaseUrl"]; + var hubUrl = $"{hubBaseUrl}/ruleshub"; _connection = new HubConnectionBuilder().WithUrl(hubUrl).WithAutomaticReconnect().Build(); RegisterHandlers(); _connection.Closed += async (exception) => diff --git a/src/WebUI/WebUI.csproj b/src/WebUI/WebUI.csproj index 7ae92d3..ac1e4a0 100644 --- a/src/WebUI/WebUI.csproj +++ b/src/WebUI/WebUI.csproj @@ -17,5 +17,11 @@ + + + + PreserveNewest + + \ No newline at end of file diff --git a/src/WebUI/wwwroot/appsettings.Development.json b/src/WebUI/wwwroot/appsettings.Development.json new file mode 100644 index 0000000..1f309fd --- /dev/null +++ b/src/WebUI/wwwroot/appsettings.Development.json @@ -0,0 +1,3 @@ +{ + "ApiBaseUrl": "https://localhost:7104" +} \ No newline at end of file From 7e34d5aad085f8c6016b37fc590c13876aa5ccf0 Mon Sep 17 00:00:00 2001 From: "Matthew Parker [SSW]" <61717342+MattParkerDev@users.noreply.github.com> Date: Tue, 23 May 2023 17:11:31 +1000 Subject: [PATCH 06/11] Update workflow --- .github/workflows/ssw-rulesgpt-stage.yml | 4 ++++ .gitignore | 2 +- src/WebAPI/appsettings.json | 10 ++++++++++ src/WebUI/WebUI.csproj | 2 +- .../{appsettings.Development.json => appsettings.json} | 0 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/WebAPI/appsettings.json rename src/WebUI/wwwroot/{appsettings.Development.json => appsettings.json} (100%) diff --git a/.github/workflows/ssw-rulesgpt-stage.yml b/.github/workflows/ssw-rulesgpt-stage.yml index f59126d..5a66cb3 100644 --- a/.github/workflows/ssw-rulesgpt-stage.yml +++ b/.github/workflows/ssw-rulesgpt-stage.yml @@ -12,6 +12,7 @@ on: env: # DeploymentEnvironment: 'Staging' AzureWebAppName: 'ssw-rulesgpt-api-stage' # The name of the resource in Azure + AzureWebAppUrl: 'https://ssw-rulesgpt-api-stage.azurewebsites.net' # Needs to match the name of the resource in Azure AzureWebAppSecret: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_706C909B7DCB4379927A9D3AF3D8B5EF }} AzureStaticWebAppsApiToken: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ASHY_MEADOW_0A2BAD900 }} GithubRepoToken: ${{ secrets.GITHUB_TOKEN }} @@ -42,6 +43,9 @@ jobs: - name: Change base-tag in index.html from / to /rulesgpt/ run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html + - name: Change ApiBaseUrl in appsettings.json from localhost to Azure Web App + run: sed -i 's/https:\/\/localhost:7104/${{env.AzureWebAppUrl}}/g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/appsettings.json + - name: Upload API artifact for deployment job uses: actions/upload-artifact@v3.1.2 with: diff --git a/.gitignore b/.gitignore index 918eed5..38f6bbe 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ *.user *.userosscache *.sln.docstates -**/appsettings.json +**/appsettings.Development.json # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs diff --git a/src/WebAPI/appsettings.json b/src/WebAPI/appsettings.json new file mode 100644 index 0000000..7aa06ad --- /dev/null +++ b/src/WebAPI/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Microsoft.EntityFrameworkCore.Database.Command": "Information" + } + }, + "AllowedHosts": "*" +} \ No newline at end of file diff --git a/src/WebUI/WebUI.csproj b/src/WebUI/WebUI.csproj index ac1e4a0..e8554e7 100644 --- a/src/WebUI/WebUI.csproj +++ b/src/WebUI/WebUI.csproj @@ -19,7 +19,7 @@ - + PreserveNewest diff --git a/src/WebUI/wwwroot/appsettings.Development.json b/src/WebUI/wwwroot/appsettings.json similarity index 100% rename from src/WebUI/wwwroot/appsettings.Development.json rename to src/WebUI/wwwroot/appsettings.json From 2f726b9f5fdd1c4580c775fd02acb54a0dbe4c41 Mon Sep 17 00:00:00 2001 From: Matthew Parker Date: Tue, 23 May 2023 20:51:41 +1000 Subject: [PATCH 07/11] Update Stage workflow --- .github/workflows/ssw-rulesgpt-stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ssw-rulesgpt-stage.yml b/.github/workflows/ssw-rulesgpt-stage.yml index 5a66cb3..9b84977 100644 --- a/.github/workflows/ssw-rulesgpt-stage.yml +++ b/.github/workflows/ssw-rulesgpt-stage.yml @@ -12,7 +12,7 @@ on: env: # DeploymentEnvironment: 'Staging' AzureWebAppName: 'ssw-rulesgpt-api-stage' # The name of the resource in Azure - AzureWebAppUrl: 'https://ssw-rulesgpt-api-stage.azurewebsites.net' # Needs to match the name of the resource in Azure + AzureWebAppUrl: 'https:\/\/ssw-rulesgpt-api-stage.azurewebsites.net' # Needs to match the name of the resource in Azure AzureWebAppSecret: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_706C909B7DCB4379927A9D3AF3D8B5EF }} AzureStaticWebAppsApiToken: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ASHY_MEADOW_0A2BAD900 }} GithubRepoToken: ${{ secrets.GITHUB_TOKEN }} From bcc6197e0a8d47761fd16a6000f9af00362dc51c Mon Sep 17 00:00:00 2001 From: Matthew Parker Date: Tue, 23 May 2023 21:27:59 +1000 Subject: [PATCH 08/11] Update Stage workflow --- .github/workflows/ssw-rulesgpt-stage.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ssw-rulesgpt-stage.yml b/.github/workflows/ssw-rulesgpt-stage.yml index 9b84977..ff9a765 100644 --- a/.github/workflows/ssw-rulesgpt-stage.yml +++ b/.github/workflows/ssw-rulesgpt-stage.yml @@ -32,6 +32,9 @@ jobs: - name: Build with dotnet run: dotnet build --configuration Release + - name: Change ApiBaseUrl in appsettings.json from localhost to Azure Web App + run: sed -i 's/https:\/\/localhost:7104/${{env.AzureWebAppUrl}}/g' ./src/WebUI/wwwroot/appsettings.json + - name: dotnet publish WebAPI run: dotnet publish ./src/WebAPI -c Release --property PublishDir=${{env.DOTNET_ROOT}}/myapp/api @@ -43,9 +46,6 @@ jobs: - name: Change base-tag in index.html from / to /rulesgpt/ run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html - - name: Change ApiBaseUrl in appsettings.json from localhost to Azure Web App - run: sed -i 's/https:\/\/localhost:7104/${{env.AzureWebAppUrl}}/g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/appsettings.json - - name: Upload API artifact for deployment job uses: actions/upload-artifact@v3.1.2 with: From 5acc2f805ad5353203893ce127e50811d9e805c3 Mon Sep 17 00:00:00 2001 From: Matthew Parker Date: Tue, 23 May 2023 21:41:49 +1000 Subject: [PATCH 09/11] Update CORS --- src/WebAPI/DependencyInjection.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/WebAPI/DependencyInjection.cs b/src/WebAPI/DependencyInjection.cs index d1daea3..1de7ee2 100644 --- a/src/WebAPI/DependencyInjection.cs +++ b/src/WebAPI/DependencyInjection.cs @@ -45,8 +45,10 @@ string rulesGptCorsPolicy // Production "https://rulesgpt.ssw.com.au", "https://ssw.com.au/rulesgpt", + "https://ssw.com.au", // Staging - "https://www.tfs365.com/rulesgpt" + "https://www.tfs365.com/rulesgpt", + "https://www.tfs365.com" // TODO: Fix Host Origin Header }; var developmentCorsUrls = new string[] { "https://localhost:5001" }; From 44ff71cbdd1825c849910866eb92732996a50130 Mon Sep 17 00:00:00 2001 From: Matthew Parker Date: Tue, 23 May 2023 22:30:52 +1000 Subject: [PATCH 10/11] Update Prod workflow --- .github/workflows/ssw-rulesgpt-prod.yml | 12 +++++++----- .github/workflows/ssw-rulesgpt-stage.yml | 8 +++----- src/WebAPI/DependencyInjection.cs | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ssw-rulesgpt-prod.yml b/.github/workflows/ssw-rulesgpt-prod.yml index 4e2df44..11353f4 100644 --- a/.github/workflows/ssw-rulesgpt-prod.yml +++ b/.github/workflows/ssw-rulesgpt-prod.yml @@ -12,6 +12,7 @@ on: env: # DeploymentEnvironment: 'Production' AzureWebAppName: 'ssw-rulesgpt-api' # The name of the resource in Azure + AzureWebAppUrl: 'https:\/\/ssw-rulesgpt-api.azurewebsites.net' # Escape slashes for regex AzureWebAppSecret: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1FEDFC8C3C4A497399C6318E5C173C42 }} AzureStaticWebAppsApiToken: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WHITE_DESERT_00E3FB600 }} GithubRepoToken: ${{ secrets.GITHUB_TOKEN }} @@ -31,15 +32,18 @@ jobs: - name: Build with dotnet run: dotnet build --configuration Release + - name: Change ApiBaseUrl in appsettings.json from localhost to Azure Web App + run: sed -i 's/https:\/\/localhost:7104/${{env.AzureWebAppUrl}}/g' ./src/WebUI/wwwroot/appsettings.json + - name: dotnet publish WebAPI run: dotnet publish ./src/WebAPI -c Release --property PublishDir=${{env.DOTNET_ROOT}}/myapp/api - name: dotnet publish WebUI run: dotnet publish ./src/WebUI -c Release --property PublishDir=${{env.DOTNET_ROOT}}/myapp/webui # TODO: Build and run unit tests - - # Changes the base-tag in index.html from '/' to '/rulesgpt/' to match SSW subdirectory - - name: Change base-tag in index.html from / to /rulesgpt/ + + # Changes the basehref in index.html from '/' to '/rulesgpt/' to match SSW subdirectory + - name: Change basehref in index.html from / to /rulesgpt/ run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html - name: Upload API artifact for deployment job @@ -103,5 +107,3 @@ jobs: api_location: '' # Api source code path - optional output_location: '' # Built app content directory - optional ###### End of Repository/Build Configurations ###### - env: - ApiBaseUrl: ${{ steps.deploy-to-webapp.outputs.webapp-url }} \ No newline at end of file diff --git a/.github/workflows/ssw-rulesgpt-stage.yml b/.github/workflows/ssw-rulesgpt-stage.yml index ff9a765..0611d03 100644 --- a/.github/workflows/ssw-rulesgpt-stage.yml +++ b/.github/workflows/ssw-rulesgpt-stage.yml @@ -12,7 +12,7 @@ on: env: # DeploymentEnvironment: 'Staging' AzureWebAppName: 'ssw-rulesgpt-api-stage' # The name of the resource in Azure - AzureWebAppUrl: 'https:\/\/ssw-rulesgpt-api-stage.azurewebsites.net' # Needs to match the name of the resource in Azure + AzureWebAppUrl: 'https:\/\/ssw-rulesgpt-api-stage.azurewebsites.net' # Escape slashes for regex AzureWebAppSecret: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_706C909B7DCB4379927A9D3AF3D8B5EF }} AzureStaticWebAppsApiToken: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ASHY_MEADOW_0A2BAD900 }} GithubRepoToken: ${{ secrets.GITHUB_TOKEN }} @@ -42,8 +42,8 @@ jobs: run: dotnet publish ./src/WebUI -c Release --property PublishDir=${{env.DOTNET_ROOT}}/myapp/webui # TODO: Build and run unit tests - # Changes the base-tag in index.html from '/' to '/rulesgpt/' to match SSW subdirectory - - name: Change base-tag in index.html from / to /rulesgpt/ + # Changes the basehref in index.html from '/' to '/rulesgpt/' to match SSW subdirectory + - name: Change basehref in index.html from / to /rulesgpt/ run: sed -i 's///g' ${{env.DOTNET_ROOT}}/myapp/webui/wwwroot/index.html - name: Upload API artifact for deployment job @@ -107,5 +107,3 @@ jobs: api_location: '' # Api source code path - optional output_location: '' # Built app content directory - optional ###### End of Repository/Build Configurations ###### - env: - ApiBaseUrl: ${{ steps.deploy-to-webapp.outputs.webapp-url }} diff --git a/src/WebAPI/DependencyInjection.cs b/src/WebAPI/DependencyInjection.cs index 1de7ee2..565c618 100644 --- a/src/WebAPI/DependencyInjection.cs +++ b/src/WebAPI/DependencyInjection.cs @@ -45,7 +45,7 @@ string rulesGptCorsPolicy // Production "https://rulesgpt.ssw.com.au", "https://ssw.com.au/rulesgpt", - "https://ssw.com.au", + "https://ssw.com.au", // TODO: Fix Host Origin Header // Staging "https://www.tfs365.com/rulesgpt", "https://www.tfs365.com" // TODO: Fix Host Origin Header From cded9d2592f2623ca51e779e24f9d03713968135 Mon Sep 17 00:00:00 2001 From: "Matthew Parker [SSW]" <61717342+MattParkerDev@users.noreply.github.com> Date: Wed, 24 May 2023 13:46:29 +1000 Subject: [PATCH 11/11] Update CORS --- src/WebAPI/DependencyInjection.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/WebAPI/DependencyInjection.cs b/src/WebAPI/DependencyInjection.cs index 565c618..a916058 100644 --- a/src/WebAPI/DependencyInjection.cs +++ b/src/WebAPI/DependencyInjection.cs @@ -48,7 +48,8 @@ string rulesGptCorsPolicy "https://ssw.com.au", // TODO: Fix Host Origin Header // Staging "https://www.tfs365.com/rulesgpt", - "https://www.tfs365.com" // TODO: Fix Host Origin Header + "https://www.tfs365.com", // TODO: Fix Host Origin Header + "https://tfs365.com" // TODO: Fix Host Origin Header }; var developmentCorsUrls = new string[] { "https://localhost:5001" };