Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
[![Version](https://img.shields.io/npm/v/cfworker-middware-telegraf.svg?style=flat-square)](https://www.npmjs.com/package/cfworker-middware-telegraf)
Make telegraf (a telegram bot framework) useable in Cloudflare Workers.
npm i cfworker-middware-telegraf
// index.js
const { Telegraf } = require('telegraf');
const { Application, Router } = require('@cfworker/web');
const createTelegrafMiddware = require('cfworker-middware-telegraf');
const bot = new Telegraf('BOT_TOKEN');
// Your code here, but do not `bot.launch()`
const router = new Router();
router.post('/SECRET_PATH', createTelegrafMiddware(bot));
new Application().use(router.middleware).listen();
// webpack.config.js
module.exports = {
target: 'webworker',
entry: './index.js',
mode: 'production',
node: {
fs: 'empty',
},
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
},
],
},
performance: {
hints: false,
},
};
Just copy and paste built code to cfworker online editor and save.
Or you can use Wrangler, an official CLI tool, so you don't need to copy and paste code manually anymore. But I don't like it due to its inexplicable bugs on Win10.
These codes only need to be run once locally.
const Telegraf = require('telegraf');
const bot = new Telegraf('BOT_TOKEN');
// set webhook
bot.telegram.setWebhook('https://your.cfworker.domain/SECRET_PATH');
// delete webhook
// bot.telegram.deleteWebhook();
// get webhook info
// bot.telegram.getWebhookInfo().then(console.log);
FAQs
[![Version](https://img.shields.io/npm/v/cfworker-middware-telegraf.svg?style=flat-square)](https://www.npmjs.com/package/cfworker-middware-telegraf)
The npm package 11ff receives a total of 2 weekly downloads. As such, 11ff popularity was classified as not popular.
We found that 11ff demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.