# shrvr

> Shell server

Latest version **0.2.2** (published 2015-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install shrvr
pnpm add shrvr
yarn add shrvr
bun add shrvr
```

Provides the command `shrvr`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2015-07-15 |
| First published | 2015-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yan@zuiqt.com |
| Maintainers | x_reception, idy |
| Keywords | shell, nodejs, shell, to, api, api, server, server, http, server |

## Links

- npm: https://www.npmjs.com/package/shrvr
- Repository: https://github.com/xreception/shrvr
- Issues: https://github.com/xreception/shrvr/issues
- npm.io page: https://npm.io/package/shrvr

## Dependencies (6)

- [debug](https://npm.io/package/debug.md) ^2.1.1
- [yargs](https://npm.io/package/yargs.md) ^1.3.3
- [extend](https://npm.io/package/extend.md) ^2.0.0
- [morgan](https://npm.io/package/morgan.md) ^1.6.1
- [express](https://npm.io/package/express.md) ^4.11.2
- [body-parser](https://npm.io/package/body-parser.md) ^1.12.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2015-07-15
- 0.2.1 — 2015-07-15
- 0.2.0 — 2015-03-09
- 0.1.3 — 2015-03-09
- 0.1.2 — 2015-03-04
- 0.1.1 — 2015-03-04
- 0.1.0 — 2015-03-03
- 0.0.5 — 2015-02-25
- 0.0.4 — 2015-02-16
- 0.0.3 — 2015-02-06
- 0.0.2 — 2015-02-06
- 0.0.1 — 2015-02-06

## README

Shell server
===
Start a web server to execute templated shell command directly. 

###Usage
Install
```shell
npm i shrvr -g
```
Writing the shell template. 
```text
alias iptable_path = /iptables/:source_ip/:port/:destination
alias delete_rule = iptables -D PREROUTING -p tcp -s #source_ip --dport #port -j DNAT --to-destination #destination
alias add_rule = iptables -A PREROUTING -p tcp -s #source_ip --dport #port -j DNAT --to-destination #destination
POST iptable_path delete_rule && add_rule && echo "delete_rule" | at now + 48hour
DELETE iptable_path delete_rule
```
The command on this template will forward requests from :port of :source_ip to :destination. And automatic revoke this
rule after 48 hours. A valid command is:
```shell
iptable -A PREROUTING -p tcp -s 1.2.3.4 --dport 21135 -j DNAT --to-destination 192.168.2.1:8080
```

Start shrvr:
```shell
shrvr -t example-routes/iptable.route -p 6333 -b 192.168.1.10
```

Add an iptable rule via shrvr
```shell
curl -X POST http://192.168.1.10:6333/1.2.3.4/21135/192.168.2.1:8080
```

---
_Source: https://npm.io/package/shrvr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
