
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
api-m77-raspberry-wifi-node
Advanced tools
API to interact with the functionality of the m77-raspberry-wifi-node module
Si quieres ver el documento en español, por favor consulta el archivo README_es.md
Node.js server with express that creates an API with the functionality of the m77-raspberry-wifi-node module that I developed earlier in which you can configure the Raspberry Pi Wifi network using wpa_cli from wpa_supplicant.
For developers who need to create a frontend with the functionality of the m77-raspberry-wifi-node module, it will be much easier. implement it as backend.
Same as with the m77-raspberry-wifi-node module. Because I have benefited a lot from the work of other people and organizations that offer development modules and I want to give something back to the community.
I hope you find it very useful and recommend it so that it reaches more developers :-)
From git
git clone https://github.com/mangos77/api-m77-raspberry-wifi-node.git
cd api-m77-raspberry-wifi-node
npm install
From npm
mkdir api-m77-raspberry-wifi-node
cd api-m77-raspberry-wifi-node
npm install api-m77-raspberry-wifi-node --no-save
mv node_modules/api-m77-raspberry-wifi-node/* ./
rm -rf node_modules
npm install
It is very easy to configure the package, it will be done in two files:
It is optional and only to modify the execution scripts to pass environment variables, such as the port for each type of execution:
"scripts": {
"dev": "PORT=8081 NODE_ENV=development node src/index",
"start": "PORT=8080 NODE_ENV=production node src/index"
},
In this file is the configuration of all the operation for the execution of the API
There are two blocks to configure depending on whether the execution is development or production:
const config = () => {
const config_dev = {}
const config_prod = {}
If run in production mode with the environment variable NODE_ENV=production config_prod will overwrite the values of config_dev
The values to adjust are:
Example:
const config_dev = {
name: pkjson.name,
version: pkjson.version,
production: false,
port: process.env.PORT || 8081,
allowHosts: ['localhost', '127.0.0.1', 'iface=eth0'],
wifi_config: { debugLevel: 2 }
}
const config_prod = {
production: true,
port: process.env.PORT || 8080,
allowHosts: ['localhost', '127.0.0.1'],
wifi_config: { debugLevel: 0 }
}
In the docs folder you will find two files:
In order to understand all the responses of each endpoint, it can be of great help to see the documentation of the module on which this api is based m77-raspberry-wifi-node
The available endpoints are:
List available Wifi interfaces
IMPORTANT NOTE All of the following endpoints can optionally be sent with the following parameters in the URL (device, debugLevel, scan_timeout, connect_timeout).
These values have higher priority than those specified in config.js -> wifi_config and are used to give more control of the actions if required.
Wifi interface status
Know if the interface has a connection to a Wi-Fi network or not
List of saved Wi-Fi networks
Delete all saved networks
List of all Wi-Fi networks available within reach of the device
Delivery list of unique Wi-Fi networks (ssid and frequency)
List of all Wi-Fi networks available within reach of the device organized by type of connection
Establish connection to a Wi-Fi network
{
"ssid": "mangos77",
"psk": "asdfasd3322Fs",
"bssid": "",
"removeAllNetworks": false,
"hidden": false
}
More details of these parameters in the connect() method of m77-raspberry-wifi-node
Disconnect the Wi-Fi from the device
Try to reconnect to one of the saved Wi-Fi networks
You can install pm2 to manage startup, number of instances etc.
By default it is not possible for you to ask to set port 80 for execution as ports lower than 1024 are only accessible by the user root or by *sudo.
But you can fix it with:
sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 8081
I hope it helps you and please tell me about any errors or comments
FAQs
API to interact with the functionality of the m77-raspberry-wifi-node module
The npm package api-m77-raspberry-wifi-node receives a total of 0 weekly downloads. As such, api-m77-raspberry-wifi-node popularity was classified as not popular.
We found that api-m77-raspberry-wifi-node 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.