Refactor database configuration and user management

- Updated .env.example to consolidate SQL Server credentials under PANEL_MSSQL_* variables.
- Removed deprecated docker-compose.postgres.yml file.
- Adjusted docker-compose.yml to utilize new SQL Server credential structure.
- Enhanced README.md with Docker build and push instructions.
- Refined database schema in schema.sql to align with new user and permission structures.
- Updated init-database.js to reflect changes in user and session table names.
- Modified user management functions in users.ts to accommodate new database schema.
- Streamlined API routes to utilize PostgreSQL for user and database management.
- Improved error handling and logging in various server routes.
This commit is contained in:
2026-04-14 14:16:11 -05:00
parent 97b67afb25
commit 0bf9c9e68d
18 changed files with 1004 additions and 748 deletions

View File

@@ -1,22 +1,11 @@
# SQL Server - Servidor Primary (.202)
DB_PRIMARY_HOST=104.197.7.202
DB_PRIMARY_USER=sa
DB_PRIMARY_PASS=Clave.2025
DB_PRIMARY_DB=master
# Credenciales SQL Server (mismo usuario en todos los nodos salvo sql_password en database_nodes).
# Si no defines PANEL_MSSQL_*, se usan DB_PRIMARY_* / DB_SECONDARY_* como respaldo.
PANEL_MSSQL_USER=sa
PANEL_MSSQL_PASSWORD=Clave.2025
# En contenedor Docker: reescribe localhost en server_name → host.docker.internal
# PANEL_MSSQL_DOCKER=true
# SQL Server - Servidor Secondary (.152)
DB_SECONDARY_HOST=104.192.7.152
DB_SECONDARY_USER=sa
DB_SECONDARY_PASS=Clave.2025
DB_SECONDARY_DB=master
# SQL Server - Azure/CONTROLDESK
DB_AZURE_HOST=104.192.7.152
DB_AZURE_USER=sa
DB_AZURE_PASS=Clave.2025
DB_AZURE_DB=CONTROLDESK
# PostgreSQL - Base de datos de usuarios (Docker local)
# PostgreSQL - Usuarios del panel + catálogo ControlDesk (tablas a24c.* las crea otra app)
DB_POSTGRES_HOST=localhost
DB_POSTGRES_PORT=5432
DB_POSTGRES_USER=postgres