Files
BetterDesk/dev_modules
UNITRONIX ed8840c175 Add database schema checker script and update audit_log schema
Introduced check_and_fix_database.sh for automated database schema validation and repair, including admin user creation and backup. Updated audit_log table schema in install-improved.sh and web/auth.py to use device_id and timestamp fields, ensuring consistency across scripts and database migrations. Updated documentation to reflect the new script and usage.
2026-02-02 10:33:30 +01:00
..
2026-01-06 03:24:36 +01:00
2026-01-06 03:24:36 +01:00

Development Modules

This directory contains development and testing utilities for BetterDesk Console.

Contents

Testing Scripts

  • test_ban_api.sh - Test script for ban/unban API endpoints
    • Tests device banning functionality
    • Validates API responses
    • Usage: ./test_ban_api.sh

Diagnostic Tools

  • check_database.py - Database inspection and validation tool

    • Checks database schema
    • Verifies migrations applied
    • Lists devices and their status
    • Usage: python3 check_database.py
  • check_and_fix_database.sh - Database Schema Checker & Fixer NEW

    • Automatically detects database location
    • Validates all required tables and columns
    • Fixes missing or incorrect schema
    • Creates backup before making changes
    • Creates admin user if missing
    • Usage: sudo ./check_and_fix_database.sh [database_path]
    • Example: sudo ./check_and_fix_database.sh /opt/rustdesk/db_v2.sqlite3
    • Use this if you have login problems!

Development Scripts

  • update.ps1 - PowerShell update script (Windows development environment)
    • Alternative to update.sh for Windows
    • Updates web console components

Usage

These tools are for development and testing only. They are not required for production deployment.

Requirements

  • Python 3.8+ (for check_database.py)
  • Bash (for test_ban_api.sh)
  • curl (for API testing)

Notes

  • These scripts assume a local or test RustDesk server installation
  • Always test on non-production systems first
  • See main README.md for production deployment

Contributing

When adding new development tools:

  1. Document usage in this README
  2. Add appropriate shebang and error handling
  3. Include comments explaining functionality
  4. Test on clean environment before committing