Click or drag to resize

HoarderConfiguration Class

Encapsulates all possible configuration values for the Hoarder suite. The static LoadAsync(String) method can be used to deserialize an instance from a JSON file accessible at a specified Uri (which may be a http:// address or a local file:// address). The JSON file must have exactly the same schema as the fields in this class. A sample JSON file is provided in this project.

Five of the configuration values are secrets known only to the person testing or hosting the Hoarder suite. The secret values are deserialized from the JSON file if it defines them, then an overriding value for each secret is taken from an Environment variable if one exists. Environment variables can be used to provide the secrets for the suite when it is hosted in a trusted environment such as a local PC or web hosting.

Inheritance Hierarchy
System.Object
  Orthogonal.Hoarder.StdLib.HoarderConfiguration

Namespace: Orthogonal.Hoarder.StdLib
Assembly: Orthogonal.Hoarder.StdLib (in Orthogonal.Hoarder.StdLib.dll) Version: 8.0.9
Syntax
C#
[SerializableAttribute]
public sealed class HoarderConfiguration : ICloneable

The HoarderConfiguration type exposes the following members.

Constructors
 NameDescription
Public methodHoarderConfigurationInitializes a new instance of the HoarderConfiguration class
Top
Properties
 NameDescription
Public propertyBackupConnect SECRET -- Connection string to an Azure Storage Account where Hoarder stores backup data.
Public propertyBackupContainerName Name of the Azure Container that contains backup files.
Public propertyBlobPathSeparator Path separator for pseido-folders in Azure blob containers.
Public propertyDatabaseCollectionId The Cosmos database collection Id as defined in the Azure portal.
Public propertyDatabaseEndpoint The Uri endpoint of the Cosmos database containing the collections database.
Public propertyDatabaseId The Cosmos database Id as defined in the Azure portal.
Public propertyDbKey SECRET -- The key to access the Azure Cosmos Database containing the Hoarder collections database records.
Public propertyHomeOwners SECRET -- Comma joined list of Nancy Steet home owners.
Public propertyKeyRoles An optional array of strings in the format "key,role,role,..." that assign role(s) to a request header authorisation key.
Public propertyPartitionKey The Partition Key for the collection database. Because the collection only contains several thousand documents and multi-partition high-performance queries are not needed, the PK is set to the constant value "P1".
Public propertyPhotosContainerName Name of the Azure Container that contains original full-size photo image blobs.
Public propertyPhotosContainerUri Public Uri of the original full-size photo blobs Azure Container.
Public propertyPicExtensions A set of file-system file extensions (with leading dot) that the app recognises as containing parsable images.
Public propertyPicMetaExtensions A set of Azure blob file extensions (with leading dot) that the app recognises as containing parsable images.
Public propertyStorageConnect SECRET -- Connection string to an Azure Storage Account where Hoarder stores picture blobs and other general non-backup data.
Public propertyThumbnailExtension The extension (with leading dot) to be used on thumbnail files and blobs. Every thumbnail currently has a '.jpg' extension because they are the easier to create with the .NET media and image classes.
Public propertyThumbnailQuality JPEG image encoder quality for thumbnail images.
Public propertyThumbnailsContainerName Name of the Azure Container that contains thumnail photo image blobs.
Public propertyThumbnailsContainerUri Public Uri of the thumbnail photo blobs Azure Container.
Public propertyThumbnailSize The default thumbnail image width and height constraint size square. Images are proportionally resized to fit inside the width and height size constraints.
Public propertyTruthPhotosFolder The file-system folder containing 'master' images (aka the source of 'truth' images).
Public propertyTruthThumbnailsFolder The file-system folder containing thumnail images.
Public propertyWebPictureColumnCount Number of columns in tables of images inserted into web pages.
Public propertyWebRootFolder The file-system root folder of the website containing pages that contain special delimiters that accept data exported from the collections database.
Top
Methods
 NameDescription
Public methodClone Creates a shallow clone of the configuration (which is sufficient).
Public methodGetRolesForKey Gets the role names that are assigned to an API Key.
Public methodStatic memberLoadAsync Deserializes the Hoarder configuration values from a JSON document at a specified local or remote Uri. Some 'secret' values in the config document may be overriden by environment variables with the same name as the properties, which is useful in testing. Top-level apps using the Hoarder web service will typically call this method very early in app lifetime so the configuration values are loaded.
Top
Fields
See Also