docs: add project documentation and update README
- Add `agent.md`: Complete maintenance reference covering project structure, API interactions, data flow, configuration, security, and operational procedures. - Add `architecture.md`: High-level architecture overview including component map, data flow, design decisions, and security model. - Update `README.md`: Add Apprise support documentation, manual deployment instructions, updated installation steps (bot admin requirement), and expanded payload mapping and troubleshooting sections. - Improve `lib/Controller/WebhookController.php`: Enhance `saveBotPassword` validation to check for missing fields and validate the password content. - Improve `lib/Service/TalkService.php`: Add `validateBotPassword` method for round-trip encryption testing and integrate it into `saveConfig`. - Update `css/adminSettings.css`: Add styles for the new `.nc-app-frame` wrapper. - Update `templates/adminSettings.php`: Refactor UI structure to use `.nc-app-frame` and improve layout of settings sections.
This commit is contained in:
@@ -319,9 +319,17 @@ class WebhookController extends Controller {
|
||||
public function saveBotPassword(): DataResponse {
|
||||
$body = file_get_contents('php://input');
|
||||
$data = @json_decode($body, true);
|
||||
if (!is_array($data) || empty($data['bot_password'])) {
|
||||
if (!is_array($data) || !isset($data['bot_password'])) {
|
||||
return new DataResponse(
|
||||
['error' => 'Invalid data'],
|
||||
['error' => 'Missing bot_password field'],
|
||||
Http::STATUS_BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
|
||||
$validation = $this->talkService->validateBotPassword($data['bot_password']);
|
||||
if (!$validation['valid']) {
|
||||
return new DataResponse(
|
||||
['error' => $validation['error']],
|
||||
Http::STATUS_BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user