-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Azure and AWS-specific Image Caches of ImageSharp (Lombiq Technologies: OCORE-136) #15028
Merged
Merged
Changes from 59 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
1d1d03a
Adding basic prototype
Piedone 831a55e
Adding the first draft of the Azure Media ImageSharp Image Cache feature
Piedone f63afd5
Docs
Piedone b97171c
Refactoring
Piedone d92ce82
Fixing the docs link in CONTRIBUTING.md
Piedone db5b9b0
Merge remote-tracking branch 'official/main' into issue/OCORE-136
Piedone 930d41d
MD syntax fix
Piedone 20beeaa
TemplateContext factory method instead of initialization method
Piedone 572412a
Code styling
Piedone 254848b
Eager option access
Piedone eabc330
Lazy initialization for FluidParserHelper
Piedone 60f16e3
Simplified option binding
Piedone d7fb2ec
Using ToLowerInvariant() to generate the container names instead of t…
Piedone 73aa34d
Factoring out option validation check to method
Piedone 6b05f4e
File-scoped namespaces
Piedone 57b7c84
Using method lookups for configuration values instead of the dictiona…
Piedone 9cf574c
Merge remote-tracking branch 'origin/main' into issue/OCORE-136
Piedone bea7554
Adding BasePath support for Azure Blob ImageSharp cache
Piedone f22fc72
Merge remote-tracking branch 'official/main' into issue/OCORE-136
Piedone 2f1378c
"Blob" typos
Piedone da23340
Merge remote-tracking branch 'origin/main' into issue/OCORE-136
Piedone 9f77673
Removing empty docs
Piedone d33b463
Code styling
Piedone 3042c8d
Shorter config binding
Piedone 171b686
Formatting
Piedone 8609f53
Removing the "Microsoft" prefix from some Azure wording
Piedone cf3abea
Docs wording
Piedone f73dba3
Merge remote-tracking branch 'origin/main' into issue/OCORE-136
Piedone bb7f327
Moving S3 services to a namespace in anticipation of new services
Piedone 548a8df
Code styling
Piedone e47985c
Docs link
Piedone 502cd27
Better name for Azure Blob services
Piedone 96abf72
Even better names
Piedone 564fec1
Basics of AWS ImageSharp cache
Piedone 23af590
Making it possible to use local S3 emulators
Piedone aa1330f
Fixing S3 file uploads
Piedone d0f41ab
Documenting using local S3 emulators
Piedone f2c8598
Merge remote-tracking branch 'origin/issue/OCORE-153' into issue/OCOR…
Piedone 657e660
Adding dependency on the storage feature due to IAmazonS3
Piedone 94b6fca
Dry config Fluid parsing
Piedone ce2a097
Rename
Piedone 6d25a32
DRY Trim()
Piedone d44be33
Fix type parameters
Piedone 0704d81
Fixing copy-paste errors
Piedone f297e99
TenantEvents DRY
Piedone 13f5b37
Appsettings docs
Piedone 5dd7d33
Docs
Piedone 3a1d010
Fixing docs navigation
Piedone 5fc658b
DRY
Piedone acb8b06
Merge remote-tracking branch 'official/main' into issue/OCORE-136
Piedone f94bea9
Merge remote-tracking branch 'official/main' into issue/OCORE-136
Piedone 14750b1
Fixing new analyzer violations
Piedone 3a797ab
Removing unnecessary interface
Piedone d6efce8
Seal of approval
Piedone 988e7d2
Adding common const for the Media module's Startup
Piedone 5bc8efb
Renaming IsValid() to IsConfigured()
Piedone 00418e7
More specific names for const classes
Piedone d40f1ba
Better feature description
Piedone daa1657
Merge remote-tracking branch 'official/main' into issue/OCORE-136
Piedone fc6d725
Merge remote-tracking branch 'official/main' into issue/OCORE-136
Piedone a91d5b6
Merge branch 'main' into issue/OCORE-136
Piedone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AmazonS3Constants.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace OrchardCore.Media.AmazonS3; | ||
|
||
internal static class AmazonS3Constants | ||
{ | ||
internal static class ValidationMessages | ||
{ | ||
public const string BucketNameIsEmpty = "BucketName is required attribute for S3 storage."; | ||
public const string RegionAndServiceUrlAreEmpty = "Region or ServiceURL is a required attribute for S3 storage."; | ||
} | ||
|
||
internal static class AwsCredentialParamNames | ||
{ | ||
public const string SecretKey = "SecretKey"; | ||
public const string AccessKey = "AccessKey"; | ||
} | ||
|
||
internal static class ConfigSections | ||
{ | ||
public const string AmazonS3 = "OrchardCore_Media_AmazonS3"; | ||
public const string AmazonS3ImageSharpCache = "OrchardCore_Media_AmazonS3_ImageSharp_Cache"; | ||
} | ||
} |
80 changes: 0 additions & 80 deletions
80
src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/AwsStorageOptionsConfiguration.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/Constants.cs
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
src/OrchardCore.Modules/OrchardCore.Media.AmazonS3/Helpers/OptionsFluidParserHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Fluid; | ||
using OrchardCore.Environment.Shell; | ||
|
||
namespace OrchardCore.Media.AmazonS3.Helpers; | ||
|
||
// This is almost the same as in OrchardCore.Media.Azure but there isn't really a good common place for it. | ||
MikeAlhayek marked this conversation as resolved.
Show resolved
Hide resolved
|
||
internal sealed class OptionsFluidParserHelper<TOptions> where TOptions : class | ||
{ | ||
// Local instance since it can be discarded once the startup is over. | ||
private readonly FluidParser _fluidParser = new(); | ||
private readonly ShellSettings _shellSettings; | ||
|
||
private TemplateContext _templateContext; | ||
|
||
public OptionsFluidParserHelper(ShellSettings shellSettings) | ||
{ | ||
_shellSettings = shellSettings; | ||
} | ||
|
||
public string ParseAndFormat(string template) | ||
{ | ||
var templateContext = GetTemplateContext(); | ||
|
||
// Use Fluid directly as this is transient and cannot invoke _liquidTemplateManager. | ||
var parsedTemplate = _fluidParser.Parse(template); | ||
return parsedTemplate.Render(templateContext, NullEncoder.Default) | ||
.Replace("\r", string.Empty) | ||
.Replace("\n", string.Empty) | ||
.Trim(); | ||
} | ||
|
||
private TemplateContext GetTemplateContext() | ||
{ | ||
if (_templateContext == null) | ||
{ | ||
var templateOptions = new TemplateOptions(); | ||
_templateContext = new TemplateContext(templateOptions); | ||
templateOptions.MemberAccessStrategy.Register<ShellSettings>(); | ||
templateOptions.MemberAccessStrategy.Register<TOptions>(); | ||
_templateContext.SetValue("ShellSettings", _shellSettings); | ||
} | ||
|
||
return _templateContext; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as the section on the page: https://docs.orchardcore.net/en/latest/docs/reference/#search-indexing-querying And that looks good so, since while these are tightly related topics, it's not just search (like SQL queries have nothing to do with search, but queries in general do relate to Lucene and Elasticsearch, which are about indexing, and usually, but not necessarily search...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term should be Search. `Indexing and Querying are implementation details for search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indexing maybe, but Queries is about much more than search. SQL Queries (i.e. the module feature) doesn't have anything to do with search nor indexing, and you can use both Lucene and Elasticsearch querying (e.g. listing all content items with the type Blog Post) without utilizing them for full-text search. That's why I'm saying these three are tightly related, but the whole feature set is neither just search, nor just querying, nor just indexing.