Skip to content

Commit 73410db

Browse files
v1.7.2 Merge
v1.7.2 Merge
2 parents 5570721 + b219fbb commit 73410db

File tree

11 files changed

+228
-71
lines changed

11 files changed

+228
-71
lines changed

CHANGELOG.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
# Change Log
22

3-
## [v1.7.1](https://github.com/Boerderij/Varken/tree/v1.7.1) (2019-06-03)
4-
[Full Changelog](https://github.com/Boerderij/Varken/compare/1.7.0...v1.7.1)
3+
## [v1.7.2](https://github.com/Boerderij/Varken/tree/v1.7.2) (2019-06-23)
4+
[Full Changelog](https://github.com/Boerderij/Varken/compare/1.7.1...v1.7.2)
5+
6+
**Implemented enhancements:**
7+
8+
- Allow configuration via environment variables [\#137](https://github.com/Boerderij/Varken/issues/137)
9+
10+
**Fixed bugs:**
11+
12+
- \[BUG\] logger invoked before initialization in dbmanager [\#138](https://github.com/Boerderij/Varken/issues/138)
13+
14+
**Merged pull requests:**
15+
16+
- v1.7.2 Merge [\#144](https://github.com/Boerderij/Varken/pull/144) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
17+
18+
## [1.7.1](https://github.com/Boerderij/Varken/tree/1.7.1) (2019-06-04)
19+
[Full Changelog](https://github.com/Boerderij/Varken/compare/1.7.0...1.7.1)
520

621
**Fixed bugs:**
722

@@ -273,7 +288,7 @@
273288
**Merged pull requests:**
274289

275290
- v0.1 [\#20](https://github.com/Boerderij/Varken/pull/20) ([samwiseg0](https://github.com/samwiseg0))
276-
- Added selfplug [\#19](https://github.com/Boerderij/Varken/pull/19) ([si0972](https://github.com/si0972))
291+
- Added selfplug [\#19](https://github.com/Boerderij/Varken/pull/19) ([Roxedus](https://github.com/Roxedus))
277292
- Major rework of the scripts [\#14](https://github.com/Boerderij/Varken/pull/14) ([samwiseg0](https://github.com/samwiseg0))
278293
- fix worldmap after change to maxmind local db [\#11](https://github.com/Boerderij/Varken/pull/11) ([madbuda](https://github.com/madbuda))
279294
- Update sonarr.py [\#7](https://github.com/Boerderij/Varken/pull/7) ([ghost](https://github.com/ghost))

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
FROM amd64/python:3.7.2-alpine
1+
FROM amd64/python:3.7.3-alpine
22

33
LABEL maintainers="dirtycajunrice,samwiseg0"
44

55
ENV DEBUG="True"
66

7+
ENV DATA_FOLDER="/config"
8+
79
WORKDIR /app
810

911
COPY /requirements.txt /Varken.py /app/
@@ -15,8 +17,8 @@ COPY /data /app/data
1517
COPY /utilities /app/data/utilities
1618

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

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

2224
VOLUME /config

Dockerfile.arm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
FROM arm32v6/python:3.7.2-alpine
1+
FROM arm32v6/python:3.7.3-alpine
22

33
LABEL maintainers="dirtycajunrice,samwiseg0"
44

55
ENV DEBUG="True"
66

7+
ENV DATA_FOLDER="/config"
8+
79
WORKDIR /app
810

911
COPY /requirements.txt /Varken.py /app/
@@ -13,8 +15,8 @@ COPY /varken /app/varken
1315
COPY /data /app/data
1416

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

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

2022
VOLUME /config

Dockerfile.arm64

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
FROM arm64v8/python:3.7.2-alpine
1+
FROM arm64v8/python:3.7.3-alpine
22

33
LABEL maintainers="dirtycajunrice,samwiseg0"
44

55
ENV DEBUG="True"
66

7+
ENV DATA_FOLDER="/config"
8+
79
WORKDIR /app
810

911
COPY /requirements.txt /Varken.py /app/
@@ -13,8 +15,8 @@ COPY /varken /app/varken
1315
COPY /data /app/data
1416

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

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

2022
VOLUME /config

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img width="800" src="https://raw.githubusercontent.com/Boerderij/Varken/develop/assets/varken_full_banner.jpg" alt="Logo Banner">
2+
<img width="800" src="https://raw.githubusercontent.com/Boerderij/Varken/master/assets/varken_full_banner.jpg" alt="Logo Banner">
33
</p>
44

55
[![Build Status](https://jenkins.cajun.pro/buildStatus/icon?job=Varken/master)](https://jenkins.cajun.pro/job/Varken/job/master/)

Varken.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from queue import Queue
55
from sys import version
66
from threading import Thread
7+
from os import environ as env
78
from os import access, R_OK, getenv
89
from distro import linux_distribution
910
from os.path import isdir, abspath, dirname, join
@@ -45,26 +46,22 @@ def thread(job, **kwargs):
4546

4647
opts = parser.parse_args()
4748

48-
DATA_FOLDER = abspath(join(dirname(__file__), 'data'))
49-
5049
templogger = getLogger('temp')
5150
templogger.setLevel(DEBUG)
5251
tempch = StreamHandler()
5352
tempformatter = Formatter('%(asctime)s : %(levelname)s : %(module)s : %(message)s', '%Y-%m-%d %H:%M:%S')
5453
tempch.setFormatter(tempformatter)
5554
templogger.addHandler(tempch)
5655

57-
if opts.data_folder:
58-
ARG_FOLDER = opts.data_folder
56+
DATA_FOLDER = env.get('DATA_FOLDER', vars(opts).get('data_folder') or abspath(join(dirname(__file__), 'data')))
5957

60-
if isdir(ARG_FOLDER):
61-
DATA_FOLDER = ARG_FOLDER
62-
if not access(DATA_FOLDER, R_OK):
63-
templogger.error("Read permission error for %s", DATA_FOLDER)
64-
exit(1)
65-
else:
66-
templogger.error("%s does not exist", ARG_FOLDER)
58+
if isdir(DATA_FOLDER):
59+
if not access(DATA_FOLDER, R_OK):
60+
templogger.error("Read permission error for %s", DATA_FOLDER)
6761
exit(1)
62+
else:
63+
templogger.error("%s does not exist", DATA_FOLDER)
64+
exit(1)
6865

6966
# Set Debug to True if DEBUG env is set
7067
enable_opts = ['True', 'true', 'yes']

docker-compose.yml

Lines changed: 92 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,99 @@ services:
2121
volumes:
2222
- /path/to/docker-varken/config-folder:/config
2323
environment:
24-
- PGID=911
25-
- PUID=911
2624
- TZ=America/Chicago
25+
- VRKN_GLOBAL_SONARR_SERVER_IDS=1,2
26+
- VRKN_GLOBAL_RADARR_SERVER_IDS=1,2
27+
- VRKN_GLOBAL_LIDARR_SERVER_IDS=false
28+
- VRKN_GLOBAL_TAUTULLI_SERVER_IDS=1
29+
- VRKN_GLOBAL_OMBI_SERVER_IDS=1
30+
- VRKN_GLOBAL_SICKCHILL_SERVER_IDS=false
31+
- VRKN_GLOBAL_UNIFI_SERVER_IDS=false
32+
- VRKN_INFLUXDB_URL=influxdb.domain.tld
33+
- VRKN_INFLUXDB_PORT=8086
34+
- VRKN_INFLUXDB_SSL=false
35+
- VRKN_INFLUXDB_VERIFY_SSL=false
36+
- VRKN_INFLUXDB_USERNAME=root
37+
- VRKN_INFLUXDB_PASSWORD=root
38+
- VRKN_TAUTULLI_1_URL=tautulli.domain.tld:8181
39+
- VRKN_TAUTULLI_1_FALLBACK_IP=1.1.1.1
40+
- VRKN_TAUTULLI_1_APIKEY=xxxxxxxxxxxxxxxx
41+
- VRKN_TAUTULLI_1_SSL=false
42+
- VRKN_TAUTULLI_1_VERIFY_SSL=false
43+
- VRKN_TAUTULLI_1_GET_ACTIVITY=true
44+
- VRKN_TAUTULLI_1_GET_ACTIVITY_RUN_SECONDS=30
45+
- VRKN_TAUTULLI_1_GET_STATS=true
46+
- VRKN_TAUTULLI_1_GET_STATS_RUN_SECONDS=3600
47+
- VRKN_SONARR_1_URL=sonarr1.domain.tld:8989
48+
- VRKN_SONARR_1_APIKEY=xxxxxxxxxxxxxxxx
49+
- VRKN_SONARR_1_SSL=false
50+
- VRKN_SONARR_1_VERIFY_SSL=false
51+
- VRKN_SONARR_1_MISSING_DAYS=7
52+
- VRKN_SONARR_1_MISSING_DAYS_RUN_SECONDS=300
53+
- VRKN_SONARR_1_FUTURE_DAYS=1
54+
- VRKN_SONARR_1_FUTURE_DAYS_RUN_SECONDS=300
55+
- VRKN_SONARR_1_QUEUE=true
56+
- VRKN_SONARR_1_QUEUE_RUN_SECONDS=300
57+
- VRKN_SONARR_2_URL=sonarr2.domain.tld:8989
58+
- VRKN_SONARR_2_APIKEY=yyyyyyyyyyyyyyyy
59+
- VRKN_SONARR_2_SSL=false
60+
- VRKN_SONARR_2_VERIFY_SSL=false
61+
- VRKN_SONARR_2_MISSING_DAYS=7
62+
- VRKN_SONARR_2_MISSING_DAYS_RUN_SECONDS=300
63+
- VRKN_SONARR_2_FUTURE_DAYS=1
64+
- VRKN_SONARR_2_FUTURE_DAYS_RUN_SECONDS=300
65+
- VRKN_SONARR_2_QUEUE=true
66+
- VRKN_SONARR_2_QUEUE_RUN_SECONDS=300
67+
- VRKN_RADARR_1_URL=radarr1.domain.tld
68+
- VRKN_RADARR_1_APIKEY=xxxxxxxxxxxxxxxx
69+
- VRKN_RADARR_1_SSL=false
70+
- VRKN_RADARR_1_VERIFY_SSL=false
71+
- VRKN_RADARR_1_QUEUE=true
72+
- VRKN_RADARR_1_QUEUE_RUN_SECONDS=300
73+
- VRKN_RADARR_1_GET_MISSING=true
74+
- VRKN_RADARR_1_GET_MISSING_RUN_SECONDS=300
75+
- VRKN_RADARR_2_URL=radarr2.domain.tld
76+
- VRKN_RADARR_2_APIKEY=yyyyyyyyyyyyyyyy
77+
- VRKN_RADARR_2_SSL=false
78+
- VRKN_RADARR_2_VERIFY_SSL=false
79+
- VRKN_RADARR_2_QUEUE=true
80+
- VRKN_RADARR_2_QUEUE_RUN_SECONDS=300
81+
- VRKN_RADARR_2_GET_MISSING=true
82+
- VRKN_RADARR_2_GET_MISSING_RUN_SECONDS=300
83+
- VRKN_LIDARR_1_URL=lidarr1.domain.tld:8686
84+
- VRKN_LIDARR_1_APIKEY=xxxxxxxxxxxxxxxx
85+
- VRKN_LIDARR_1_SSL=false
86+
- VRKN_LIDARR_1_VERIFY_SSL=false
87+
- VRKN_LIDARR_1_MISSING_DAYS=30
88+
- VRKN_LIDARR_1_MISSING_DAYS_RUN_SECONDS=300
89+
- VRKN_LIDARR_1_FUTURE_DAYS=30
90+
- VRKN_LIDARR_1_FUTURE_DAYS_RUN_SECONDS=300
91+
- VRKN_LIDARR_1_QUEUE=true
92+
- VRKN_LIDARR_1_QUEUE_RUN_SECONDS=300
93+
- VRKN_OMBI_1_URL=ombi.domain.tld
94+
- VRKN_OMBI_1_APIKEY=xxxxxxxxxxxxxxxx
95+
- VRKN_OMBI_1_SSL=false
96+
- VRKN_OMBI_1_VERIFY_SSL=false
97+
- VRKN_OMBI_1_GET_REQUEST_TYPE_COUNTS=true
98+
- VRKN_OMBI_1_REQUEST_TYPE_RUN_SECONDS=300
99+
- VRKN_OMBI_1_GET_REQUEST_TOTAL_COUNTS=true
100+
- VRKN_OMBI_1_REQUEST_TOTAL_RUN_SECONDS=300
101+
- VRKN_OMBI_1_GET_ISSUE_STATUS_COUNTS=true
102+
- VRKN_OMBI_1_ISSUE_STATUS_RUN_SECONDS=300
103+
- VRKN_SICKCHILL_1_URL=sickchill.domain.tld:8081
104+
- VRKN_SICKCHILL_1_APIKEY=xxxxxxxxxxxxxxxx
105+
- VRKN_SICKCHILL_1_SSL=false
106+
- VRKN_SICKCHILL_1_VERIFY_SSL=false
107+
- VRKN_SICKCHILL_1_GET_MISSING=true
108+
- VRKN_SICKCHILL_1_GET_MISSING_RUN_SECONDS=300
109+
- VRKN_UNIFI_1_URL=unifi.domain.tld:8443
110+
- VRKN_UNIFI_1_USERNAME=ubnt
111+
- VRKN_UNIFI_1_PASSWORD=ubnt
112+
- VRKN_UNIFI_1_SITE=default
113+
- VRKN_UNIFI_1_USG_NAME=MyRouter
114+
- VRKN_UNIFI_1_SSL=false
115+
- VRKN_UNIFI_1_VERIFY_SSL=false
116+
- VRKN_UNIFI_1_GET_USG_STATS_RUN_SECONDS=300
27117
depends_on:
28118
- influxdb
29119
restart: unless-stopped

varken/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION = "1.7.1"
1+
VERSION = "1.7.2"
22
BRANCH = 'master'

varken/dbmanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
class DBManager(object):
99
def __init__(self, server):
1010
self.server = server
11+
self.logger = getLogger()
1112
if self.server.url == "influxdb.domain.tld":
1213
self.logger.critical("You have not configured your varken.ini. Please read Wiki page for configuration")
1314
exit()
1415
self.influx = InfluxDBClient(host=self.server.url, port=self.server.port, username=self.server.username,
1516
password=self.server.password, ssl=self.server.ssl, database='varken',
1617
verify_ssl=self.server.verify_ssl)
17-
self.logger = getLogger()
1818
try:
1919
version = self.influx.request('ping', expected_response_code=204).headers['X-Influxdb-Version']
2020
self.logger.info('Influxdb version: %s', version)

varken/helpers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,10 @@ def clean_sid_check(server_id_list, server_type=None):
196196
else:
197197
logger.error('No valid %s', t.upper())
198198
return False
199+
200+
201+
def boolcheck(var):
202+
if var.lower() in ['true', 'yes']:
203+
return True
204+
else:
205+
return False

0 commit comments

Comments
 (0)