Skip to content

Commit

Permalink
chore: update worker-deploy, hide sensitive env vars during setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Oct 3, 2024
1 parent 0b56b2c commit ea6e4bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/worker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ jobs:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
secrets: |
TELEGRAM_BOT_ENV
REPO_ADMIN_ACCESS_TOKEN
env:
TELEGRAM_BOT_ENV: ${{ secrets.TELEGRAM_BOT_ENV }}
REPO_ADMIN_ACCESS_TOKEN: ${{ secrets.REPO_ADMIN_ACCESS_TOKEN }}

- name: Write Deployment URL to Summary
run: |
Expand Down
10 changes: 9 additions & 1 deletion src/bot/mtproto-api/bot/scripts/sms-auth/setup-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,15 @@ class SetUpHandler {
}

console.log(step.title);
const answer = await input.password(` ${question.message}\n> `);

const passwords = ["TELEGRAM_BOT_WEBHOOK_SECRET", "REPO_ADMIN_ACCESS_TOKEN", "TELEGRAM_API_HASH", "TELEGRAM_BOT_TOKEN", "TELEGRAM_APP_ID"];
let answer;

if (passwords.includes(question.name)) {
answer = await input.password(` ${question.message}\n> `);
} else {
answer = await input.text(` ${question.message}\n> `);
}

await this.handleFirstTwo(question, answer);

Expand Down

0 comments on commit ea6e4bc

Please sign in to comment.