Wednesday, January 17, 2007

Tips for the UnifiedFileSystem

Over the years I've come to learn a few things about the EPiServer UnifiedFileSystem (UFS from now on), some the easy way, but most the hard way. The following is a list of my recommendations for when setting up the UFS in a new site.


1. Always create a "System" share
A System share is a secure folder mapping in the UFS. It can allow read access to specific files as required, but should only allow website administrators access to create, modify and delete.


What I tend to use this type of share for is to store system files like XML source documents used in property drop-down lists and other system related files that may need to be edited at some time.


To set this sort of share up you will need to add something like the following to your web.config file:

<handler pageDirectory="False" virtualName="System" virtualShare="True" type="EPiServer.FileSystem.Handler.NativeFileSystem, EPiServer">
<customSettings PhysicalPath="D:\Websites\EPiSample\WebSystemFiles" />
</handler>


2. Secure the special "Pages" folder
Now I know doing this will cause extra load on the server as it has to check permissions on files etc, but not securing this location can cause a few security headaches down the track.


A few times now clients have come to me saying they have found some documents in their site using Google that should not be there. What had happened is Google had indexed the site and documents, then a page had expired, but the documents were still available by a direct link.


The solution to this is easy, secure the "Pages" folder. Doing this will ensure that files uploaded to a page folder will get the same permissions applied to them as the page. So if the page expires, then so do the files! To configure a secure pages folder you will need to add something like the following to your web.config file:

<handler pageDirectory="True" virtualName="pages" virtualShare="True" type="EPiServer.FileSystem.Handler.NativeFileSystem, EPiServer">
<customSettings PhysicalPath="D:\Websites\EPiSample\Pages" />
</handler>


3. Create an MS Indexing Service cataglog for your site
To make the search work correctly in the File Manager you really need to configure a catalog for your site. Even if you are using a different search tool for your public site, it's important to configure MS Indexing Server for your user's when using the File Manager search.


You will only need to create one catalog, as long as it indexes all your files, as EPiServer will automatically set the search scope when searching in File Manager. To configure a catalog for the UFS you will need to add something like the following to your handlers in the web.config (except for any versioned file shares as they have their own search capabilities):

<handler pageDirectory="True" virtualName="pages" virtualShare="True" type="EPiServer.FileSystem.Handler.NativeFileSystem,EPiServer">
<customSettings IndexCatalog="EPiSampleCatalog" PhysicalPath="D:\Websites\EPiSample\Pages" />
</handler>

All this information and a lot more can be found in the technical note "Unified File System"

No comments: