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

@@ -5,27 +5,18 @@ services:
- "3000:3000"
environment:
# Use host.docker.internal to access resources on the host machine
- DB_PRIMARY_HOST=host.docker.internal
- DB_PRIMARY_USER=${DB_PRIMARY_USER}
- DB_PRIMARY_PASS=${DB_PRIMARY_PASS}
- DB_PRIMARY_DB=${DB_PRIMARY_DB}
# SQL Server: credenciales globales (server_name / database_name vienen de a24c.database_nodes en Postgres)
- PANEL_MSSQL_USER=${PANEL_MSSQL_USER}
- PANEL_MSSQL_PASSWORD=${PANEL_MSSQL_PASSWORD}
- PANEL_MSSQL_DOCKER=${PANEL_MSSQL_DOCKER:-true}
- IN_DOCKER=true
- DB_SECONDARY_HOST=host.docker.internal
- DB_SECONDARY_USER=${DB_SECONDARY_USER}
- DB_SECONDARY_PASS=${DB_SECONDARY_PASS}
- DB_SECONDARY_DB=${DB_SECONDARY_DB}
- DB_AZURE_HOST=${DB_AZURE_HOST}
- DB_AZURE_USER=${DB_AZURE_USER}
- DB_AZURE_PASS=${DB_AZURE_PASS}
- DB_AZURE_DB=${DB_AZURE_DB}
# PostgreSQL connection (connect to postgres service)
# PostgreSQL: catálogo ControlDesk (a24c.*) + usuarios del panel
- DB_POSTGRES_HOST=postgres
- DB_POSTGRES_PORT=5432
- DB_POSTGRES_USER=${DB_POSTGRES_USER}
- DB_POSTGRES_PASS=${DB_POSTGRES_PASS}
- DB_POSTGRES_DB=${DB_POSTGRES_DB}
- DB_POSTGRES_DB=${DB_POSTGRES_DB}
# JWT Secret
- JWT_SECRET=${JWT_SECRET}