Docker: Set default env values to prevent issues
Set default values to prevent issues where it thinks values are set and causing json read errors Signed-off-by: Luis Garcia <git@luigi311.com>pull/235/head
parent
ac5be474f8
commit
fcd6103e17
|
|
@ -64,5 +64,44 @@ COPY . .
|
||||||
RUN chmod +x *.sh && \
|
RUN chmod +x *.sh && \
|
||||||
dos2unix *.sh
|
dos2unix *.sh
|
||||||
|
|
||||||
|
# Set default values to prevent issues
|
||||||
|
ENV DRYRUN="True"
|
||||||
|
ENV DEBUG_LEVEL="INFO"
|
||||||
|
ENV RUN_ONLY_ONCE="False"
|
||||||
|
ENV SLEEP_DURATION=3600
|
||||||
|
ENV LOG_FILE="log.log"
|
||||||
|
ENV MARK_FILE="mark.log"
|
||||||
|
ENV REQUEST_TIME=300
|
||||||
|
ENV GENERATE_GUIDS="True"
|
||||||
|
ENV GENERATE_LOCATIONS="True"
|
||||||
|
ENV MAX_THREADS=1
|
||||||
|
ENV USER_MAPPING=""
|
||||||
|
ENV LIBRARY_MAPPING=""
|
||||||
|
ENV BLACKLIST_LIBRARY=""
|
||||||
|
ENV WHITELIST_LIBRARY=""
|
||||||
|
ENV BLACKLIST_LIBRARY_TYPE=""
|
||||||
|
ENV WHITELIST_LIBRARY_TYPE=""
|
||||||
|
ENV BLACKLIST_USERS=""
|
||||||
|
ENV WHITELIST_USERS=""
|
||||||
|
ENV PLEX_BASEURL=""
|
||||||
|
ENV PLEX_TOKEN=""
|
||||||
|
ENV PLEX_USERNAME=""
|
||||||
|
ENV PLEX_PASSWORD=""
|
||||||
|
ENV PLEX_SERVERNAME=""
|
||||||
|
ENV SSL_BYPASS="False"
|
||||||
|
ENV JELLYFIN_BASEURL=""
|
||||||
|
ENV JELLYFIN_TOKEN=""
|
||||||
|
ENV EMBY_BASEURL=""
|
||||||
|
ENV EMBY_TOKEN=""
|
||||||
|
ENV SYNC_FROM_PLEX_TO_JELLYFIN="True"
|
||||||
|
ENV SYNC_FROM_PLEX_TO_PLEX="True"
|
||||||
|
ENV SYNC_FROM_PLEX_TO_EMBY="True"
|
||||||
|
ENV SYNC_FROM_JELLYFIN_TO_PLEX="True"
|
||||||
|
ENV SYNC_FROM_JELLYFIN_TO_JELLYFIN="True"
|
||||||
|
ENV SYNC_FROM_JELLYFIN_TO_EMBY="True"
|
||||||
|
ENV SYNC_FROM_EMBY_TO_PLEX="True"
|
||||||
|
ENV SYNC_FROM_EMBY_TO_JELLYFIN="True"
|
||||||
|
ENV SYNC_FROM_EMBY_TO_EMBY="True"
|
||||||
|
|
||||||
ENTRYPOINT ["tini", "--", "/app/entrypoint.sh"]
|
ENTRYPOINT ["tini", "--", "/app/entrypoint.sh"]
|
||||||
CMD ["python", "-u", "main.py"]
|
CMD ["python", "-u", "main.py"]
|
||||||
|
|
|
||||||
|
|
@ -38,5 +38,44 @@ ENV PATH="/app/.venv/bin:$PATH"
|
||||||
RUN chmod +x *.sh && \
|
RUN chmod +x *.sh && \
|
||||||
dos2unix *.sh
|
dos2unix *.sh
|
||||||
|
|
||||||
|
# Set default values to prevent issues
|
||||||
|
ENV DRYRUN="True"
|
||||||
|
ENV DEBUG_LEVEL="INFO"
|
||||||
|
ENV RUN_ONLY_ONCE="False"
|
||||||
|
ENV SLEEP_DURATION=3600
|
||||||
|
ENV LOG_FILE="log.log"
|
||||||
|
ENV MARK_FILE="mark.log"
|
||||||
|
ENV REQUEST_TIME=300
|
||||||
|
ENV GENERATE_GUIDS="True"
|
||||||
|
ENV GENERATE_LOCATIONS="True"
|
||||||
|
ENV MAX_THREADS=1
|
||||||
|
ENV USER_MAPPING=""
|
||||||
|
ENV LIBRARY_MAPPING=""
|
||||||
|
ENV BLACKLIST_LIBRARY=""
|
||||||
|
ENV WHITELIST_LIBRARY=""
|
||||||
|
ENV BLACKLIST_LIBRARY_TYPE=""
|
||||||
|
ENV WHITELIST_LIBRARY_TYPE=""
|
||||||
|
ENV BLACKLIST_USERS=""
|
||||||
|
ENV WHITELIST_USERS=""
|
||||||
|
ENV PLEX_BASEURL=""
|
||||||
|
ENV PLEX_TOKEN=""
|
||||||
|
ENV PLEX_USERNAME=""
|
||||||
|
ENV PLEX_PASSWORD=""
|
||||||
|
ENV PLEX_SERVERNAME=""
|
||||||
|
ENV SSL_BYPASS="False"
|
||||||
|
ENV JELLYFIN_BASEURL=""
|
||||||
|
ENV JELLYFIN_TOKEN=""
|
||||||
|
ENV EMBY_BASEURL=""
|
||||||
|
ENV EMBY_TOKEN=""
|
||||||
|
ENV SYNC_FROM_PLEX_TO_JELLYFIN="True"
|
||||||
|
ENV SYNC_FROM_PLEX_TO_PLEX="True"
|
||||||
|
ENV SYNC_FROM_PLEX_TO_EMBY="True"
|
||||||
|
ENV SYNC_FROM_JELLYFIN_TO_PLEX="True"
|
||||||
|
ENV SYNC_FROM_JELLYFIN_TO_JELLYFIN="True"
|
||||||
|
ENV SYNC_FROM_JELLYFIN_TO_EMBY="True"
|
||||||
|
ENV SYNC_FROM_EMBY_TO_PLEX="True"
|
||||||
|
ENV SYNC_FROM_EMBY_TO_JELLYFIN="True"
|
||||||
|
ENV SYNC_FROM_EMBY_TO_EMBY="True"
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/tini", "--", "/app/entrypoint.sh"]
|
ENTRYPOINT ["/bin/tini", "--", "/app/entrypoint.sh"]
|
||||||
CMD ["python", "-u", "main.py"]
|
CMD ["python", "-u", "main.py"]
|
||||||
|
|
|
||||||
10
src/main.py
10
src/main.py
|
|
@ -96,12 +96,14 @@ def main_loop():
|
||||||
dryrun = str_to_bool(os.getenv("DRYRUN", "False"))
|
dryrun = str_to_bool(os.getenv("DRYRUN", "False"))
|
||||||
logger.info(f"Dryrun: {dryrun}")
|
logger.info(f"Dryrun: {dryrun}")
|
||||||
|
|
||||||
user_mapping = os.getenv("USER_MAPPING", "")
|
user_mapping = os.getenv("USER_MAPPING", None)
|
||||||
user_mapping = json.loads(user_mapping.lower())
|
if user_mapping:
|
||||||
|
user_mapping = json.loads(user_mapping.lower())
|
||||||
logger.info(f"User Mapping: {user_mapping}")
|
logger.info(f"User Mapping: {user_mapping}")
|
||||||
|
|
||||||
library_mapping = os.getenv("LIBRARY_MAPPING", "")
|
library_mapping = os.getenv("LIBRARY_MAPPING", None)
|
||||||
library_mapping = json.loads(library_mapping)
|
if library_mapping:
|
||||||
|
library_mapping = json.loads(library_mapping)
|
||||||
logger.info(f"Library Mapping: {library_mapping}")
|
logger.info(f"Library Mapping: {library_mapping}")
|
||||||
|
|
||||||
# Create (black/white)lists
|
# Create (black/white)lists
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue