feat: multi webhook SaaS & secured debug/servers#61
Draft
tim48-robot wants to merge 28 commits intoruxailab:setupWizardfrom
Draft
feat: multi webhook SaaS & secured debug/servers#61tim48-robot wants to merge 28 commits intoruxailab:setupWizardfrom
tim48-robot wants to merge 28 commits intoruxailab:setupWizardfrom
Conversation
- 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
0968749 to
02830f6
Compare
- 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).
f79a8f4 to
67101ba
Compare
5fc5af4 to
bf027b8
Compare
…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
bf027b8 to
1062fdf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.