Remove hardcoded Telegram credentials and enforce runtime secret configuration#1
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/EXELANCE-LLC/ipadecrypt/sessions/bc67d056-6bf8-4066-a3db-6c92b8ed20af Co-authored-by: EXELANCE-LLC <26485488+EXELANCE-LLC@users.noreply.github.com>
Agent-Logs-Url: https://github.com/EXELANCE-LLC/ipadecrypt/sessions/bc67d056-6bf8-4066-a3db-6c92b8ed20af Co-authored-by: EXELANCE-LLC <26485488+EXELANCE-LLC@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Qeyf
April 23, 2026 02:05
View session
Qeyf
marked this pull request as ready for review
April 23, 2026 02:05
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Telegram bot entrypoint (cmd/tgbot) intended to run ipadecrypt workflows remotely, with bot credentials and operational configuration supplied via environment variables (plus Railway/Docker deployment scaffolding).
Changes:
- Added a Telegram bot command handler supporting
/decrypt,/versions, and/status, wired to existing App Store + device/pipeline logic. - Added deployment artifacts (Dockerfile + railway.toml) and README instructions for running the bot with persistent storage.
- Updated CI to build the new
cmd/tgbotbinary and added the Telegram bot API dependency.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
railway.toml |
Railway build/deploy configuration for the Docker-based bot deployment. |
Dockerfile |
Container build/run definition for cmd/tgbot. |
cmd/tgbot/main.go |
Telegram bot main loop and update dispatch. |
cmd/tgbot/handler.go |
Implements bot commands and integrates with existing decrypt/version/status workflows. |
cmd/tgbot/auth.go |
Loads bot + runtime settings from environment and applies env overrides to config. |
README.md |
Adds documentation for Telegram/Railway/Cloudflare Tunnel remote usage. |
go.mod / go.sum |
Adds go-telegram-bot-api/v5 dependency. |
.github/workflows/ci.yml |
Builds the new cmd/tgbot target in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+27
to
+29
| for update := range updates { | ||
| u := update | ||
| go srv.handleUpdate(u) |
| if msg.From == nil || !isAllowedUser(s.settings.AllowedUsers, msg.From.ID) { | ||
| s.sendText(msg.Chat.ID, "Unauthorized.") | ||
| return | ||
| } |
Comment on lines
+24
to
+27
| token := strings.TrimSpace(os.Getenv("TELEGRAM_TOKEN")) | ||
| if token == "" { | ||
| return settings{}, errors.New("TELEGRAM_TOKEN is required") | ||
| } |
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.
The issue exposed a Telegram bot token/user ID in plaintext and implied direct API usage with static credentials. This PR removes embedded secrets and shifts Telegram authentication to runtime-provided configuration only.
Credential surface reduction
Runtime auth configuration
TELEGRAM_BOT_TOKEN) for HTTP API clients.Operational guidance