diff --git a/.env.example b/.env.example index 125d535..8f1475b 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ # Read about configuration, here: -# https://craftcms.com/docs/4.x/config/ +# https://craftcms.com/docs/5.x/configure.html CRAFT_APP_ID= CRAFT_ENVIRONMENT=dev CRAFT_SECURITY_KEY= @@ -15,18 +15,15 @@ CRAFT_DB_SCHEMA=public CRAFT_DB_TABLE_PREFIX= # General settings (see config/general.php) -ALLOW_UPDATES=1 -ALLOW_ADMIN_CHANGES=1 -BACKUP_ON_UPDATE=1 -CP_TRIGGER=admin -DEV_MODE=1 -ENABLE_TEMPLATE_CACHING=0 -ENVIRONMENT=local -HARD_MODE=1 -IMAGE_DRIVER=imagick -IS_SYSTEM_LIVE=1 +CRAFT_DEV_MODE=1 +CRAFT_ENABLE_TEMPLATE_CACHING=0 +CRAFT_IMAGE_DRIVER=imagick +CRAFT_IS_SYSTEM_LIVE=1 +CRAFT_TEST_TO_EMAIL_ADDRESS= + +# App settings PRIMARY_SITE_URL=https://craftcms.ddev.site/ -TEST_TO_EMAIL_ADDRESS= +HARD_MODE=1 # SMTP SMTP_HOST=127.0.0.1 diff --git a/config/app.php b/config/app.php index 9634a7f..070134f 100644 --- a/config/app.php +++ b/config/app.php @@ -26,6 +26,7 @@ return [ '*' => [ + 'id' => App::env('CRAFT_APP_ID') ?: 'CraftCMS', 'components' => [ 'deprecator' => [ 'throwExceptions' => (bool) APP::env('HARD_MODE'), diff --git a/config/general.php b/config/general.php index e0a0c9d..0eb4dda 100644 --- a/config/general.php +++ b/config/general.php @@ -12,34 +12,24 @@ use craft\config\GeneralConfig; use craft\helpers\App; -return [ - 'aliases' => [ +return GeneralConfig::create() + ->aliases([ '@web' => rtrim(APP::env('PRIMARY_SITE_URL'), '/'), '@webroot' => dirname(__DIR__) . '/web', - ], - 'allowUpdates' => (bool) App::env('ALLOW_UPDATES'), - 'allowAdminChanges' => (bool) App::env('ALLOW_ADMIN_CHANGES'), - 'backupOnUpdate' => (bool) App::env('BACKUP_ON_UPDATE'), - 'cpTrigger' => App::env('CP_TRIGGER') ?: 'admin', - 'defaultSearchTermOptions' => [ + ]) + ->defaultSearchTermOptions([ 'subLeft' => true, 'subRight' => true, - ], - 'defaultTokenDuration' => 'P1W', - 'defaultWeekStartDay' => 0, - 'devMode' => (bool) App::env('DEV_MODE'), - 'enableGql' => false, - 'enableTemplateCaching' => (bool) App::env('ENABLE_TEMPLATE_CACHING'), - 'imageDriver' => App::env('IMAGE_DRIVER'), - 'isSystemLive' => (bool) App::env('IS_SYSTEM_LIVE'), - 'maxRevisions' => 10, - 'omitScriptNameInUrls' => true, - 'preserveCmykColorspace' => true, - 'preserveImageColorProfiles' => true, - 'preventUserEnumeration' => true, - 'previewTokenDuration' => 'P1W', - 'testToEmailAddress' => App::env('TEST_TO_EMAIL_ADDRESS') ?: null, - 'timezone' => 'UTC', - 'transformGifs' => false, - 'useEmailAsUsername' => true, -]; + ]) + ->defaultTokenDuration('P1W') + ->defaultWeekStartDay(0) + ->enableGql(false) + ->maxRevisions(10) + ->omitScriptNameInUrls(true) + ->preserveCmykColorspace(true) + ->preserveImageColorProfiles(true) + ->preventUserEnumeration(true) + ->previewTokenDuration('P1W') + ->timezone('UTC') + ->transformGifs(false) + ->useEmailAsUsername(true); diff --git a/config/htmlpurifier/Default.json b/config/htmlpurifier/Default.json new file mode 100644 index 0000000..fd688f3 --- /dev/null +++ b/config/htmlpurifier/Default.json @@ -0,0 +1,11 @@ +{ + "Attr.AllowedFrameTargets": [ + "_blank" + ], + "Attr.EnableID": true, + "HTML.AllowedComments": [ + "pagebreak" + ], + "HTML.SafeIframe": true, + "URI.SafeIframeRegexp": "%^(https?:)?//(www.youtube.com/|player.vimeo.com/)%" +}