A security package for Umbraco. Lock down an Umbraco website from viewers. Only users who are logged into the backoffice can see the public website.
This package is supported on:
SiteLock is available from Our Umbraco, NuGet, or as a manual download directly from GitHub.
You can find a downloadable package, along with a discussion forum for this package, on the Our Umbraco site.
To install from NuGet, run the following command in your instance of Visual Studio.
PM> Install-Package Cogworks.SiteLock
SiteLock is simply a module which is loaded dymically at runtime. It inspects the domain of each request, and then either allows it, or throws a HttpException with a status code of 403.
After installing the package, you'll be able to lock any website via /config/SiteLock.config.
This section of the configuration specifies specific domains to be locked in the Umbraco instance.
Example:
<lockedDomains>
<domain>localhost</domain>
<domain>staging.sitelock.local</domain>
</lockedDomains>
To lock all domains, simply use *. Example:
<lockedDomains>
<domain>*</domain>
</lockedDomains>
This section of the configuration allows you to specify paths which can be allowed.
Example:
<allowedPaths>
<path>^/news(.*)</path>
<path>/403.html</path>
</allowedPaths>
Note that the paths are actually regular expressions. So in the example above, we allow paths which "start with" /news/.
This section of the configuration allows you to specify IPs which can be allowed.
Example:
<allowedIps>
<ip>127.0.0.1</ip>
</allowedIps>
Changes to /config/SiteLock.config will require an application restart, as the config file cached at startup.
SiteLock was designed to be simple for developers. Just install via nuget or the Umbraco backoffice. Configure /config/SiteLock.config and you're good to go.
To raise a new bug, create an issue on the GitHub repository. To fix a bug or add new features, fork the repository and send a pull request with your changes. Feel free to add ideas to the repository's issues list if you would to discuss anything related to the package.
This project is maintained by Cogworks and contributors. If you have any questions about the project please contact us through the forum on Our Umbraco, on Twitter, or by raising an issue on GitHub.
Copyright © 2017 The Cogworks Ltd, and other contributors
Licensed under the MIT License.