devthejo / node-ufw

Manipulate UFW via Node.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node UFW

Manipulate UFW (Linux distribution only, works best on Ubuntu) via Node.js.

This module is under development. Use with caution.

System Requirements

Only supported on Node.js version 14 or above, and Ubuntu version 18 or above.

This also requires root access, or else you'll get an error from ufw itself/password prompt from Ubuntu.

Installation

# npm
$ npm install node-ufw

# yarn
$ yarn add node-ufw

Usage

const nodeUfw = require("node-ufw");

await nodeUfw.allow.port(6379);
await nodeUfw.deny.port(25565, "udp");

await nodeUfw.allow.address("192.168.0.1");
await nodeUfw.deny.address("192.168.0.1", 80);
await nodeUfw.allow.address("192.168.0.1", 6379, "udp");

await nodeUfw.enable();

Documentations

See DOCS.

LICENSE

See LICENSE.

About

Manipulate UFW via Node.js.

License:MIT License


Languages

Language:JavaScript 100.0%