mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 18:15:24 +00:00
fix(database): enforce credential format validation and sanitize init/SSL arguments
Add ValidationPatterns helpers for database identifiers and passwords, apply them across database Livewire components and the API controller, encode MongoDB init script values via json_encode, and pass the MySQL user through escapeshellarg when generating SSL chown commands.
This commit is contained in:
1 parent
2264a2ef76
commit
03313e54cc
14 files changed
+502
-82
No files matched your search
@@ -86,9 +86,9 @@ class General extends Component
|
||||
return [
|
||||
'name' => ValidationPatterns::nameRules(),
|
||||
'description' => ValidationPatterns::descriptionRules(),
|
||||
'postgresUser' => 'required',
|
||||
'postgresPassword' => 'required',
|
||||
'postgresDb' => 'required',
|
||||
'postgresUser' => ValidationPatterns::databaseIdentifierRules(),
|
||||
'postgresPassword' => ValidationPatterns::databasePasswordRules(),
|
||||
'postgresDb' => ValidationPatterns::databaseIdentifierRules(),
|
||||
'postgresInitdbArgs' => 'nullable',
|
||||
'postgresHostAuthMethod' => 'nullable',
|
||||
'postgresConf' => 'nullable',
|
||||
@@ -112,9 +112,9 @@ class General extends Component
|
||||
ValidationPatterns::portMappingMessages(),
|
||||
[
|
||||
'name.required' => 'The Name field is required.',
|
||||
'postgresUser.required' => 'The Postgres User field is required.',
|
||||
'postgresPassword.required' => 'The Postgres Password field is required.',
|
||||
'postgresDb.required' => 'The Postgres Database field is required.',
|
||||
...ValidationPatterns::databaseIdentifierMessages('postgresUser', 'Postgres User'),
|
||||
...ValidationPatterns::databasePasswordMessages('postgresPassword', 'Postgres Password'),
|
||||
...ValidationPatterns::databaseIdentifierMessages('postgresDb', 'Postgres Database'),
|
||||
'image.required' => 'The Docker Image field is required.',
|
||||
'publicPort.integer' => 'The Public Port must be an integer.',
|
||||
'publicPort.min' => 'The Public Port must be at least 1.',
|
||||
|
||||
Reference in new issue
Block a user