Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.7.2 Merge #144

Merged
merged 9 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# Change Log

## [v1.7.1](https://github.com/Boerderij/Varken/tree/v1.7.1) (2019-06-03)
[Full Changelog](https://github.com/Boerderij/Varken/compare/1.7.0...v1.7.1)
## [v1.7.2](https://github.com/Boerderij/Varken/tree/v1.7.2) (2019-06-23)
[Full Changelog](https://github.com/Boerderij/Varken/compare/1.7.1...v1.7.2)

**Implemented enhancements:**

- Allow configuration via environment variables [\#137](https://github.com/Boerderij/Varken/issues/137)

**Fixed bugs:**

- \[BUG\] logger invoked before initialization in dbmanager [\#138](https://github.com/Boerderij/Varken/issues/138)

**Merged pull requests:**

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

## [1.7.1](https://github.com/Boerderij/Varken/tree/1.7.1) (2019-06-04)
[Full Changelog](https://github.com/Boerderij/Varken/compare/1.7.0...1.7.1)

**Fixed bugs:**

Expand Down Expand Up @@ -273,7 +288,7 @@
**Merged pull requests:**

- v0.1 [\#20](https://github.com/Boerderij/Varken/pull/20) ([samwiseg0](https://github.com/samwiseg0))
- Added selfplug [\#19](https://github.com/Boerderij/Varken/pull/19) ([si0972](https://github.com/si0972))
- Added selfplug [\#19](https://github.com/Boerderij/Varken/pull/19) ([Roxedus](https://github.com/Roxedus))
- Major rework of the scripts [\#14](https://github.com/Boerderij/Varken/pull/14) ([samwiseg0](https://github.com/samwiseg0))
- fix worldmap after change to maxmind local db [\#11](https://github.com/Boerderij/Varken/pull/11) ([madbuda](https://github.com/madbuda))
- Update sonarr.py [\#7](https://github.com/Boerderij/Varken/pull/7) ([ghost](https://github.com/ghost))
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM amd64/python:3.7.2-alpine
FROM amd64/python:3.7.3-alpine

LABEL maintainers="dirtycajunrice,samwiseg0"

ENV DEBUG="True"

ENV DATA_FOLDER="/config"

WORKDIR /app

COPY /requirements.txt /Varken.py /app/
Expand All @@ -15,8 +17,8 @@ COPY /data /app/data
COPY /utilities /app/data/utilities

RUN apk add --no-cache tzdata && \
python3 -m pip install -r /app/requirements.txt
pip install --no-cache-dir -r /app/requirements.txt

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

VOLUME /config
8 changes: 5 additions & 3 deletions Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM arm32v6/python:3.7.2-alpine
FROM arm32v6/python:3.7.3-alpine

LABEL maintainers="dirtycajunrice,samwiseg0"

ENV DEBUG="True"

ENV DATA_FOLDER="/config"

WORKDIR /app

COPY /requirements.txt /Varken.py /app/
Expand All @@ -13,8 +15,8 @@ COPY /varken /app/varken
COPY /data /app/data

RUN apk add --no-cache tzdata && \
python3 -m pip install -r /app/requirements.txt
pip install --no-cache-dir -r /app/requirements.txt

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

VOLUME /config
8 changes: 5 additions & 3 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM arm64v8/python:3.7.2-alpine
FROM arm64v8/python:3.7.3-alpine

LABEL maintainers="dirtycajunrice,samwiseg0"

ENV DEBUG="True"

ENV DATA_FOLDER="/config"

WORKDIR /app

COPY /requirements.txt /Varken.py /app/
Expand All @@ -13,8 +15,8 @@ COPY /varken /app/varken
COPY /data /app/data

RUN apk add --no-cache tzdata && \
python3 -m pip install -r /app/requirements.txt
pip install --no-cache-dir -r /app/requirements.txt

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

VOLUME /config
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img width="800" src="https://raw.githubusercontent.com/Boerderij/Varken/develop/assets/varken_full_banner.jpg" alt="Logo Banner">
<img width="800" src="https://raw.githubusercontent.com/Boerderij/Varken/master/assets/varken_full_banner.jpg" alt="Logo Banner">
</p>

[![Build Status](https://jenkins.cajun.pro/buildStatus/icon?job=Varken/master)](https://jenkins.cajun.pro/job/Varken/job/master/)
Expand Down
19 changes: 8 additions & 11 deletions Varken.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from queue import Queue
from sys import version
from threading import Thread
from os import environ as env
from os import access, R_OK, getenv
from distro import linux_distribution
from os.path import isdir, abspath, dirname, join
Expand Down Expand Up @@ -45,26 +46,22 @@ def thread(job, **kwargs):

opts = parser.parse_args()

DATA_FOLDER = abspath(join(dirname(__file__), 'data'))

templogger = getLogger('temp')
templogger.setLevel(DEBUG)
tempch = StreamHandler()
tempformatter = Formatter('%(asctime)s : %(levelname)s : %(module)s : %(message)s', '%Y-%m-%d %H:%M:%S')
tempch.setFormatter(tempformatter)
templogger.addHandler(tempch)

if opts.data_folder:
ARG_FOLDER = opts.data_folder
DATA_FOLDER = env.get('DATA_FOLDER', vars(opts).get('data_folder') or abspath(join(dirname(__file__), 'data')))

if isdir(ARG_FOLDER):
DATA_FOLDER = ARG_FOLDER
if not access(DATA_FOLDER, R_OK):
templogger.error("Read permission error for %s", DATA_FOLDER)
exit(1)
else:
templogger.error("%s does not exist", ARG_FOLDER)
if isdir(DATA_FOLDER):
if not access(DATA_FOLDER, R_OK):
templogger.error("Read permission error for %s", DATA_FOLDER)
exit(1)
else:
templogger.error("%s does not exist", DATA_FOLDER)
exit(1)

# Set Debug to True if DEBUG env is set
enable_opts = ['True', 'true', 'yes']
Expand Down
94 changes: 92 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,99 @@ services:
volumes:
- /path/to/docker-varken/config-folder:/config
environment:
- PGID=911
- PUID=911
- TZ=America/Chicago
- VRKN_GLOBAL_SONARR_SERVER_IDS=1,2
- VRKN_GLOBAL_RADARR_SERVER_IDS=1,2
- VRKN_GLOBAL_LIDARR_SERVER_IDS=false
- VRKN_GLOBAL_TAUTULLI_SERVER_IDS=1
- VRKN_GLOBAL_OMBI_SERVER_IDS=1
- VRKN_GLOBAL_SICKCHILL_SERVER_IDS=false
- VRKN_GLOBAL_UNIFI_SERVER_IDS=false
- VRKN_INFLUXDB_URL=influxdb.domain.tld
- VRKN_INFLUXDB_PORT=8086
- VRKN_INFLUXDB_SSL=false
- VRKN_INFLUXDB_VERIFY_SSL=false
- VRKN_INFLUXDB_USERNAME=root
- VRKN_INFLUXDB_PASSWORD=root
- VRKN_TAUTULLI_1_URL=tautulli.domain.tld:8181
- VRKN_TAUTULLI_1_FALLBACK_IP=1.1.1.1
- VRKN_TAUTULLI_1_APIKEY=xxxxxxxxxxxxxxxx
- VRKN_TAUTULLI_1_SSL=false
- VRKN_TAUTULLI_1_VERIFY_SSL=false
- VRKN_TAUTULLI_1_GET_ACTIVITY=true
- VRKN_TAUTULLI_1_GET_ACTIVITY_RUN_SECONDS=30
- VRKN_TAUTULLI_1_GET_STATS=true
- VRKN_TAUTULLI_1_GET_STATS_RUN_SECONDS=3600
- VRKN_SONARR_1_URL=sonarr1.domain.tld:8989
- VRKN_SONARR_1_APIKEY=xxxxxxxxxxxxxxxx
- VRKN_SONARR_1_SSL=false
- VRKN_SONARR_1_VERIFY_SSL=false
- VRKN_SONARR_1_MISSING_DAYS=7
- VRKN_SONARR_1_MISSING_DAYS_RUN_SECONDS=300
- VRKN_SONARR_1_FUTURE_DAYS=1
- VRKN_SONARR_1_FUTURE_DAYS_RUN_SECONDS=300
- VRKN_SONARR_1_QUEUE=true
- VRKN_SONARR_1_QUEUE_RUN_SECONDS=300
- VRKN_SONARR_2_URL=sonarr2.domain.tld:8989
- VRKN_SONARR_2_APIKEY=yyyyyyyyyyyyyyyy
- VRKN_SONARR_2_SSL=false
- VRKN_SONARR_2_VERIFY_SSL=false
- VRKN_SONARR_2_MISSING_DAYS=7
- VRKN_SONARR_2_MISSING_DAYS_RUN_SECONDS=300
- VRKN_SONARR_2_FUTURE_DAYS=1
- VRKN_SONARR_2_FUTURE_DAYS_RUN_SECONDS=300
- VRKN_SONARR_2_QUEUE=true
- VRKN_SONARR_2_QUEUE_RUN_SECONDS=300
- VRKN_RADARR_1_URL=radarr1.domain.tld
- VRKN_RADARR_1_APIKEY=xxxxxxxxxxxxxxxx
- VRKN_RADARR_1_SSL=false
- VRKN_RADARR_1_VERIFY_SSL=false
- VRKN_RADARR_1_QUEUE=true
- VRKN_RADARR_1_QUEUE_RUN_SECONDS=300
- VRKN_RADARR_1_GET_MISSING=true
- VRKN_RADARR_1_GET_MISSING_RUN_SECONDS=300
- VRKN_RADARR_2_URL=radarr2.domain.tld
- VRKN_RADARR_2_APIKEY=yyyyyyyyyyyyyyyy
- VRKN_RADARR_2_SSL=false
- VRKN_RADARR_2_VERIFY_SSL=false
- VRKN_RADARR_2_QUEUE=true
- VRKN_RADARR_2_QUEUE_RUN_SECONDS=300
- VRKN_RADARR_2_GET_MISSING=true
- VRKN_RADARR_2_GET_MISSING_RUN_SECONDS=300
- VRKN_LIDARR_1_URL=lidarr1.domain.tld:8686
- VRKN_LIDARR_1_APIKEY=xxxxxxxxxxxxxxxx
- VRKN_LIDARR_1_SSL=false
- VRKN_LIDARR_1_VERIFY_SSL=false
- VRKN_LIDARR_1_MISSING_DAYS=30
- VRKN_LIDARR_1_MISSING_DAYS_RUN_SECONDS=300
- VRKN_LIDARR_1_FUTURE_DAYS=30
- VRKN_LIDARR_1_FUTURE_DAYS_RUN_SECONDS=300
- VRKN_LIDARR_1_QUEUE=true
- VRKN_LIDARR_1_QUEUE_RUN_SECONDS=300
- VRKN_OMBI_1_URL=ombi.domain.tld
- VRKN_OMBI_1_APIKEY=xxxxxxxxxxxxxxxx
- VRKN_OMBI_1_SSL=false
- VRKN_OMBI_1_VERIFY_SSL=false
- VRKN_OMBI_1_GET_REQUEST_TYPE_COUNTS=true
- VRKN_OMBI_1_REQUEST_TYPE_RUN_SECONDS=300
- VRKN_OMBI_1_GET_REQUEST_TOTAL_COUNTS=true
- VRKN_OMBI_1_REQUEST_TOTAL_RUN_SECONDS=300
- VRKN_OMBI_1_GET_ISSUE_STATUS_COUNTS=true
- VRKN_OMBI_1_ISSUE_STATUS_RUN_SECONDS=300
- VRKN_SICKCHILL_1_URL=sickchill.domain.tld:8081
- VRKN_SICKCHILL_1_APIKEY=xxxxxxxxxxxxxxxx
- VRKN_SICKCHILL_1_SSL=false
- VRKN_SICKCHILL_1_VERIFY_SSL=false
- VRKN_SICKCHILL_1_GET_MISSING=true
- VRKN_SICKCHILL_1_GET_MISSING_RUN_SECONDS=300
- VRKN_UNIFI_1_URL=unifi.domain.tld:8443
- VRKN_UNIFI_1_USERNAME=ubnt
- VRKN_UNIFI_1_PASSWORD=ubnt
- VRKN_UNIFI_1_SITE=default
- VRKN_UNIFI_1_USG_NAME=MyRouter
- VRKN_UNIFI_1_SSL=false
- VRKN_UNIFI_1_VERIFY_SSL=false
- VRKN_UNIFI_1_GET_USG_STATS_RUN_SECONDS=300
depends_on:
- influxdb
restart: unless-stopped
Expand Down
2 changes: 1 addition & 1 deletion varken/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = "1.7.1"
VERSION = "1.7.2"
BRANCH = 'master'
2 changes: 1 addition & 1 deletion varken/dbmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
class DBManager(object):
def __init__(self, server):
self.server = server
self.logger = getLogger()
if self.server.url == "influxdb.domain.tld":
self.logger.critical("You have not configured your varken.ini. Please read Wiki page for configuration")
exit()
self.influx = InfluxDBClient(host=self.server.url, port=self.server.port, username=self.server.username,
password=self.server.password, ssl=self.server.ssl, database='varken',
verify_ssl=self.server.verify_ssl)
self.logger = getLogger()
try:
version = self.influx.request('ping', expected_response_code=204).headers['X-Influxdb-Version']
self.logger.info('Influxdb version: %s', version)
Expand Down
7 changes: 7 additions & 0 deletions varken/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,10 @@ def clean_sid_check(server_id_list, server_type=None):
else:
logger.error('No valid %s', t.upper())
return False


def boolcheck(var):
if var.lower() in ['true', 'yes']:
return True
else:
return False
Loading