Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Xantios/socket-wrapper
Just a simple unix-socket wrapper using the magic of JWT
https://github.com/Xantios/socket-wrapper
Last synced: 9 days ago
JSON representation
Just a simple unix-socket wrapper using the magic of JWT
- Host: GitHub
- URL: https://github.com/Xantios/socket-wrapper
- Owner: Xantios
- License: apache-2.0
- Created: 2019-01-24T15:04:49.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:38:26.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T13:34:26.533Z (3 months ago)
- Language: JavaScript
- Size: 597 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## Socket wrapper
Just a simple unix socket wrapper using JWT, please DO NOT expose things to the internet !!
## Config
the config file is a simple json file, just replace some values and you should be good to go### Run
**Using docker-hub**
Generate something like this:
```{
"jwtSecret": "changeme",
"users": [
{
"username": "example",
"password": "changeme"
}
],
"whitelist": [
"::1",
"172.0.0.0/8",
"127.0.0.0/8",
"192.168.0.0/16"
],
"unixSocket": "/var/run/docker.sock"
}```and run
```bash
docker run --name socket-wrapper -v ./config.json:/app/config.json -p 8080:3000 xantios/socket-wrapper
```**Using docker**
```bash
docker build . -t socket-wrapper
docker run --name socket-wrapper -p 8080:3000 socket-wrapper
```**Without docker**
```bash
npm start
```### Usage
Send a username and a password to ```/users/authenticate``` and save the token you get back
Use this token in all other requests to connect to your unix-socket over HTTP