Skip to content

Commit cf7dc71

Browse files
authored
Merge pull request #13 from geeklearningio/release/0.3.0
Release/0.3.0
2 parents 3e21e86 + 03b5d4b commit cf7dc71

File tree

63 files changed

+1792
-170
lines changed

Some content is hidden

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

63 files changed

+1792
-170
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,4 +242,5 @@ ModelManifest.xml
242242
.paket/paket.exe
243243

244244
# FAKE - F# Make
245-
.fake/
245+
.fake/
246+
/tests/GeekLearning.Integration.Test/appsettings.development.json

GeekLearning.Storage.sln

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
4+
VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Storage", "src\GeekLearning.Storage\GeekLearning.Storage.xproj", "{1F419C53-73C6-4460-B284-6A49AE41C596}"
77
EndProject
@@ -21,10 +21,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2121
ProjectSection(SolutionItems) = preProject
2222
.gitattributes = .gitattributes
2323
.gitignore = .gitignore
24+
GitVersion.yml = GitVersion.yml
25+
global.json = global.json
2426
LICENSE.md = LICENSE.md
2527
README.md = README.md
2628
EndProjectSection
2729
EndProject
30+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Storage.FileSystem.Server", "src\GeekLearning.Storage.FileSystem.Server\GeekLearning.Storage.FileSystem.Server.xproj", "{9D94CD6C-9451-449A-BED2-1C07D624A8E0}"
31+
EndProject
2832
Global
2933
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3034
Debug|Any CPU = Debug|Any CPU
@@ -51,6 +55,10 @@ Global
5155
{590B21B0-2AFA-4329-82AD-EF180C50EB5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
5256
{590B21B0-2AFA-4329-82AD-EF180C50EB5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
5357
{590B21B0-2AFA-4329-82AD-EF180C50EB5C}.Release|Any CPU.Build.0 = Release|Any CPU
58+
{9D94CD6C-9451-449A-BED2-1C07D624A8E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59+
{9D94CD6C-9451-449A-BED2-1C07D624A8E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
60+
{9D94CD6C-9451-449A-BED2-1C07D624A8E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
61+
{9D94CD6C-9451-449A-BED2-1C07D624A8E0}.Release|Any CPU.Build.0 = Release|Any CPU
5462
EndGlobalSection
5563
GlobalSection(SolutionProperties) = preSolution
5664
HideSolutionNode = FALSE

GitVersion.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
branches:
2+
dev(elop)?(ment)?$:
3+
tag: alpha
4+
features?[/-]:
5+
tag: alpha.{BranchName}
6+
releases?[/-]:
7+
mode: ContinuousDeployment
8+
hotfix(es)?[/-]:
9+
mode: ContinuousDeployment

global.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"sdk" : { "version": "1.0.0-preview2-003121"},
3+
"projects": [ "src", "tests", "samples" ]
4+
}

samples/GeekLearning.Storage.BasicSample/Controllers/ValuesController.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ public ValuesController(TemplatesStore templates)
2222
public async Task<IEnumerable<string>> Get()
2323
{
2424

25-
return new string[] { await templates.Store.ReadAllText("json.json"), "value2" };
25+
return new string[] { await templates.Store.ReadAllTextAsync("json.json"), "value2" };
2626
}
2727

2828
// GET api/values/5
29-
[HttpGet("{id}")]
30-
public string Get(int id)
29+
[HttpGet("files")]
30+
public async Task<IEnumerable<string>> Get(int id)
3131
{
32-
return "value";
32+
var files = await templates.Store.ListAsync("");
33+
return files.Select(x => x.PublicUrl);
3334
}
3435

3536
// POST api/values

samples/GeekLearning.Storage.BasicSample/Startup.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Microsoft.Extensions.Configuration;
88
using Microsoft.Extensions.DependencyInjection;
99
using Microsoft.Extensions.Logging;
10+
using System.Security.Cryptography;
1011

1112
namespace GeekLearning.Storage.BasicSample
1213
{
@@ -20,18 +21,33 @@ public Startup(IHostingEnvironment env)
2021
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
2122
.AddEnvironmentVariables();
2223
Configuration = builder.Build();
24+
HostingEnvironement = env;
2325
}
2426

2527
public IConfigurationRoot Configuration { get; }
28+
public IHostingEnvironment HostingEnvironement { get; }
2629

2730
// This method gets called by the runtime. Use this method to add services to the container.
2831
public void ConfigureServices(IServiceCollection services)
2932
{
3033
// Add framework services.
3134
services.AddMvc();
3235

33-
services.AddStorage().AddAzureStorage().AddFileSystemStorage();
36+
var rng = RandomNumberGenerator.Create();
37+
byte[] signingKey = new byte[512];
38+
rng.GetBytes(signingKey);
39+
40+
services.AddStorage()
41+
.AddAzureStorage()
42+
.AddFileSystemStorage(HostingEnvironement.ContentRootPath)
43+
.AddFileSystemStorageServer(options=> {
44+
options.SigningKey = signingKey;
45+
options.BaseUri = new Uri("http://localhost:11149/");
46+
});
47+
3448
services.Configure<StorageOptions>(Configuration.GetSection("Storage"));
49+
50+
services.AddScoped<TemplatesStore>();
3551
}
3652

3753
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -40,6 +56,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
4056
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
4157
loggerFactory.AddDebug();
4258

59+
app.UseFileSystemStorageServer();
60+
4361
app.UseMvc();
4462
}
4563
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"value": "test"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"answer": "42"
3+
}

samples/GeekLearning.Storage.BasicSample/appsettings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,16 @@
66
"System": "Information",
77
"Microsoft": "Information"
88
}
9+
},
10+
"Storage": {
11+
"Stores": {
12+
"Templates": {
13+
"Provider": "FileSystem",
14+
"Parameters": {
15+
"Path": "Templates",
16+
"Access" : "Public"
17+
}
18+
}
19+
}
920
}
1021
}

samples/GeekLearning.Storage.BasicSample/project.json

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
11
{
22
"dependencies": {
33
"Microsoft.NETCore.App": {
4-
"version": "1.0.0-rc2-3002702",
4+
"version": "1.0.0",
55
"type": "platform"
66
},
7-
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
8-
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
9-
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
10-
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
11-
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final",
12-
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
13-
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
14-
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
15-
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
16-
"Microsoft.Extensions.Options": "1.0.0-rc2-final",
17-
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-rc2-final",
7+
"Microsoft.AspNetCore.Mvc": "1.0.0",
8+
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
9+
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
10+
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
11+
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
12+
"Microsoft.Extensions.Configuration.Json": "1.0.0",
13+
"Microsoft.Extensions.Logging": "1.0.0",
14+
"Microsoft.Extensions.Logging.Console": "1.0.0",
15+
"Microsoft.Extensions.Logging.Debug": "1.0.0",
16+
"Microsoft.Extensions.Options": "1.0.0",
17+
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
1818
"GeekLearning.Storage": "*",
1919
"GeekLearning.Storage.Azure": "*",
20-
"GeekLearning.Storage.FileSystem": "*"
20+
"GeekLearning.Storage.FileSystem": "*",
21+
"GeekLearning.Storage.FileSystem.Server": "*"
2122
},
2223

2324
"tools": {
24-
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
25-
"version": "1.0.0-preview1-final",
26-
"imports": "portable-net45+win8+dnxcore50"
27-
}
25+
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
2826
},
2927

3028
"frameworks": {
3129
"netcoreapp1.0": {
3230
"imports": [
3331
"dotnet5.6",
34-
"dnxcore50",
3532
"portable-net45+win8"
3633
]
3734
}
@@ -43,7 +40,9 @@
4340
},
4441

4542
"runtimeOptions": {
46-
"gcServer": true
43+
"configProperties": {
44+
"System.GC.Server": true
45+
}
4746
},
4847

4948
"publishOptions": {

0 commit comments

Comments
 (0)