Skip to content

Conversation

@alwaeles
Copy link
Contributor

@alwaeles alwaeles commented Apr 6, 2025

Fix safe mode being weird:

Safe mode was specified in the bundle documentation to check if a request came from Telegram IP address which wasn't the case.

# If true, the webhook mode validates the incoming IP range is from a Telegram server
safeMode: false

Therefore I removed this setting and the following piece of code:

if ($config['safe_mode'] ?? false) {
    $webhook = new $webhook(fn() => $requestStack->getCurrentRequest()?->getClientIp());
}

Make safe mode actually safe:

I reworked this in the following way.

  • Add a new configuration option: webhook_secret
    By default the option is commented out. You can uncomment it and specify a secret.
  • Modify the setWebbok command to consume the secret.
  • Modify NutgramFactory to consume the secret.

This PR also fixes the following issue: nutgram/nutgram#793

@sergix44 sergix44 merged commit 49014cf into nutgram:master Apr 7, 2025
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.

2 participants