Skip to content

feat: multi webhook SaaS & secured debug/servers#61

Draft
tim48-robot wants to merge 28 commits intoruxailab:setupWizardfrom
tim48-robot:feature/saas-ready
Draft

feat: multi webhook SaaS & secured debug/servers#61
tim48-robot wants to merge 28 commits intoruxailab:setupWizardfrom
tim48-robot:feature/saas-ready

Conversation

@tim48-robot
Copy link

@tim48-robot tim48-robot commented Jan 12, 2026

will do the checks manually first & try everything, will ping you if i dont find problem
btw the twice message in discord is because i have two service on cloud run url, that one is fixed.

- Add finally block to close Discord client even if start() fails (auth.py)
- Return empty list instead of None in _get_webhook_urls() to prevent TypeError
- Track aiohttp session ownership and cleanup when created outside context manager
- Remove _check_server_configurations() from on_ready (bots shouldn't message on redeploy)
- Keep on_guild_join handler for first-time setup guidance (user-initiated action)
- Change footer from 'Powered by DisgitBot SaaS' to 'Powered by DisgitBot'
- /set_webhook now requires setup_completed before allowing configuration
- /webhook_status shows per-server webhook timestamps instead of org-level
- Prevents confusing behavior when old data exists from previous setup
- Add background thread to clean up abandoned OAuth sessions (>10 min)
- Extend setup state token expiration from 30min to 7 days for org approval
- Disable PR automation at webhook handler level (returns 501)
- Remove /set_webhook command to clean up UI
- Keep other CI/CD related commands (add_repo, remove_repo, list_repos)
- PR automation code preserved in auth.py for future re-enable
@tim48-robot tim48-robot marked this pull request as draft February 4, 2026 11:19
- Add shared.py module for global bot_instance reference
- Add notify_setup_complete with asyncio.run_coroutine_threadsafe
- Add trigger_initial_sync with GitHub App identity
- Add find_installation_id to GitHubAppService for auto-discovery
- Integrate setup notification and initial sync into complete_setup flow
- Wrap all synchronous Firestore I/O with asyncio.to_thread in:
  bot.py (on_guild_join), admin_commands, config_commands,
  analytics_commands, user_commands, notification_commands
- Fix notification_service._get_webhook_urls sync calls in async method
- Ensures Discord event loop is never blocked by network I/O
- Disabled commands also updated for future maintainability
- Replace threading.Lock (blocked ALL users) with per-user _active_links set
- Replace wait_for_username polling (time.sleep loop tying up threads for
  up to 5 min) with asyncio.Event driven by Flask OAuth callback
- Flask callback uses loop.call_soon_threadsafe(event.set) for instant
  thread-safe notification — zero threads consumed while waiting
- Delete dead wait_for_username function
- Handle timeout explicitly with oauth_sessions cleanup
Flask session signing key must be set in production to prevent
cookie forgery attacks (verified via flask-unsign PoC).
@tim48-robot tim48-robot force-pushed the feature/saas-ready branch 4 times, most recently from 5fc5af4 to bf027b8 Compare February 12, 2026 09:45
…cs polish

- auth.py: Fix naive datetime comparisons that can crash with tz-aware Firestore timestamps
- auth.py: Remove unused setup_url variable
- bot.py: Fix naive datetime comparisons and store UTC-aware timestamps
- user_commands.py: Replace deprecated datetime.utcnow() with datetime.now(timezone.utc)
- notification_service.py: Replace deprecated utcnow(), update type hints to str | None
- .env.example: Add trailing newline for dotenv compatibility
- Dockerfile: Add --no-cache-dir to pip upgrade (consistent with other pip installs)
- README.md: Fix Step 4 -> Step 3 references for Cloud Run URL
- MAINTAINER.md: Replace absolute file:// paths with relative repo paths
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

Comments