forked from wintercms/winter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into wip-laravel-11
- Loading branch information
Showing
16 changed files
with
122 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,8 +112,8 @@ | |
'updates_pending' => 'Pending software updates', | ||
'updates_nil' => 'Software is up to date', | ||
'updates_link' => 'Update', | ||
'warnings_pending' => 'Some issues need attention', | ||
'warnings_nil' => 'No warnings to display', | ||
'warnings_pending' => 'Some Winter CMS configuration issues need attention', | ||
'warnings_nil' => 'Your Winter CMS installation is configured correctly', | ||
'warnings_link' => 'View', | ||
'core_build' => 'System build', | ||
'event_log' => 'Event log', | ||
|
@@ -369,14 +369,18 @@ | |
'mass_assignment_failed' => "Mass assignment failed for Model attribute ':attribute'.", | ||
], | ||
'warnings' => [ | ||
'tips' => 'System configuration tips', | ||
'tips_description' => 'There are issues you need to pay attention to in order to configure the system properly.', | ||
'permissions' => 'Directory :name or its subdirectories is not writable for PHP. Please set corresponding permissions for the webserver on this directory.', | ||
'extension' => 'The PHP extension :name is not installed. Please install this library and activate the extension.', | ||
'plugin_missing' => 'The plugin :name is a dependency but is not installed. Please install this plugin.', | ||
'debug' => 'Debug mode is enabled. This is not recommended for production installations.', | ||
'decompileBackendAssets' => 'Assets in the Backend are currently decompiled. This is not recommended for production installations.', | ||
'tips' => 'Winter CMS configuration recommendations', | ||
'tips_description' => 'We have detected some issues with your configuration that may compromise the security, functionality or performance of your Winter CMS installation. Please review the issues below.', | ||
'how_to_fix' => 'How to fix', | ||
'permissions' => 'Directory :name or its subdirectories is not writable for PHP. Please ensure that this directory and all subdirectories are writable by your hosting environment.', | ||
'extension' => 'The PHP extension :name is not installed. Please install and activate this PHP extension in your hosting environment.', | ||
'plugin_missing' => 'The plugin :name is a dependency of an installed plugin but is not available. Please install this plugin.', | ||
'debug' => 'Debug mode is enabled. This is not recommended for production installations as it may reveal sensitive information only intended for developers.', | ||
'decompileBackendAssets' => 'Assets in the Backend are currently decompiled. This is not recommended for production installations as it may affect performance.', | ||
'default_backend_user' => 'A user with the default login details (admin / [email protected]) was found. Change their username and / or email address to help protect the system.', | ||
'auth_throttle_disabled' => 'Backend authentication throttling is disabled. This is not recommended for production installations as it may allow malicious users to brute-force user passwords.', | ||
'csrf' => 'CSRF protection is disabled. This is not recommended for production installations as it compromises the security of the installations and may allow cross-site scripting attacks.', | ||
'restrict_base_dir' => 'The base directory restriction is disabled. This is not recommended for production installations as it may allow themes and configuration files to access files outside of your Winter CMS installation.', | ||
], | ||
'editor' => [ | ||
'menu_label' => 'Editor settings', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,19 +99,46 @@ protected function getSystemWarnings() | |
$writablePaths[] = themes_path(); | ||
} | ||
|
||
// Warn if debug mode is enabled - this is a security risk | ||
if (Config::get('app.debug', true)) { | ||
$warnings[] = Lang::get('backend::lang.warnings.debug'); | ||
$warnings[] = [ | ||
'message' => Lang::get('backend::lang.warnings.debug'), | ||
'fixUrl' => 'https://wintercms.com/docs/v1.2/docs/setup/configuration#debug-mode', | ||
]; | ||
} | ||
|
||
if (Config::get('develop.decompileBackendAssets', false)) { | ||
$warnings[] = Lang::get('backend::lang.warnings.decompileBackendAssets'); | ||
// Warn if CSRF protection is disabled - this is a security risk | ||
if (Config::get('cms.enableCsrfProtection', true) === false) { | ||
$warnings[] = [ | ||
'message' => Lang::get('backend::lang.warnings.csrf'), | ||
'fixUrl' => 'https://wintercms.com/docs/v1.2/docs/setup/configuration#csrf-protection', | ||
]; | ||
} | ||
|
||
// Warn if backend auth throttling is disabled - this is a security risk | ||
if (Config::get('auth.throttle.enabled', true) === false) { | ||
$warnings[] = [ | ||
'message' => Lang::get('backend::lang.warnings.auth_throttle_disabled'), | ||
]; | ||
} | ||
// Warn if the user has disabled base directory restriction - this is a security risk | ||
if (Config::get('cms.restrictBaseDir', true) === false) { | ||
$warnings[] = [ | ||
'message' => Lang::get('backend::lang.warnings.restrict_base_dir'), | ||
]; | ||
} | ||
// Warn if the default backend user is using the default username or email, and has access to manage users | ||
if ( | ||
BackendAuth::getUser()->hasAccess('backend.manage_users') | ||
&& User::where('login', 'admin')->orWhere('email', '[email protected]')->count() | ||
) { | ||
$warnings[] = Lang::get('backend::lang.warnings.default_backend_user'); | ||
$warnings[] = [ | ||
'message' => Lang::get('backend::lang.warnings.default_backend_user'), | ||
]; | ||
} | ||
// Warn if backend assets are being decompiled | ||
if (Config::get('develop.decompileBackendAssets', false)) { | ||
$warnings[] = [ | ||
'message' => Lang::get('backend::lang.warnings.decompileBackendAssets'), | ||
]; | ||
} | ||
|
||
$requiredExtensions = [ | ||
|
@@ -124,22 +151,29 @@ protected function getSystemWarnings() | |
|
||
foreach ($writablePaths as $path) { | ||
if (!is_writable($path)) { | ||
$warnings[] = Lang::get('backend::lang.warnings.permissions', ['name' => '<strong>'.$path.'</strong>']); | ||
$warnings[] = [ | ||
'message' => Lang::get('backend::lang.warnings.permissions', ['name' => '<strong>'.$path.'</strong>']) | ||
]; | ||
} | ||
} | ||
|
||
foreach ($requiredExtensions as $extension => $installed) { | ||
if (!$installed) { | ||
$warnings[] = Lang::get('backend::lang.warnings.extension', ['name' => '<strong>'.$extension.'</strong>']); | ||
$warnings[] = [ | ||
'message' => Lang::get('backend::lang.warnings.extension', ['name' => '<strong>'.$extension.'</strong>']), | ||
'fixUrl' => 'https://wintercms.com/docs/v1.2/docs/setup/installation#minimum-system-requirements', | ||
]; | ||
} | ||
} | ||
|
||
foreach ($missingDependencies as $pluginCode => $plugin) { | ||
foreach ($plugin as $missingPluginCode) { | ||
$warnings[] = Lang::get('system::lang.updates.update_warnings_plugin_missing', [ | ||
'code' => '<strong>' . $missingPluginCode . '</strong>', | ||
'parent_code' => '<strong>' . $pluginCode . '</strong>' | ||
]); | ||
$warnings[] = [ | ||
'message' => Lang::get('system::lang.updates.update_warnings_plugin_missing', [ | ||
'code' => '<strong>' . $missingPluginCode . '</strong>', | ||
'parent_code' => '<strong>' . $pluginCode . '</strong>' | ||
]), | ||
]; | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.