Skip to content

feat: Multi-Database Support (Postgres/SQLite/SQL Server) + One-Command Installers + CI/CD - #45

Closed
Opselon wants to merge 1 commit into
mainfrom
feat/multi-database-install-ci
Closed

Opselon wants to merge 1 commit into
mainfrom
feat/multi-database-install-ci

Conversation

@Opselon

@Opselon Opselon commented Oct 6, 2026

Copy link
Copy Markdown
Owner

🎯 Summary

Full multi-database architecture with zero-config startup — the app now supports PostgreSQL, SQLite, and SQL Server out of the box, with an interactive wizard on first run.

✅ What's New

Multi-Database Engine

  • DatabaseProviderConfigurator — single source of truth for EF Core + Hangfire provider selection, schema translation, and database creation
  • Automatic type translation: nvarchar(max)→TEXT, GETUTCDATE()→NOW()/datetime('now'), uniqueidentifier→uuid, etc.
  • Tested end-to-end on all three databases ✅

First-Run Wizard (FirstRunSetup.cs)

  • Interactive: colored menu asking DB choice + connection params (passwords masked)
  • Non-interactive (Docker/CI): reads env vars, defaults to SQLite

Fail-Soft Startup

  • App starts cleanly without any Telegram config — no crash, no 100s hang
  • 3-layer resilience: client constructor, init service, bot service

One-Command Installers

  • install.sh — Linux/macOS (Docker or native path)
  • install.ps1 — Windows PowerShell (Docker or native)
  • Both auto-detect dependencies and guide through setup

CI/CD Workflows

  • ci.yml — build + test on every push/PR
  • release.yml — tag-triggered: 4-platform publish + Docker image + GitHub Release

Infrastructure

  • Multi-stage Dockerfile (sdk → alpine runtime, non-root)
  • .dockerignore, healthcheck improvements, idempotent init.sql
  • Comprehensive README.md with quick-start guide

🧪 Test Results

  • 42 tests pass (41 new for DatabaseProviderConfigurator + 1 existing)
  • End-to-end verified: SQLite ✅ | PostgreSQL ✅ | SQL Server ✅

📁 Files Changed

29 files, +2462 / -195

…nd installers + CI/CD

Core Changes:
- Add DatabaseProviderConfigurator: normalize provider names, configure EF + Hangfire,
  translate SQL Server schema types for Postgres/SQLite, auto-create database
- Add FirstRunSetup wizard: interactive DB selection on first startup,
  non-interactive fallback for containers (env vars or SQLite default)
- Hangfire storage per provider (PostgreSql/SQLite/SqlServer)
- Fix Hangfire.Storage.SQLite path extraction (was creating file named "Data Source=...")

Fail-Soft Startup (no Telegram config = no crash):
- TelegramUserApiClient: resilient constructor + auto-delete corrupt sessions
- TelegramUserApiInitializationService: skip when ApiId/ApiHash missing
- TelegramPanel: skip bot registration without token (no 100s GetMe hang)
- TelegramBotService: instant return when BotToken is empty

One-Command Installers:
- install.sh (Linux/macOS): Docker or native path, auto-detect deps
- install.ps1 (Windows PowerShell): Docker or native, .NET SDK install

CI/CD:
- .github/workflows/ci.yml: build + test on push/PR
- .github/workflows/release.yml: tag-triggered release with 4-platform
  publish archives + Docker image + GitHub Release

Infrastructure:
- Dockerfile: multi-stage sdk:9.0 → aspnet:9.0-alpine, non-root
- .dockerignore: prevent local obj/bin leaking into container
- docker-compose.yml: postgres healthcheck with start_period
- init.sql: idempotent (extensions only, no schema conflict with EF)
- README.md: quick-start, install commands, architecture overview

Tests:
- 41 new tests for DatabaseProviderConfigurator (normalize, translate, edge cases)
- All 42 solution tests pass

Tested end-to-end:
- SQLite: schema + /health ✅
- PostgreSQL (docker compose): 12 tables + /health ✅
- SQL Server (mssql:2022 container): 13 tables + /health ✅
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gitguardian

gitguardian Bot commented Oct 6, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
37912375 Triggered Generic Password 4acd83a install.ps1 View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@Opselon

Opselon commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

Closing in favor of PR #46, which is rebased on the real default branch (master) and contains only the genuine delta. This PR was based on the stale main branch (626 commits behind master) and its feature is largely already implemented in master (EasySetupWizard + DatabaseProvider enum + multi-storage Hangfire).

@Opselon Opselon closed this Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant