Skip to content

Commit a198b12

Browse files
committed
Merge locations feature branch
2 parents 00ec2ce + f0cb13b commit a198b12

49 files changed

Lines changed: 1513 additions & 33 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ try {
2121
Write-Host "Rule found"
2222
}
2323
catch [Exception] {
24-
New-NetFirewallRule -DisplayName eShopOnContainers-Inbound -Confirm -Description "eShopOnContainers Inbound Rule for port range 5100-5110" -LocalAddress Any -LocalPort 5100-5110 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Inbound
25-
New-NetFirewallRule -DisplayName eShopOnContainers-Outbound -Confirm -Description "eShopOnContainers Outbound Rule for port range 5100-5110" -LocalAddress Any -LocalPort 5100-5110 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Outbound
24+
New-NetFirewallRule -DisplayName eShopOnContainers-Inbound -Confirm -Description "eShopOnContainers Inbound Rule for port range 5100-5105" -LocalAddress Any -LocalPort 5100-5110 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Inbound
25+
New-NetFirewallRule -DisplayName eShopOnContainers-Outbound -Confirm -Description "eShopOnContainers Outbound Rule for port range 5100-5105" -LocalAddress Any -LocalPort 5100-5110 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Outbound
2626
}

docker-compose-windows.override.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,19 @@ services:
8080
- SA_PASSWORD=Pass@word
8181
- ACCEPT_EULA=Y
8282
ports:
83-
- "5433:1433"
83+
- "5433:1433"
84+
85+
nosql.data:
86+
ports:
87+
- "27017:27017"
88+
89+
locations.api:
90+
environment:
91+
- ASPNETCORE_ENVIRONMENT=Development
92+
- ASPNETCORE_URLS=http://0.0.0.0:80
93+
- ConnectionString=mongodb://nosql.data
94+
- Database=LocationsDb
95+
- identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
96+
- EventBusConnection=rabbitmq
97+
ports:
98+
- "5109:80"

docker-compose-windows.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,20 @@ services:
5353
- ordering.api
5454
- identity.api
5555
- basket.api
56-
56+
57+
locations.api:
58+
image: locations.api
59+
build:
60+
context: ./src/Services/Location/Locations.API
61+
dockerfile: Dockerfile
62+
depends_on:
63+
- nosql.data
64+
5765
sql.data:
5866
image: microsoft/mssql-server-windows
67+
68+
nosql.data:
69+
image: mongo:windowsservercore
5970

6071
basket.data:
6172
image: redis:nanoserver

docker-compose.override.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ services:
9292
ports:
9393
- "5433:1433"
9494

95+
nosql.data:
96+
ports:
97+
- "27017:27017"
98+
9599
webstatus:
96100
environment:
97101
- ASPNETCORE_ENVIRONMENT=Development
@@ -103,4 +107,15 @@ services:
103107
- mvc=http://webmvc/hc
104108
- spa=http://webspa/hc
105109
ports:
106-
- "5107:80"
110+
- "5107:80"
111+
112+
locations.api:
113+
environment:
114+
- ASPNETCORE_ENVIRONMENT=Development
115+
- ASPNETCORE_URLS=http://0.0.0.0:80
116+
- ConnectionString=mongodb://nosql.data
117+
- Database=LocationsDb
118+
- identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
119+
- EventBusConnection=rabbitmq
120+
ports:
121+
- "5109:80"

docker-compose.vs.debug.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,17 @@ services:
122122
labels:
123123
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
124124

125+
locations.api:
126+
image: eshop/locations.api:dev
127+
build:
128+
args:
129+
source: ${DOCKER_BUILD_SOURCE}
130+
environment:
131+
- DOTNET_USE_POLLING_FILE_WATCHER=1
132+
volumes:
133+
- ./src/Services/Location/Locations.API:/app
134+
- ~/.nuget/packages:/root/.nuget/packages:ro
135+
- ~/clrdbg:/clrdbg:ro
136+
entrypoint: tail -f /dev/null
137+
labels:
138+
- "com.microsoft.visualstudio.targetoperatingsystem=linux"

docker-compose.vs.release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,13 @@ services:
8080
entrypoint: tail -f /dev/null
8181
labels:
8282
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
83+
84+
locations.api:
85+
build:
86+
args:
87+
source: ${DOCKER_BUILD_SOURCE}
88+
volumes:
89+
- ~/clrdbg:/clrdbg:ro
90+
entrypoint: tail -f /dev/null
91+
labels:
92+
- "com.microsoft.visualstudio.targetoperatingsystem=linux"

docker-compose.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ services:
6868
sql.data:
6969
image: microsoft/mssql-server-linux
7070

71+
nosql.data:
72+
image: mongo
73+
7174
basket.data:
7275
image: redis
7376
ports:
@@ -83,4 +86,11 @@ services:
8386
build:
8487
context: ./src/Web/WebStatus
8588
dockerfile: Dockerfile
86-
89+
90+
locations.api:
91+
image: locations.api
92+
build:
93+
context: ./src/Services/Location/Locations.API
94+
dockerfile: Dockerfile
95+
depends_on:
96+
- nosql.data

eShopOnContainers-ServicesAndWebApps.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Health
7676
EndProject
7777
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventBus.Tests", "src\BuildingBlocks\EventBus\EventBus.Tests\EventBus.Tests.csproj", "{89D80DF1-32E1-4AAF-970F-DA0AA6881F9D}"
7878
EndProject
79+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Location", "Location", "{41139F64-4046-4F16-96B7-D941D96FA9C6}"
80+
EndProject
81+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Locations.API", "src\Services\Location\Locations.API\Locations.API.csproj", "{E7581357-FC34-474C-B8F5-307EE3CE05EF}"
82+
EndProject
7983
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataProtection", "DataProtection", "{88B22DBB-AA8F-4290-A454-2C109352C345}"
8084
EndProject
8185
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataProtection", "src\BuildingBlocks\DataProtection\DataProtection\DataProtection.csproj", "{23A33F9B-7672-426D-ACF9-FF8436ADC81A}"
@@ -1146,5 +1150,7 @@ Global
11461150
{DF395F85-B010-465D-857A-7EBCC512C0C2} = {A5260DE0-1FDD-467E-9CC1-A028AB081CEE}
11471151
{88B22DBB-AA8F-4290-A454-2C109352C345} = {DB0EFB20-B024-4E5E-A75C-52143C131D25}
11481152
{23A33F9B-7672-426D-ACF9-FF8436ADC81A} = {88B22DBB-AA8F-4290-A454-2C109352C345}
1153+
{41139F64-4046-4F16-96B7-D941D96FA9C6} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8}
1154+
{E7581357-FC34-474C-B8F5-307EE3CE05EF} = {41139F64-4046-4F16-96B7-D941D96FA9C6}
11491155
EndGlobalSection
11501156
EndGlobal

src/Mobile/eShopOnContainers/eShopOnContainers.Core/GlobalSettings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public string BaseEndpoint
4343

4444
public string IdentityEndpoint { get; set; }
4545

46+
public string LocationEndpoint { get; set; }
47+
4648
public string UserInfoEndpoint { get; set; }
4749

4850
public string LogoutEndpoint { get; set; }
@@ -62,6 +64,7 @@ private void UpdateEndpoint(string baseEndpoint)
6264
LogoutEndpoint = string.Format("{0}:5105/connect/endsession", baseEndpoint);
6365
IdentityCallback = string.Format("{0}:5105/xamarincallback", baseEndpoint);
6466
LogoutCallback = string.Format("{0}:5105/Account/Redirecting", baseEndpoint);
67+
LocationEndpoint = string.Format("{0}:5109", baseEndpoint);
6568
}
6669
}
6770
}

src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/Settings.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ private static ISettings AppSettings
2424
private const string IdToken = "id_token";
2525
private const string IdUseMocks = "use_mocks";
2626
private const string IdUrlBase = "url_base";
27+
private const string IdUseFakeLocation = "use_fake_location";
28+
private const string IdFakeLatitude = "fake_latitude";
29+
private const string IdFakeLongitude = "fake_longitude";
2730
private static readonly string AccessTokenDefault = string.Empty;
2831
private static readonly string IdTokenDefault = string.Empty;
2932
private static readonly bool UseMocksDefault = true;
33+
private static readonly bool UseFakeLocationDefault = false;
3034
private static readonly string UrlBaseDefault = GlobalSetting.Instance.BaseEndpoint;
3135

3236
#endregion
@@ -78,5 +82,40 @@ public static string UrlBase
7882
AppSettings.AddOrUpdateValue<string>(IdUrlBase, value);
7983
}
8084
}
85+
86+
public static bool UseFakeLocation
87+
{
88+
get
89+
{
90+
return AppSettings.GetValueOrDefault<bool>(IdUseFakeLocation, UseFakeLocationDefault);
91+
}
92+
set
93+
{
94+
AppSettings.AddOrUpdateValue<bool>(IdUseFakeLocation, value);
95+
}
96+
}
97+
98+
public static double FakeLatitude
99+
{
100+
get
101+
{
102+
return AppSettings.GetValueOrDefault<double>(IdFakeLatitude);
103+
}
104+
set
105+
{
106+
AppSettings.AddOrUpdateValue<double>(IdFakeLatitude, value);
107+
}
108+
}
109+
public static double FakeLongitude
110+
{
111+
get
112+
{
113+
return AppSettings.GetValueOrDefault<double>(IdFakeLongitude);
114+
}
115+
set
116+
{
117+
AppSettings.AddOrUpdateValue<double>(IdFakeLongitude, value);
118+
}
119+
}
81120
}
82121
}

0 commit comments

Comments
 (0)