Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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=
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

return [
'*' => [
'id' => App::env('CRAFT_APP_ID') ?: 'CraftCMS',
'components' => [
'deprecator' => [
'throwExceptions' => (bool) APP::env('HARD_MODE'),
Expand Down
44 changes: 17 additions & 27 deletions config/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
11 changes: 11 additions & 0 deletions config/htmlpurifier/Default.json
Original file line number Diff line number Diff line change
@@ -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/)%"
}