-
Notifications
You must be signed in to change notification settings - Fork 3
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
Configuration provider that loads configs from shell settings (OSOE-637) #65
Comments
Here some thoughts as I remember. There are 2 config flows, required settings and shell config that at the end are respectively persisted in Let's only talk about the shell config flow. So Doing this way, for now we can only update simple strings, maybe something to extend here. Another way is to override |
Yep, I was thinking about storing strings (or rather, only strings would be stored in However, are you saying that what's by default in tenant-specific appsettings file can also be stored in the DB, i.e. what I envision here is actually already possible? |
Yes, Hmm, yes if you can edit and save the related Document and then release / reload the shell it may work, but normally we update first the Would need to think about it, maybe not a problem to edit directly the Document if we don't update shell settings but only shell configuration. |
Oh, I see what you mean now. Yes, I was aware of these but it's not the same as what I'm looking for here. So while yes, there are tenant-specific appsettings files, with the content like below: {
"DatabaseProvider": "Sqlite",
"FeatureProfile": "standard-tenant",
...
} ...and these will be loaded into
Instead, I'd like to load this from the shell settings, i.e. be able to have a value in the tenant-specific appsettings file or in the shell settings document in the DB, that'll be accessible as exactly this |
Okay then, if you only have strings to config I would recommend to use the Note: So you can update the shell settings by using the indexer and then call If you have more complex data to config, maybe edit directly the appsettings (or db document) but you will have to merge data (not override existing values) and then still reload the shell. In case of the file not obvious to be thread safe, for example if a tenant is edited and saved at the same time, this is in the settings manager that we use an internal semaphore (but that you can't use externally). |
Ah I see, thank you! I thought about merging these configs into |
Let's add an ASP.NET configuration provider (see
IConfiguration
) that loads configs from the current tenant's shell settings, playing along with Orchard's built-in tenant postconfiguration.This would allow us to configure tenant-specific settings in a way that's separated by tenant, not all together in the same appsettings.json file or app configuration of an Azure App Service. This includes settings like media storage quota settings, idle shutdown timeouts, or even password requirements.
To make this easier to utilize, let's do #66 too.
Jira issue
The text was updated successfully, but these errors were encountered: