docs: update documentation, add future tasks, and fix debug endpoint security
- **Documentation Overhaul**: - **README.md**: Restructured installation guide to align with Nextcloud 33+ paths (e.g., "Personal Settings → Security"), added curl examples, updated known limitations, and added a "Future Features" section. - **agent.md**: Updated architecture documentation to reflect `TalkService.php` growth (1138 to 1904 lines), updated constructor parameters, and corrected method documentation (e.g., `buildRichObject` now creates TYPE_ROOM shares, `postToRoom` uses query params). - **architecture.md**: Added notes regarding the admin gate for the debug endpoint. - **New Files**: - Added `Future to-do.md` to track planned features (inbound messages, filtering, etc.). - Added `TODO.md` to track pending tasks and code cleanup. - **Code Fixes**: - **lib/Controller/WebhookController.php**: Re-applied `#[AdminRequired]` attribute to the `debug()` method to enforce admin authentication. - **lib/Service/TalkService.php**: Updated docblock for `buildRichObject` to clarify it creates TYPE_ROOM shares. - **lib/Settings/Admin.php** & **templates/adminSettings.php**: Corrected bot password generation instructions to point to the correct Nextcloud settings path. - **Configuration**: - **appinfo/info.xml**: Bumped version to 1.2.1 and updated `max-version` to 35.
This commit is contained in:
@@ -596,10 +596,12 @@ class WebhookController extends Controller {
|
||||
*
|
||||
* SECURITY: Never leave debug enabled in production. It exposes internal
|
||||
* configuration, database schema, and bot credentials.
|
||||
*
|
||||
* TODO: Add auto-disable timer (2-hour TTL) to prevent accidental prolonged exposure.
|
||||
*/
|
||||
#[PublicPage]
|
||||
#[NoCSRFRequired]
|
||||
#[NoAdminRequired]
|
||||
#[AdminRequired]
|
||||
public function debug(): DataResponse {
|
||||
// Debug endpoint must be explicitly enabled via OCC command
|
||||
$debugEnabled = $this->appConfig->getValueBool('nc_bot_webhooks', 'debug_enabled', false);
|
||||
|
||||
@@ -1077,7 +1077,9 @@ class TalkService {
|
||||
|
||||
/**
|
||||
* Build rich object data for a Talk message from an uploaded file path.
|
||||
* Creates a public link share so Talk can resolve the rich object.
|
||||
* Creates a TYPE_ROOM share in the bot user's storage so Talk's SystemMessage
|
||||
* parser can resolve the rich object inline. More secure than public link shares
|
||||
* since the share is scoped to the room rather than publicly accessible.
|
||||
*/
|
||||
public function buildRichObject(string $filePath, string $mimeType, string $roomToken): ?array {
|
||||
$this->logger->info('nc_bot_webhooks: buildRichObject ENTER', ['app' => self::APP_ID, 'filePath' => $filePath, 'roomToken' => $roomToken]);
|
||||
|
||||
@@ -40,7 +40,7 @@ class Admin implements ISettings {
|
||||
'no_rooms' => $this->l10n->t('No rooms found'),
|
||||
'no_rooms_msg' => $this->l10n->t('No Talk rooms are available or you don\'t have permission to view them.'),
|
||||
'bot_password' => $this->l10n->t('Bot App Password'),
|
||||
'bot_password_desc' => $this->l10n->t('App password for the "talk-bot" user. Create one in Settings → talk-bot → Devices & sessions.'),
|
||||
'bot_password_desc' => $this->l10n->t('App password for the "talk-bot" bot user account (not a regular user). Create one in Personal Settings → Security → Devices & sessions.'),
|
||||
'sender_name' => $this->l10n->t('Default Sender Name'),
|
||||
'sender_name_desc' => $this->l10n->t('Name used when posting messages as the bot.'),
|
||||
'image_retention' => $this->l10n->t('Image Retention (days)'),
|
||||
|
||||
Reference in New Issue
Block a user