CMS Project Settings

Contents

The CMS project is a standard Umbraco project and is provided in an almost default configuration, with a few exceptions as follows.

โš ๏ธ Sensitive data such as API keys and credentials should be handled and stored securely. The ASP.NET docs provide some guidelines around security and user secrets.

Delivery API

Of course, the Delivery API must be enabled so that Eleventy can query it for content. In order to encourage a "secure by default" approach, PublicAccess is disabled, and a randomly generated API key is set:

{
	"Umbraco": {
		"CMS": {
			"DeliveryApi": {
				"Enabled": true,
				"PublicAccess": false,
				"ApiKey": "11111111-1111-1111-1111-111111111111"
			}
		}
	}
}

See the Umbraco Content Delivery API docs for more information.

Unattended install

Umbraco unattended installs are supported via the template command line parameters. These will be configured in appsettings.Development.json:

{
	"Umbraco": {
		"CMS": {
			"Unattended": {
				"InstallUnattended": true,
				"UnattendedUserName": "Adm1n1strator",
				"UnattendedUserEmail": "adm1n@fr1end1y.local",
				"UnattendedUserPassword": "11111111111"
			}
		}
	}
}

Connection strings

If you opted for an unattended install, the appropriate connection string will also be set in appsettings.Development.json:

{
	"ConnectionStrings": {
		"umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True",
		"umbracoDbDSN_ProviderName": "Microsoft.Data.Sqlite"
	}
}

If you performed a manual install then your chosen settings will be placed in appsettings.json.

uSync

uSync FirstBoot is enabled so that the demo content is loaded when the CMS is first launched:

{
	"uSync": {
		"Settings": {
			"ImportOnFirstBoot": true
		}
	}
}

Other than that, the default uSync settings apply.

Experimental features

If you dig into the source code, you may come across some custom settings I have been experimenting with, which are disabled by default:

{
	"Thingy": {
		"ServeEleventySite": false,
		"EleventyOutputDir": "../Fr1end1y.Site/_site/",
		"BuildEleventySite": false,
		"EleventyRootDir": "../Fr1end1y.Site/"
	}
}

ServeEleventySite

When set to true, ASP.NET will be configured to serve static files from the Eleventy output directory (EleventyOutputDir).

This means when you access the Umbraco front end, you will see the static site, as if it had been rendered by Umbraco itself.

EleventyOutputDir

The directory containing the static site generated by Eleventy, relative to IHostEnvironment.ContentRootPath (in this case the CMS project directory).

This is used when ServeEleventySite is enabled to locate the static site on the file system.

BuildEleventySite

When set to true, an Eleventy build will be triggered when content is published.

The command npm run build-site will be executed in the Eleventy project directory (EleventyRootDir) when Umbraco fires a ContentPublishedNotification (that is, when content is published).

When this setting is enabled with ServeEleventySite, you can avoid running the Eleventy Dev Server and just run the CMS by itself (but note that the browser won't automatically reload the page when changes are made).

EleventyRootDir

The root directory of the Eleventy project, relative to IHostEnvironment.ContentRootPath (in this case the CMS project directory).

This is used when BuildEleventySite is enabled to build the static site when content is published.