spigot-anti-piracy-csv-exporter
Version:
A helper utility to generate a csv export for the spigot-anti-piracy-backend
75 lines (48 loc) • 3.08 kB
Markdown
# spigot-anti-piracy-csv-exporter
[](https://github.com/timbru31/spigot-anti-piracy-csv-exporter/actions?query=workflow%3A%22Run+a+security+audit%22)
[](https://github.com/timbru31/spigot-anti-piracy-csv-exporter/actions?query=workflow%3ALinting)
[](https://david-dm.org/timbru31/spigot-anti-piracy-csv-exporter)
[](https://david-dm.org/timbru31/spigot-anti-piracy-csv-exporter#info=devDependencies)
[](https://codeclimate.com/github/timbru31/spigot-anti-piracy-csv-exporter)
[](https://snyk.io/test/github/timbru31/spigot-anti-piracy-csv-exporter)
[](https://commitizen.github.io/cz-cli/)
[](https://dependabot.com)
[](LICENSE)
[](https://www.npmjs.com/package/spigot-anti-piracy-csv-exporter)
#### A helper utility to generate a csv export for the spigot-anti-piracy-backend
### Description
The helper application reduces the logfile of spigot-anti-piracy-backend to a CSV with unique user IDs and a count of different ips in order to determine which user could have leaked the resources.
### Installation
This has been tested with Node.js v12 and v14 LTS.
#### Normal Installation
```shell
$ npm install -g spigot-anti-piracy-csv-exporter
```
(Optionally without the global flag)
#### Development Installation
```shell
$ git clone https://github.com/timbru31/spigot-anti-piracy-csv-exporter.git
$ cd spigot-anti-piracy-csv-exporter
$ npm install
```
### Usage
You need to specify thr path for the logfile. It defaults to `request.log` in the current directory if omitted.
Just use
```shell
$ npm run start
```
Configuration via environment variables
| Environment Variable | Default | Description |
| :------------------- | :------------ | :------------------- |
| CSV_FILE | ./users.csv | Output CSV file |
| LOG_FILE | ./request.log | Log file of requests |
### Development
To run the linter use
```shell
$ npm run lint
```
The code is linted using `TSLint`.
Keep the warnings to zero. :smile:
**Please follow the commitizen style when making new commits!**
---
Built by (c) Tim Brust and contributors. Released under the MIT license.