diff --git a/routes/__pycache__/main.cpython-313.pyc b/routes/__pycache__/main.cpython-313.pyc index fb4d488..9b8c77e 100644 Binary files a/routes/__pycache__/main.cpython-313.pyc and b/routes/__pycache__/main.cpython-313.pyc differ diff --git a/routes/main.py b/routes/main.py index 8eb790f..e9975dd 100644 --- a/routes/main.py +++ b/routes/main.py @@ -1729,4 +1729,14 @@ def init_routes(main_bp): 'id': mail.template.id, 'name': mail.template.name } if mail.template else None - }) \ No newline at end of file + }) + + @main_bp.route('/development-wiki') + @login_required + @require_password_change + def development_wiki(): + if not os.environ.get('MASTER', 'false').lower() == 'true': + flash('This page is only available in master instances.', 'error') + return redirect(url_for('main.dashboard')) + + return render_template('wiki/base.html') \ No newline at end of file diff --git a/templates/common/base.html b/templates/common/base.html index dcb472e..78abe81 100644 --- a/templates/common/base.html +++ b/templates/common/base.html @@ -95,6 +95,11 @@ Instances +
+ DocuPulse implements a comprehensive multi-layered security system designed to protect user data, + ensure secure access control, and maintain detailed audit trails. The system combines traditional + web authentication with modern security practices including CSRF protection, secure session management, + granular permissions, and comprehensive event logging for compliance and security monitoring. +
+User credentials are validated against the database, password is verified using secure hashing, and a session is created with appropriate permissions
+Each request is validated against user roles and room permissions, ensuring users can only access resources they're authorized to use
+Sessions are managed securely with automatic timeout, remember me functionality, and proper cleanup on logout
+All authentication events, security actions, and user activities are logged for compliance and security monitoring
+1. User requests password reset2. System validates email address3. Generates secure token (32 chars)4. Creates reset token record5. Sends email with reset link6. Logs reset request event1. User clicks reset link2. System validates token3. Checks token expiration4. Validates new password5. Updates user password6. Marks token as usedcan_view - View files and folderscan_download - Download filescan_upload - Upload new filescan_delete - Delete filescan_rename - Rename filescan_move - Move files between folderscan_share - Share files with otherscan_manage_members - Add/remove memberscan_edit_room - Modify room settingscan_delete_room - Delete entire roomcan_view_activity - View room activitycan_export_data - Export room dataCross-Site Request Forgery protection is implemented across all forms and API endpoints.
+Flask-WTF - CSRF protection librarycsrf_token - Hidden form fieldsgenerate_csrf() - Token generationvalidate_csrf() - Token validationexempt_routes - API exemptionsFlask-Login - Session managementremember_me - Persistent sessionssession_timeout - Automatic expirationsecure_logout - Session cleanupsession_regeneration - Security rotationuser_login - Login attemptsuser_logout - Logout eventsuser_create - Account creationuser_update - Profile changesuser_delete - Account deletionpassword_change - Password updatespassword_reset - Reset attemptsfailed_login - Failed attemptspermission_change - Access updatesadmin_action - Administrative actionsevent_type - Type of eventuser_id - User identifiertimestamp - Event timeip_address - Client IPuser_agent - Browser infodetails - Event specifics+ DocuPulse features a sophisticated real-time messaging system that enables seamless communication + between team members. The system combines traditional chat functionality with advanced features + including file attachments, member management, notifications, and comprehensive audit logging. + Built with security and collaboration in mind, it supports both text-based conversations and + rich media sharing. +
+Conversations can be created by administrators and managers with full member management capabilities.
+1. Admin/Manager initiates creation2. Sets conversation name and description3. Selects initial members4. System validates permissions5. Creates conversation record6. Sends member invitationsname - Conversation titledescription - Optional descriptioncreated_by - Creator user IDmembers - Initial member listcreated_at - Creation timestampconversation_invite - Invitation notificationmember_add - Add to conversationpermission_check - Validate accessnotification_send - Alert new memberevent_log - Log member additioncreator_protection - Prevent creator removalmember_remove - Remove from conversationnotification_send - Alert removed memberevent_log - Log member removalaccess_revoke - Revoke conversation access1. User composes message2. Attaches files (optional)3. Validates permissions4. Saves message to database5. Processes attachments6. Sends notifications1. Polling checks for new messages2. Fetches messages since last ID3. Validates user access4. Processes message data5. Updates chat interface6. Triggers UI eventsinterval - 3 seconds between pollslast_message_id - Track last receivedretry_attempts - 5 failed attemptsauto_reconnect - Restart on failurestate_management - Track connectionPDF - Portable Document FormatDOCX/DOC - Microsoft WordXLSX/XLS - Microsoft ExcelPPTX/PPT - Microsoft PowerPointTXT/RTF - Text documentsCSV/MD - Data and markdownJPG/PNG/GIF - Image filesMP3/WAV/OGG - Audio filesMP4/AVI/MOV - Video filesZIP/RAR/7Z - Archive filesPY/JS/HTML - Code filesDWG/AI/PSD - Design filesfile_validation - Type and size checkssecure_filename - Sanitize filenamessize_limit - 10MB maximumvirus_scan - Malware detectionaccess_control - Permission validationconversation_invite - Member invitationconversation_invite_removed - Member removalconversation_message - New messageconversation_created - New conversationconversation_updated - Settings changedmessage_create - Message sentmessage_attachment - File attachedmessage_mention - User mentionedmessage_reply - Message replied tomessage_edit - Message edited+ DocuPulse uses SQLAlchemy ORM with PostgreSQL to manage a comprehensive set of data models that support + multi-tenant document management, user collaboration, and system administration. The database schema + is designed for scalability, security, and efficient querying with proper relationships and constraints. +
+Core user account with authentication, roles, and profile information.
+id - Primary keyusername - Unique usernameemail - Unique email addresspassword_hash - Encrypted passwordis_admin - Administrator roleis_manager - Manager rolelast_name - User's last namephone - Contact phonecompany - Company nameposition - Job positionprofile_picture - Avatar imagepreferred_view - UI preferenceDocument workspace with member management and file organization.
+id - Primary keyname - Room namedescription - Room descriptioncreated_at - Creation timestampcreated_by - Creator user IDcreator - Room creator (User)members - Room members (User)member_permissions - Member permissionsfiles - Room files (RoomFile)Files and folders stored within rooms with metadata and access tracking.
+id - Primary keyname - File/folder namepath - File pathtype - 'file' or 'folder'size - File size in bytesmodified - Last modified timestamproom_id - Parent roomuploaded_by - Uploader user IDuploaded_at - Upload timestampdeleted - Deletion statusdeleted_by - Deleter user IDdeleted_at - Deletion timestampReal-time messaging conversations with member management.
+id - Primary keyname - Conversation namedescription - Conversation descriptioncreated_at - Creation timestampcreated_by - Creator user IDcreator - Conversation creatormembers - Conversation membersmessages - Conversation messagesprimary_color - Brand primary colorsecondary_color - Brand secondary colorcompany_name - Company namecompany_logo - Logo filenamecompany_website - Company websitecompany_email - Contact emailmax_rooms - Maximum rooms per instancemax_conversations - Max conversationsmax_storage - Storage limit in bytesupdated_at - Last update timestampUsers can create rooms, upload files, send messages, and participate in conversations with proper permission controls
+Files are organized in rooms with folder structures, starring capabilities, and trash management for deleted items
+Granular permissions control access to rooms, files, and conversations with role-based and user-specific settings
+Comprehensive event logging tracks all user actions, file operations, and system changes for security and compliance
++ DocuPulse features a comprehensive notification and event logging system that provides real-time + alerts, email notifications, and detailed audit trails. The system combines in-app notifications + with email delivery, offering users multiple ways to stay informed about important activities + and system events. Built with security and compliance in mind, it provides complete visibility + into user actions and system activities. +
+account_created - New user account createdpassword_reset - Password reset requestedaccount_deleted - User account deletedaccount_updated - User profile updatedpassword_changed - Password successfully changedroom_invite - Invited to join roomroom_invite_removed - Removed from roomconversation_invite - Invited to conversationconversation_invite_removed - Removed from conversationconversation_message - New message received1. Event triggers notification2. System validates notification type3. Creates notification record4. Generates email template5. Sends email via SMTP6. Updates notification statusnotif_type - Type of notificationuser_id - Target user IDsender_id - Optional sender IDdetails - Additional datagenerate_mail - Email flagsmtp_server - SMTP server addresssmtp_port - SMTP port numberuse_tls - TLS encryption flagusername - SMTP usernamepassword - SMTP passwordsender_email - From email addressAccount Created - New user welcomePassword Reset - Reset instructionsRoom Invite - Room invitationConversation Invite - Chat invitationConversation Message - Message alertsuser_login - User authenticationuser_logout - User logoutuser_create - Account creationuser_update - Profile updatesuser_delete - Account deletionroom_create - Room creationroom_update - Room modificationsroom_delete - Room deletionroom_member_add - Member additionroom_member_remove - Member removalfile_upload - File uploadsfile_download - File downloadsfile_delete - File deletionsfile_rename - File renamingfile_move - File movingconversation_create - Chat creationconversation_update - Chat updatesconversation_delete - Chat deletionmessage_create - Message sendingconversation_open - Chat access1. Event occurs in system2. log_event() function called3. Validates event type4. Captures user context5. Records IP and user agent6. Stores in databaseevent_type - Type of eventuser_id - User who triggeredtimestamp - Event timedetails - Event-specific dataip_address - User IP addressuser_agent - Browser/client infoget_user_notifications - Fetch user notificationsmark_notification_read - Mark as readmark_all_notifications_read - Mark all readget_unread_count - Count unreaddelete_notification - Delete notificationdelete_old_notifications - Cleanup old notificationsgenerate_mail_from_notification - Create emailsend_email_via_smtp - Send emailget_smtp_settings - Get email configcreate_notification - Create new notificationget_user_events - User-specific eventsget_room_events - Room-specific eventsget_recent_events - Recent system eventsget_events_by_type - Filter by event typeget_events_by_date_range - Date range filteruser_id - Filter by userevent_type - Filter by typestart_date - Start dateend_date - End datelimit - Result limit{{ '{{ user.username }}' }} - User's full name{{ '{{ user.email }}' }} - User's email{{ '{{ user.company }}' }} - User's company{{ '{{ user.position }}' }} - User's position{{ '{{ sender.username }}' }} - Sender's name{{ '{{ site.company_name }}' }} - Company name{{ '{{ site.company_website }}' }} - Website{{ '{{ setup_link }}' }} - Setup URL{{ '{{ reset_link }}' }} - Reset URL{{ '{{ created_at }}' }} - Creation time{{ '{{ conversation.name }}' }} - Chat name{{ '{{ message.content }}' }} - Message text{{ '{{ room_link }}' }} - Room URL{{ '{{ conversation_link }}' }} - Chat URL{{ '{{ updated_fields }}' }} - Changed fields{{ '{{ created_at }}' }} - Creation timestamp{{ '{{ updated_at }}' }} - Update timestamp{{ '{{ deleted_at }}' }} - Deletion timestamp{{ '{{ removed_at }}' }} - Removal timestamp{{ '{{ expiry_time }}' }} - Expiration time+ DocuPulse is an enterprise-grade document management and collaboration platform built with Flask and PostgreSQL. + It features a sophisticated multi-tenant architecture that supports multiple isolated instances, each with their own + data, users, and configurations. The platform combines secure file management, real-time messaging, advanced + permission controls, and comprehensive audit logging in a modern, scalable web application. +
+Master instance manages multiple isolated tenant instances with separate databases, storage, and configurations
+Blueprint-based routing with clear separation of concerns across 12+ route modules
+Comprehensive event logging with 30+ event types and real-time notification system
+7-level permission system, CSRF protection, password hashing, and role-based access control
+15+ database models with complex relationships, JSON fields, and comprehensive metadata tracking
+RESTful API with 50+ endpoints, JWT authentication, and management API for instance orchestration
+