diff --git a/etc/azure/deploy-to-k8s.yml b/etc/azure/deploy-to-k8s.yml index 98c3a1f..de891da 100644 --- a/etc/azure/deploy-to-k8s.yml +++ b/etc/azure/deploy-to-k8s.yml @@ -1,15 +1,46 @@ +variables: + version: $(Build.BuildId) + +trigger: none + pool: - vmImage: 'windows-latest' + vmImage: 'ubuntu-latest' steps: - task: PowerShell@2 + displayName: Build docker images inputs: filePath: 'etc/k8s/scripts/build-images.ps1' + arguments: '-version $(version)' + +- task: Docker@2 + displayName: Login to ACR + inputs: + containerRegistry: 'volocr' + command: 'login' - task: PowerShell@2 + displayName: Push images to ACR inputs: filePath: 'etc/azure/scripts/push-images.ps1' + arguments: '-version $(version)' + +- task: Kubernetes@1 + displayName: Delete migrator job + continueOnError: true + inputs: + connectionType: 'Azure Resource Manager' + azureSubscriptionEndpoint: 'volosoft (fe02ef9f-9e1c-4e40-b924-505981688dd8)' + azureResourceGroup: 'volo' + kubernetesCluster: 'volo' + namespace: 'eventhub' + command: 'delete' + arguments: 'job eh-az-dbmigrator' + secretType: 'dockerRegistry' + containerRegistryType: 'Azure Container Registry' + - task: HelmDeploy@0 + displayName: Helm deploy inputs: connectionType: 'Azure Resource Manager' azureSubscription: 'volosoft(fe02ef9f-9e1c-4e40-b924-505981688dd8)' @@ -19,7 +50,7 @@ steps: namespace: 'eventhub' command: 'upgrade' chartType: 'Name' - chartName: 'eventhub' + chartName: 'etc/k8s/helm-chart/eventhub' releaseName: 'eh-az' valueFile: 'etc/k8s/helm-chart/eventhub/values.azure.yaml' - arguments: '--namespace eventhub --create-namespace' \ No newline at end of file + arguments: '--namespace eventhub --create-namespace --set global.eventHubImageVersion=$(version)' \ No newline at end of file diff --git a/etc/azure/scripts/push-images.ps1 b/etc/azure/scripts/push-images.ps1 index a3e504d..a1fdd44 100644 --- a/etc/azure/scripts/push-images.ps1 +++ b/etc/azure/scripts/push-images.ps1 @@ -1,22 +1,31 @@ +param ($version='latest') + az acr login --name volocr -docker tag eventhub.dbmigrator:latest volocr.azurecr.io/eventhub.dbmigrator:latest -docker push volocr.azurecr.io/eventhub.dbmigrator:latest +docker tag eventhub.dbmigrator:$version volocr.azurecr.io/eventhub.dbmigrator:$version +docker push volocr.azurecr.io/eventhub.dbmigrator:$version +docker tag volocr.azurecr.io/eventhub.dbmigrator:$version volocr.azurecr.io/eventhub.dbmigrator:latest -docker tag eventhub.www:latest volocr.azurecr.io/eventhub.www:latest -docker push volocr.azurecr.io/eventhub.www:latest +docker tag eventhub.www:$version volocr.azurecr.io/eventhub.www:$version +docker push volocr.azurecr.io/eventhub.www:$version +docker tag volocr.azurecr.io/eventhub.www:$version volocr.azurecr.io/eventhub.www:latest -docker tag eventhub.api:latest volocr.azurecr.io/eventhub.api:latest -docker push volocr.azurecr.io/eventhub.api:latest +docker tag eventhub.api:$version volocr.azurecr.io/eventhub.api:$version +docker push volocr.azurecr.io/eventhub.api:$version +docker tag volocr.azurecr.io/eventhub.api:$version volocr.azurecr.io/eventhub.api:latest -docker tag eventhub.admin:latest volocr.azurecr.io/eventhub.admin:latest -docker push volocr.azurecr.io/eventhub.admin:latest +docker tag eventhub.admin:$version volocr.azurecr.io/eventhub.admin:$version +docker push volocr.azurecr.io/eventhub.admin:$version +docker tag volocr.azurecr.io/eventhub.admin:$version volocr.azurecr.io/eventhub.admin:latest -docker tag eventhub.admin-api:latest volocr.azurecr.io/eventhub.admin-api:latest -docker push volocr.azurecr.io/eventhub.admin-api:latest +docker tag eventhub.admin-api:$version volocr.azurecr.io/eventhub.admin-api:$version +docker push volocr.azurecr.io/eventhub.admin-api:$version +docker tag volocr.azurecr.io/eventhub.admin-api:$version volocr.azurecr.io/eventhub.admin-api:latest -docker tag eventhub.account:latest volocr.azurecr.io/eventhub.account:latest -docker push volocr.azurecr.io/eventhub.account:latest +docker tag eventhub.account:$version volocr.azurecr.io/eventhub.account:$version +docker push volocr.azurecr.io/eventhub.account:$version +docker tag volocr.azurecr.io/eventhub.account:$version volocr.azurecr.io/eventhub.account:latest -docker tag eventhub.background-services:latest volocr.azurecr.io/eventhub.background-services:latest -docker push volocr.azurecr.io/eventhub.background-services:latest \ No newline at end of file +docker tag eventhub.background-services:$version volocr.azurecr.io/eventhub.background-services:$version +docker push volocr.azurecr.io/eventhub.background-services:$version +docker tag volocr.azurecr.io/eventhub.background-services:$version volocr.azurecr.io/eventhub.background-services:latest diff --git a/etc/k8s/helm-chart/deploy-azure.ps1 b/etc/k8s/helm-chart/deploy-azure.ps1 index 96bc82d..ba800d6 100644 --- a/etc/k8s/helm-chart/deploy-azure.ps1 +++ b/etc/k8s/helm-chart/deploy-azure.ps1 @@ -1 +1,4 @@ -helm upgrade --install eh-az eventhub -f .\eventhub\values.azure.yaml --namespace eventhub --create-namespace \ No newline at end of file +param ($version='latest') + +kubectl delete job eh-az-dbmigrator +helm upgrade --install eh-az eventhub -f .\eventhub\values.azure.yaml --namespace eventhub --create-namespace --set global.eventHubImageVersion=$version \ No newline at end of file diff --git a/etc/k8s/helm-chart/deploy-staging.ps1 b/etc/k8s/helm-chart/deploy-staging.ps1 new file mode 100644 index 0000000..6b992e2 --- /dev/null +++ b/etc/k8s/helm-chart/deploy-staging.ps1 @@ -0,0 +1,4 @@ +param ($version='latest') + +kubectl delete job eh-st-dbmigrator +helm upgrade --install eh-st eventhub --namespace eventhub --create-namespace --set global.eventHubImageVersion=$version \ No newline at end of file diff --git a/etc/k8s/helm-chart/eventhub/charts/account/templates/account.yaml b/etc/k8s/helm-chart/eventhub/charts/account/templates/account.yaml index 0fc80aa..08ee5e4 100644 --- a/etc/k8s/helm-chart/eventhub/charts/account/templates/account.yaml +++ b/etc/k8s/helm-chart/eventhub/charts/account/templates/account.yaml @@ -12,7 +12,7 @@ spec: app: {{ .Release.Name }}-{{ .Chart.Name }} spec: containers: - - image: {{ .Values.containerImage }} + - image: {{ .Values.containerImage }}:{{ .Values.global.eventHubImageVersion }} imagePullPolicy: {{ .Values.global.imagePullPolicy }} name: {{ .Release.Name }}-{{ .Chart.Name }} ports: diff --git a/etc/k8s/helm-chart/eventhub/charts/admin-api/templates/admin-api.yaml b/etc/k8s/helm-chart/eventhub/charts/admin-api/templates/admin-api.yaml index 0fc80aa..08ee5e4 100644 --- a/etc/k8s/helm-chart/eventhub/charts/admin-api/templates/admin-api.yaml +++ b/etc/k8s/helm-chart/eventhub/charts/admin-api/templates/admin-api.yaml @@ -12,7 +12,7 @@ spec: app: {{ .Release.Name }}-{{ .Chart.Name }} spec: containers: - - image: {{ .Values.containerImage }} + - image: {{ .Values.containerImage }}:{{ .Values.global.eventHubImageVersion }} imagePullPolicy: {{ .Values.global.imagePullPolicy }} name: {{ .Release.Name }}-{{ .Chart.Name }} ports: diff --git a/etc/k8s/helm-chart/eventhub/charts/admin/templates/admin.yaml b/etc/k8s/helm-chart/eventhub/charts/admin/templates/admin.yaml index ca27707..939994b 100644 --- a/etc/k8s/helm-chart/eventhub/charts/admin/templates/admin.yaml +++ b/etc/k8s/helm-chart/eventhub/charts/admin/templates/admin.yaml @@ -12,7 +12,7 @@ spec: app: {{ .Release.Name }}-{{ .Chart.Name }} spec: containers: - - image: {{ .Values.containerImage }} + - image: {{ .Values.containerImage }}:{{ .Values.global.eventHubImageVersion }} imagePullPolicy: {{ .Values.global.imagePullPolicy }} name: {{ .Release.Name }}-{{ .Chart.Name }} ports: diff --git a/etc/k8s/helm-chart/eventhub/charts/api/templates/api.yaml b/etc/k8s/helm-chart/eventhub/charts/api/templates/api.yaml index 0fc80aa..08ee5e4 100644 --- a/etc/k8s/helm-chart/eventhub/charts/api/templates/api.yaml +++ b/etc/k8s/helm-chart/eventhub/charts/api/templates/api.yaml @@ -12,7 +12,7 @@ spec: app: {{ .Release.Name }}-{{ .Chart.Name }} spec: containers: - - image: {{ .Values.containerImage }} + - image: {{ .Values.containerImage }}:{{ .Values.global.eventHubImageVersion }} imagePullPolicy: {{ .Values.global.imagePullPolicy }} name: {{ .Release.Name }}-{{ .Chart.Name }} ports: diff --git a/etc/k8s/helm-chart/eventhub/charts/background-services/templates/background-services.yaml b/etc/k8s/helm-chart/eventhub/charts/background-services/templates/background-services.yaml index 6e7d8ee..5d83c0d 100644 --- a/etc/k8s/helm-chart/eventhub/charts/background-services/templates/background-services.yaml +++ b/etc/k8s/helm-chart/eventhub/charts/background-services/templates/background-services.yaml @@ -1,18 +1,21 @@ -apiVersion: batch/v1 -kind: Job +apiVersion: apps/v1 +kind: Deployment metadata: name: {{ .Release.Name }}-{{ .Chart.Name }} spec: - activeDeadlineSeconds: 180 + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} spec: containers: - - name: {{ .Release.Name }}-{{ .Chart.Name }} - image: {{ .Values.containerImage }} + - image: {{ .Values.containerImage }}:{{ .Values.global.eventHubImageVersion }} imagePullPolicy: {{ .Values.global.imagePullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} env: {{ include "eventhub.global.env" . | indent 8 }} - name: "ConnectionStrings__Default" - value: {{ .Values.global.defaultConnString }} - restartPolicy: Never - backoffLimit: 10 \ No newline at end of file + value: {{ .Values.global.defaultConnString }} \ No newline at end of file diff --git a/etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml b/etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml index 03b7b64..b595bd7 100644 --- a/etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml +++ b/etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml @@ -8,7 +8,7 @@ spec: spec: containers: - name: {{ .Release.Name }}-{{ .Chart.Name }} - image: {{ .Values.containerImage }} + image: {{ .Values.containerImage }}:{{ .Values.global.eventHubImageVersion }} imagePullPolicy: {{ .Values.global.imagePullPolicy }} env: {{ include "eventhub.global.env" . | indent 8 }} diff --git a/etc/k8s/helm-chart/eventhub/charts/www/templates/www.yaml b/etc/k8s/helm-chart/eventhub/charts/www/templates/www.yaml index ca27707..939994b 100644 --- a/etc/k8s/helm-chart/eventhub/charts/www/templates/www.yaml +++ b/etc/k8s/helm-chart/eventhub/charts/www/templates/www.yaml @@ -12,7 +12,7 @@ spec: app: {{ .Release.Name }}-{{ .Chart.Name }} spec: containers: - - image: {{ .Values.containerImage }} + - image: {{ .Values.containerImage }}:{{ .Values.global.eventHubImageVersion }} imagePullPolicy: {{ .Values.global.imagePullPolicy }} name: {{ .Release.Name }}-{{ .Chart.Name }} ports: diff --git a/etc/k8s/helm-chart/eventhub/values.azure.yaml b/etc/k8s/helm-chart/eventhub/values.azure.yaml index c98ca3c..4aba737 100644 --- a/etc/k8s/helm-chart/eventhub/values.azure.yaml +++ b/etc/k8s/helm-chart/eventhub/values.azure.yaml @@ -19,6 +19,7 @@ global: internalAuthServerRequireHttpsMetadata: "false" stringEncryptionDefaultPassPhrase: "TxVIZFPxK33czbbv" imagePullPolicy: Always + eventHubImageVersion: latest account: containerImage: "volocr.azurecr.io/eventhub.account" api: diff --git a/etc/k8s/helm-chart/eventhub/values.yaml b/etc/k8s/helm-chart/eventhub/values.yaml index 0fd8d6a..153b4d5 100644 --- a/etc/k8s/helm-chart/eventhub/values.yaml +++ b/etc/k8s/helm-chart/eventhub/values.yaml @@ -19,6 +19,7 @@ global: internalAuthServerRequireHttpsMetadata: "false" stringEncryptionDefaultPassPhrase: "TxVIZFPxK33czbbv" imagePullPolicy: Never + eventHubImageVersion: latest account: containerImage: "eventhub.account" api: diff --git a/etc/k8s/scripts/build-images.ps1 b/etc/k8s/scripts/build-images.ps1 index a8f6bcb..a89ba68 100644 --- a/etc/k8s/scripts/build-images.ps1 +++ b/etc/k8s/scripts/build-images.ps1 @@ -1,3 +1,5 @@ +param ($version='latest') + $currentFolder = $PSScriptRoot $slnFolder = Join-Path $currentFolder "../../../" $dbmigratorFolder = Join-Path $slnFolder "src/EventHub.DbMigrator" @@ -13,49 +15,49 @@ $backgroundServicesFolder = Join-Path $slnFolder "src/EventHub.BackgroundService Write-Host "*** BUILDING DB MIGRATOR ****************" -ForegroundColor Green Set-Location $dbmigratorFolder dotnet publish -c Release -docker build -t eventhub.dbmigrator . +docker build -t eventhub.dbmigrator:$version . ### WEB (WWW) Write-Host "*** BUILDING WEB (WWW) ****************" -ForegroundColor Green Set-Location $webFolder dotnet publish -c Release -docker build -t eventhub.www . +docker build -t eventhub.www:$version . ### API Write-Host "*** BUILDING API ****************" -ForegroundColor Green Set-Location $apiFolder dotnet publish -c Release -docker build -t eventhub.api . +docker build -t eventhub.api:$version . ### ADMIN (BLAZOR) Write-Host "*** BUILDING ADMIN (BLAZOR) ****************" -ForegroundColor Green Set-Location $adminFolder dotnet publish -c Release -docker build -t eventhub.admin . +docker build -t eventhub.admin:$version . ### ADMIN API Write-Host "*** BUILDING ADMIN API ****************" -ForegroundColor Green Set-Location $adminApiFolder dotnet publish -c Release -docker build -t eventhub.admin-api . +docker build -t eventhub.admin-api:$version . ### IDENTITY SERVER (ACCOUNT) Write-Host "*** BUILDING IDENTITY SERVER (ACCOUNT) ****************" -ForegroundColor Green Set-Location $identityServerFolder dotnet publish -c Release -docker build -t eventhub.account . +docker build -t eventhub.account:$version . ### BACKGROUND SERVICES Write-Host "*** BUILDING BACKGROUND SERVICES ****************" -ForegroundColor Green Set-Location $backgroundServicesFolder dotnet publish -c Release -docker build -t eventhub.background-services . +docker build -t eventhub.background-services:$version . ### ALL COMPLETED diff --git a/src/EventHub.Admin.HttpApi.Host/EventHubAdminHttpApiHostModule.cs b/src/EventHub.Admin.HttpApi.Host/EventHubAdminHttpApiHostModule.cs index 17946a0..a2b47f8 100644 --- a/src/EventHub.Admin.HttpApi.Host/EventHubAdminHttpApiHostModule.cs +++ b/src/EventHub.Admin.HttpApi.Host/EventHubAdminHttpApiHostModule.cs @@ -112,7 +112,7 @@ namespace EventHub.Admin private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) { context.Services.AddAbpSwaggerGenWithOAuth( - configuration[EventHubUrlOptions.GetAccountConfigKey()], + EventHubUrlOptions.GetAccountConfigValue(configuration), new Dictionary { {"EventHubAdmin", "EventHub Admin API"} @@ -151,7 +151,7 @@ namespace EventHub.Admin { builder .WithOrigins( - configuration[EventHubUrlOptions.GetAdminConfigKey()] + EventHubUrlOptions.GetAdminConfigValue(configuration) ) .WithAbpExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() diff --git a/src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs b/src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs index 5d758a1..9446c4d 100644 --- a/src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs +++ b/src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs @@ -1,49 +1,65 @@ -namespace EventHub.Web +using Microsoft.Extensions.Configuration; + +namespace EventHub.Web { public class EventHubUrlOptions { private const string ConfigurationName = "AppUrls"; + private const string AccountDefaultValue = "https://localhost:44313"; + private const string AdminDefaultValue = "https://localhost:44307"; + private const string WwwDefaultValue = "https://localhost:44308"; + private const string ApiDefaultValue = "https://localhost:44362"; + private const string ApiInternalDefaultValue = ApiDefaultValue; + private const string AdminApiDefaultValue = "https://localhost:44305"; - public string Account { get; set; } = "https://localhost:44313"; - public string Www { get; set; } = "https://localhost:44308"; - public string Api { get; set; } = "https://localhost:44362"; - public string ApiInternal { get; set; } = "https://localhost:44362"; - public string Admin { get; set; } = "https://localhost:44307"; - public string AdminApi { get; set; } = "https://localhost:44305"; + public string Account { get; set; } = AccountDefaultValue; + public string Www { get; set; } = WwwDefaultValue; + public string Api { get; set; } = ApiDefaultValue; + public string ApiInternal { get; set; } = ApiInternalDefaultValue; + public string Admin { get; set; } = AdminDefaultValue; + public string AdminApi { get; set; } = AdminApiDefaultValue; - public static string GetAccountConfigKey() + public static string GetAccountConfigValue(IConfiguration configuration) { - return GetConfigKey(nameof(Account)); + return GetConfigValue(configuration, nameof(Account), AccountDefaultValue); } - public static string GetWwwConfigKey() + public static string GetWwwConfigValue(IConfiguration configuration) { - return GetConfigKey(nameof(Www)); + return GetConfigValue(configuration, nameof(Www), WwwDefaultValue); } - public static string GetApiInternalConfigKey() + public static string GetApiInternalConfigValue(IConfiguration configuration) { - return GetConfigKey(nameof(ApiInternal)); + return GetConfigValue(configuration, nameof(ApiInternal), ApiInternalDefaultValue); } - - public static string GetApiConfigKey() + + public static string GetApiConfigValue(IConfiguration configuration) { - return GetConfigKey(nameof(Api)); + return GetConfigValue(configuration, nameof(Api), ApiDefaultValue); } - public static string GetAdminConfigKey() + public static string GetAdminConfigValue(IConfiguration configuration) { - return GetConfigKey(nameof(Admin)); + return GetConfigValue(configuration, nameof(Admin), AdminDefaultValue); } - - public static string GetAdminApiConfigKey() + + public static string GetAdminApiConfigValue(IConfiguration configuration) { - return GetConfigKey(nameof(AdminApi)); + return GetConfigValue(configuration, nameof(AdminApi), AdminApiDefaultValue); } - + private static string GetConfigKey(string appName) { return $"{ConfigurationName}:{appName}"; } + + private static string GetConfigValue( + IConfiguration configuration, + string appName, + string defaultValue) + { + return configuration[GetConfigKey(appName)] ?? defaultValue; + } } } \ No newline at end of file diff --git a/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs b/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs index 3769b07..b164b37 100644 --- a/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs +++ b/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs @@ -114,7 +114,7 @@ namespace EventHub private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) { context.Services.AddAbpSwaggerGenWithOAuth( - configuration[EventHubUrlOptions.GetAccountConfigKey()], + EventHubUrlOptions.GetAccountConfigValue(configuration), new Dictionary { {"EventHub", "EventHub API"} @@ -153,7 +153,7 @@ namespace EventHub { builder .WithOrigins( - configuration[EventHubUrlOptions.GetWwwConfigKey()] + EventHubUrlOptions.GetWwwConfigValue(configuration) ) .WithAbpExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() diff --git a/src/EventHub.IdentityServer/EventHubIdentityServerModule.cs b/src/EventHub.IdentityServer/EventHubIdentityServerModule.cs index 55d63bc..81e8f25 100644 --- a/src/EventHub.IdentityServer/EventHubIdentityServerModule.cs +++ b/src/EventHub.IdentityServer/EventHubIdentityServerModule.cs @@ -118,7 +118,7 @@ namespace EventHub Configure(options => { - options.IssuerUri = configuration[EventHubUrlOptions.GetAccountConfigKey()]; + options.IssuerUri = EventHubUrlOptions.GetAccountConfigValue(configuration); }); if (hostingEnvironment.IsDevelopment()) @@ -133,14 +133,13 @@ namespace EventHub Configure(options => { - options.Applications["MVC"].RootUrl = configuration[EventHubUrlOptions.GetAccountConfigKey()]; + options.Applications["MVC"].RootUrl = EventHubUrlOptions.GetAccountConfigValue(configuration); options.RedirectAllowedUrls.AddRange( new[] { - configuration[EventHubUrlOptions.GetWwwConfigKey()], - configuration[EventHubUrlOptions.GetAdminConfigKey()], - configuration[EventHubUrlOptions.GetApiConfigKey()], - configuration[EventHubUrlOptions.GetAdminApiConfigKey()] + EventHubUrlOptions.GetWwwConfigValue(configuration), + EventHubUrlOptions.GetApiConfigValue(configuration), + EventHubUrlOptions.GetAdminApiConfigValue(configuration) }); }); @@ -165,10 +164,10 @@ namespace EventHub { builder .WithOrigins( - configuration[EventHubUrlOptions.GetWwwConfigKey()], - configuration[EventHubUrlOptions.GetApiConfigKey()], - configuration[EventHubUrlOptions.GetAdminConfigKey()], - configuration[EventHubUrlOptions.GetAdminApiConfigKey()] + EventHubUrlOptions.GetWwwConfigValue(configuration), + EventHubUrlOptions.GetApiConfigValue(configuration), + EventHubUrlOptions.GetAdminConfigValue(configuration), + EventHubUrlOptions.GetAdminApiConfigValue(configuration) ) .WithAbpExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() @@ -191,7 +190,7 @@ namespace EventHub { if (ctx.Request.Headers.ContainsKey("from-ingress")) { - ctx.SetIdentityServerOrigin(configuration[EventHubUrlOptions.GetAccountConfigKey()]); + ctx.SetIdentityServerOrigin(EventHubUrlOptions.GetAccountConfigValue(configuration)); } await next(); diff --git a/src/EventHub.Web/EventHubWebModule.cs b/src/EventHub.Web/EventHubWebModule.cs index 1daba58..5fae0ba 100644 --- a/src/EventHub.Web/EventHubWebModule.cs +++ b/src/EventHub.Web/EventHubWebModule.cs @@ -112,13 +112,13 @@ namespace EventHub.Web { Configure(options => { - options.Applications["MVC"].RootUrl = configuration[EventHubUrlOptions.GetWwwConfigKey()]; + options.Applications["MVC"].RootUrl = EventHubUrlOptions.GetWwwConfigValue(configuration); }); Configure(options => { options.RemoteServices.Default = new RemoteServiceConfiguration( - configuration[EventHubUrlOptions.GetApiInternalConfigKey()] + EventHubUrlOptions.GetApiInternalConfigValue(configuration) .EnsureEndsWith('/') ); }); diff --git a/src/EventHub.Web/Menus/EventHubMenuContributor.cs b/src/EventHub.Web/Menus/EventHubMenuContributor.cs index 2d5fda7..a2fb640 100644 --- a/src/EventHub.Web/Menus/EventHubMenuContributor.cs +++ b/src/EventHub.Web/Menus/EventHubMenuContributor.cs @@ -51,7 +51,7 @@ namespace EventHub.Web.Menus if (currentUser.IsAuthenticated) { context.Menu.AddItem(new ApplicationMenuItem("Account.Manage", accountStringLocalizer["ManageYourProfile"], - $"{identityServerUrl.EnsureEndsWith('/')}Account/Manage?returnUrl={_configuration[EventHubUrlOptions.GetWwwConfigKey()]}", icon: "fa fa-cog", order: 1000, null, "_blank")); + $"{identityServerUrl.EnsureEndsWith('/')}Account/Manage?returnUrl={EventHubUrlOptions.GetWwwConfigValue(_configuration)}", icon: "fa fa-cog", order: 1000, null, "_blank")); context.Menu.AddItem(new ApplicationMenuItem("Account.Logout", l["Logout"], url: "~/Account/Logout", icon: "fa fa-power-off", order: int.MaxValue - 1000)); } diff --git a/src/EventHub.Web/Pages/Index.cshtml b/src/EventHub.Web/Pages/Index.cshtml index 42caf6e..b5e6042 100644 --- a/src/EventHub.Web/Pages/Index.cshtml +++ b/src/EventHub.Web/Pages/Index.cshtml @@ -40,7 +40,7 @@

.Net Foundation Week

- Lorem ipsum is placeholder text commonly used in the graphic. + Lorem ipsum is placeholder text commonly used in the graphic!!

Join Now @@ -58,7 +58,7 @@

.Net Foundation Week

- Lorem ipsum is placeholder text commonly used in the graphic. + Lorem ipsum is placeholder text commonly used in the graphic!

Join Now @@ -74,8 +74,8 @@
-

Let's Share Together

-

Try something new, or do more of what you love.

+

Let's Share Together!

+

Try something new, or do more of what you love :)