Skip to content

Commit

Permalink
v1.6 Merge
Browse files Browse the repository at this point in the history
v1.6 Merge
  • Loading branch information
dirtycajunrice authored Jan 4, 2019
2 parents fa19954 + aaa8172 commit c9da4dc
Show file tree
Hide file tree
Showing 10 changed files with 192 additions and 158 deletions.
63 changes: 25 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Change Log

## [v1.6](https://github.com/Boerderij/Varken/tree/v1.6) (2019-01-04)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.5...v1.6)

**Implemented enhancements:**

- \[Feature Request\] docker-compose stack install option [\#84](https://github.com/Boerderij/Varken/issues/84)
- Fix missing variables in varken.ini automatically [\#81](https://github.com/Boerderij/Varken/issues/81)
- Create Wiki for FAQ and help docs [\#80](https://github.com/Boerderij/Varken/issues/80)

**Fixed bugs:**

- \[BUG\] url:port does not filter [\#82](https://github.com/Boerderij/Varken/issues/82)

**Merged pull requests:**

- v1.6 Merge [\#75](https://github.com/Boerderij/Varken/pull/85) ([DirtyCajunRice](https://github.com/DirtyCajunRice))

## [v1.5](https://github.com/Boerderij/Varken/tree/v1.5) (2018-12-30)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.4...v1.5)

Expand All @@ -20,43 +37,28 @@
- Add Ombi Issues [\#74](https://github.com/Boerderij/Varken/pull/74) ([anderssonoscar0](https://github.com/anderssonoscar0))

## [v1.4](https://github.com/Boerderij/Varken/tree/v1.4) (2018-12-19)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.3-nightly...v1.4)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.1...v1.4)

**Implemented enhancements:**

- \[Feature Request\] Add tautulli request for library stats [\#64](https://github.com/Boerderij/Varken/issues/64)
- Create randomized 12-24 hour checks to update GeoLite DB after the first wednesday of the month [\#60](https://github.com/Boerderij/Varken/issues/60)
- \[Feature Request\]: Pull list of requests \(instead of just counts\) [\#58](https://github.com/Boerderij/Varken/issues/58)
- Feature Request , Add Sickchill [\#48](https://github.com/Boerderij/Varken/issues/48)

**Fixed bugs:**

- \[BUG\] Ombi all requests missing half of "pending" option [\#63](https://github.com/Boerderij/Varken/issues/63)
- \[BUG\] asa bug with checking for apikey [\#62](https://github.com/Boerderij/Varken/issues/62)

**Merged pull requests:**

- v1.4 Merge [\#65](https://github.com/Boerderij/Varken/pull/65) ([DirtyCajunRice](https://github.com/DirtyCajunRice))

## [v1.3-nightly](https://github.com/Boerderij/Varken/tree/v1.3-nightly) (2018-12-18)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.2-nightly...v1.3-nightly)

**Implemented enhancements:**

- Create randomized 12-24 hour checks to update GeoLite DB after the first wednesday of the month [\#60](https://github.com/Boerderij/Varken/issues/60)

**Fixed bugs:**

- \[BUG\] Add Catchall to ombi requests [\#59](https://github.com/Boerderij/Varken/issues/59)

**Closed issues:**

- Unify naming and cleanup duplication in iniparser [\#61](https://github.com/Boerderij/Varken/issues/61)

## [v1.2-nightly](https://github.com/Boerderij/Varken/tree/v1.2-nightly) (2018-12-16)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.1...v1.2-nightly)

**Implemented enhancements:**
**Merged pull requests:**

- \[Feature Request\]: Pull list of requests \(instead of just counts\) [\#58](https://github.com/Boerderij/Varken/issues/58)
- Feature Request , Add Sickchill [\#48](https://github.com/Boerderij/Varken/issues/48)
- v1.4 Merge [\#65](https://github.com/Boerderij/Varken/pull/65) ([DirtyCajunRice](https://github.com/DirtyCajunRice))

## [v1.1](https://github.com/Boerderij/Varken/tree/v1.1) (2018-12-11)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.0...v1.1)
Expand Down Expand Up @@ -84,35 +86,19 @@
- Update issue templates [\#55](https://github.com/Boerderij/Varken/pull/55) ([DirtyCajunRice](https://github.com/DirtyCajunRice))

## [v1.0](https://github.com/Boerderij/Varken/tree/v1.0) (2018-12-10)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v0.3-nightly...v1.0)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v0.1...v1.0)

**Implemented enhancements:**

- Add cisco asa from legacy [\#44](https://github.com/Boerderij/Varken/issues/44)
- Add server ID to ombi to differenciate [\#43](https://github.com/Boerderij/Varken/issues/43)

**Merged pull requests:**

- v1.0 Merge [\#45](https://github.com/Boerderij/Varken/pull/45) ([DirtyCajunRice](https://github.com/DirtyCajunRice))

## [v0.3-nightly](https://github.com/Boerderij/Varken/tree/v0.3-nightly) (2018-12-07)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v0.2-nightly...v0.3-nightly)

**Implemented enhancements:**

- Create Changelog for nightly release [\#39](https://github.com/Boerderij/Varken/issues/39)
- Create proper logging [\#34](https://github.com/Boerderij/Varken/issues/34)

**Closed issues:**

- Remove "dashboard" folder and subfolders [\#42](https://github.com/Boerderij/Varken/issues/42)
- Remove "Legacy" folder [\#41](https://github.com/Boerderij/Varken/issues/41)

## [v0.2-nightly](https://github.com/Boerderij/Varken/tree/v0.2-nightly) (2018-12-06)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v0.1...v0.2-nightly)

**Closed issues:**

- Create the DB if it does not exist. [\#38](https://github.com/Boerderij/Varken/issues/38)
- create systemd examples [\#37](https://github.com/Boerderij/Varken/issues/37)
- Create a GeoIP db downloader and refresher [\#36](https://github.com/Boerderij/Varken/issues/36)
Expand All @@ -130,6 +116,7 @@

**Merged pull requests:**

- v1.0 Merge [\#45](https://github.com/Boerderij/Varken/pull/45) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- varken to nightly [\#40](https://github.com/Boerderij/Varken/pull/40) ([DirtyCajunRice](https://github.com/DirtyCajunRice))

## [v0.1](https://github.com/Boerderij/Varken/tree/v0.1) (2018-10-20)
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN \
/config \
/app

WORKDIR /app

CMD cp /app/data/varken.example.ini /config/varken.example.ini && python3 /app/Varken.py --data-folder /config

VOLUME /config
84 changes: 10 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Varken
[![Build Status](https://travis-ci.org/Boerderij/Varken.svg?branch=master)](https://travis-ci.org/Boerderij/Varken)
[![Discord](https://img.shields.io/badge/Discord-Varken-7289DA.svg?logo=discord&style=flat-square)](https://discord.gg/AGTG44H)
[![Discord](https://img.shields.io/badge/Discord-Varken-7289DA.svg?logo=discord&style=flat-square)](https://discord.gg/VjZ6qSM)
[![BuyMeACoffee](https://img.shields.io/badge/BuyMeACoffee-Donate-ff813f.svg?logo=CoffeeScript&style=flat-square)](https://www.buymeacoffee.com/varken)
[![Docker-Layers](https://images.microbadger.com/badges/image/boerderij/varken.svg)](https://microbadger.com/images/boerderij/varken)
[![Docker-Version](https://images.microbadger.com/badges/version/boerderij/varken.svg)](https://microbadger.com/images/boerderij/varken)
[![Docker Pulls](https://img.shields.io/docker/pulls/boerderij/varken.svg)](https://hub.docker.com/r/boerderij/varken/)
[![Docker Stars](https://img.shields.io/docker/stars/boerderij/varken.svg)](https://hub.docker.com/r/boerderij/varken/)

Dutch for PIG. PIG is an Acronym for Plex/InfluxDB/Grafana

Expand All @@ -10,14 +14,14 @@ from the Plex ecosystem into InfluxDB. Examples use Grafana for a
frontend

Requirements:
* Python3.6.7+
* [Python 3.6.7+](https://www.python.org/downloads/release/python-367/)
* Python3-pip
* [InfluxDB](https://www.influxdata.com/)

<p align="center">
Example Dashboard

<img width="800" src="https://i.imgur.com/G5bnpjs.png">
<img width="800" src="https://i.imgur.com/3hNZTkC.png">
</p>

Supported Modules:
Expand All @@ -34,65 +38,8 @@ Key features:
* Grafana [Worldmap Panel](https://grafana.com/plugins/grafana-worldmap-panel/installation) support


## Quick Setup (Git Clone)
```
# Clone the repository
git clone https://github.com/Boerderij/Varken.git /opt/Varken
# Follow the systemd install instructions located in varken.systemd
cp /opt/Varken/varken.systemd /etc/systemd/system/varken.service
nano /etc/systemd/system/varken.service
# Create venv in project
/usr/bin/python3 -m venv /opt/Varken/varken-venv
# Install requirements
/opt/Varken/varken-venv/bin/python -m pip install -r requirements.txt
# Make a copy of varken.example.ini to varken.ini in the data folder
cp /opt/Varken/data/varken.example.ini /opt/Varken/data/varken.ini
# Make the appropriate changes to varken.ini
nano /opt/Varken/data/varken.ini
# Make sure all the files have the appropriate permissions
chown $USER:$USER -R /opt/Varken
# Start the service and enable it
systemctl start varken
systemctl enable varken
```
### Docker

[![Docker-Layers](https://images.microbadger.com/badges/image/boerderij/varken.svg)](https://microbadger.com/images/boerderij/varken)
[![Docker-Version](https://images.microbadger.com/badges/version/boerderij/varken.svg)](https://microbadger.com/images/boerderij/varken)
[![Docker Pulls](https://img.shields.io/docker/pulls/boerderij/varken.svg)](https://hub.docker.com/r/boerderij/varken/)
[![Docker Stars](https://img.shields.io/docker/stars/boerderij/varken.svg)](https://hub.docker.com/r/boerderij/varken/)
<details><summary>Example</summary>
<p>

```
docker run -d \
--name=varken \
-v <path to data>:/config \
-e PGID=<gid> -e PUID=<uid> \
-e TZ=America/Chicago \
boerderij/varken
```
</p>
</details>

#### Tags
* **latest**
* **nightly**
* **release-tag** e.g. v1.0

#### Upgrading with docker
```sh
docker stop varken
docker rm varken
# Run deploy command above
```
## Installation Guides
Varken Installation guides can be found in the [wiki](https://github.com/Boerderij/Varken/wiki/Installation).

### InfluxDB
[InfluxDB Installation Documentation](https://docs.influxdata.com/influxdb/v1.7/introduction/installation/)
Expand All @@ -104,15 +51,4 @@ named `varken`

### Grafana
[Grafana Installation Documentation](http://docs.grafana.org/installation/)
[Official Example Dashboards](https://grafana.com/dashboards?search=Varken%20%5BOfficial%5D)

Grafana is used in our examples but not required, nor packaged as part of
Varken. Panel examples now exist in both nightly and tagged releases hosted
on grafana.com (link above).

1. Use the link above, then click on your desired dashboard version
2. Click `Copy ID to Clipboard`
3. In grafana, click your dashboards menu dropdown, and then click `Import dashboard`
4. Paste the ID into the `Grafana.com Dashboard` field and then click into empty space on the screen. (This should change the screen to show `Importing Dashboard from Grafana.com`
5. Select your varken datasource name in the dropdown labeled `Varken`
6. Click Import!
Official dashboard installation instructions can be found in the [wiki](https://github.com/Boerderij/Varken/wiki/Installation#grafana)
2 changes: 1 addition & 1 deletion Varken.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def threaded(job):
vl.logger.info('Data folder is "%s"', DATA_FOLDER)

vl.logger.info(u"%s %s (%s%s)", platform.system(), platform.release(), platform.version(),
f' - {PLATFORM_LINUX_DISTRO}' if PLATFORM_LINUX_DISTRO else '')
' - ' + PLATFORM_LINUX_DISTRO if PLATFORM_LINUX_DISTRO else '')

vl.logger.info(u"Python %s", version)

Expand Down
9 changes: 0 additions & 9 deletions data/varken.example.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# Notes:
# - Sonarr + Radarr scripts support multiple servers. You can remove the second
# server by putting a # in front of the lines and section name, and removing
# that number from your server_ids list
# - fallback_ip, This is used when there is no IP listed in Tautulli.
# This can happen when you are streaming locally. Set this to your public IP.
# You do not need to change this value if your IP changes. This is only for
# location lookups when there is a failure.

[global]
sonarr_server_ids = 1,2
radarr_server_ids = 1,2
Expand Down
46 changes: 46 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: '3'
networks:
internal:
driver: bridge
services:
influxdb:
hostname: influxdb
user: auser
image: influxdb
networks:
- internal
volumes:
- /path/to/docker-influxdb/config-folder:/var/lib/influxdb
restart: unless-stopped
varken:
hostname: varken
image: boerderij/varken
networks:
- internal
volumes:
- /path/to/docker-varken/config-folder:/config
environment:
- PGID=911
- PUID=911
- TZ=America/Chicago
depends_on:
- influxdb
restart: unless-stopped
grafana:
hostname: grafana
user: auser
image: grafana/grafana
networks:
- internal
ports:
- 3000:3000
volumes:
- /path/to/docker-grafana/config-folder:/config
environment:
- GF_PATHS_DATA=/config/data
- GF_PATHS_LOGS=/config/logs
- GF_PATHS_PLUGINS=/config/plugins
- GF_INSTALL_PLUGINS=grafana-piechart-panel,grafana-worldmap-panel
depends_on:
- influxdb
restart: unless-stopped
4 changes: 2 additions & 2 deletions varken/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = 1.5
BRANCH = 'master'
VERSION = 1.7
BRANCH = 'pre-nightly'
9 changes: 8 additions & 1 deletion varken/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from os.path import abspath, join, basename, isdir
from urllib3.exceptions import InsecureRequestWarning
from requests.exceptions import InvalidSchema, SSLError, ConnectionError
from ipaddress import IPv4Address

logger = getLogger()

Expand All @@ -28,7 +29,7 @@ def __init__(self, data_folder):
def lookup(self, ipaddress):
ip = ipaddress
self.logger.debug('Getting lat/long for Tautulli stream using ip with last octet ending in %s',
ip.split('.')[-1:])
ip.split('.')[-1:][0])
return self.reader.city(ip)

def update(self):
Expand Down Expand Up @@ -83,6 +84,12 @@ def hashit(string):
return hashed


def rfc1918_ip_check(ip):
rfc1918_ip = IPv4Address(ip).is_private

return rfc1918_ip


def connection_handler(session, request, verify):
s = session
r = request
Expand Down
Loading

0 comments on commit c9da4dc

Please sign in to comment.