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

Blackhole UI #40

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
node_modules/
client/node_modules/
53 changes: 33 additions & 20 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
# ╚════██║██║ ██╔══██╗██║██╔═══╝ ██║ ╚════██║ #
# ███████║╚██████╗██║ ██║██║██║ ██║ ███████║ #
# ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚══════╝ #
# Created by @westsurname #
# #
# The headings contain the scripts that require the #
# the variables within. #
#------------------------------------------------------#

#--------#
# SERVER #
#--------#
#---------------#
# SERVER DOMAIN #
#---------------#

SERVER_DOMAIN=<server_domain>

Expand All @@ -36,41 +40,41 @@ OVERSEERR_API_KEY=<overseerr_api_key>
# SONARR - BLACKHOLE, REPAIR, IMPORT TORRENT FOLDER, RECLAIM SPACE, ADD NEXT EPISODE #
#------------------------------------------------------------------------------------#

SONARR_HOST=<sonarr_host>
SONARR_HOST=<sonarr_host> # http://sonarr:8989
SONARR_API_KEY=<sonarr_api_key>
SONARR_ROOT_FOLDER=<sonarr_root_folder>
SONARR_ROOT_FOLDER=<sonarr_root_folder> # /mnt/plex/TV

SONARR_HOST_4K=<sonarr_host_4k>
SONARR_HOST_4K=<sonarr_host_4k> # http://sonarr4k:8989
SONARR_API_KEY_4K=<sonarr_api_key_4k>
SONARR_ROOT_FOLDER_4K=<sonarr_root_folder_4k>
SONARR_ROOT_FOLDER_4K=<sonarr_root_folder_4k> # /mnt/plex/TV - 4K

SONARR_HOST_ANIME=<sonarr_host_anime>
SONARR_HOST_ANIME=<sonarr_host_anime> # http://sonarranime:8989
SONARR_API_KEY_ANIME=<sonarr_api_key_anime>
SONARR_ROOT_FOLDER_ANIME=<sonarr_root_folder_anime>
SONARR_ROOT_FOLDER_ANIME=<sonarr_root_folder_anime> # /mnt/plex/TV - Anime

SONARR_HOST_MUX=<sonarr_host_mux>
SONARR_HOST_MUX=<sonarr_host_mux> # http://sonarrmux:8989
SONARR_API_KEY_MUX=<sonarr_api_key_mux>
SONARR_ROOT_FOLDER_MUX=<sonarr_root_folder_mux>
SONARR_ROOT_FOLDER_MUX=<sonarr_root_folder_mux> # /mnt/plex/TV - Remux

#------------------------------------------------------------------#
# RADARR - BLACKHOLE, REPAIR, IMPORT TORRENT FOLDER, RECLAIM SPACE #
#------------------------------------------------------------------#

RADARR_HOST=<radarr_host>
RADARR_HOST=<radarr_host> # http://radarr:7878
RADARR_API_KEY=<radarr_api_key>
RADARR_ROOT_FOLDER=<radarr_root_folder>
RADARR_ROOT_FOLDER=<radarr_root_folder> # /mnt/plex/Movies

RADARR_HOST_4K=<radarr_host_4k>
RADARR_HOST_4K=<radarr_host_4k> # http://radarr4k:7878
RADARR_API_KEY_4K=<radarr_api_key_4k>
RADARR_ROOT_FOLDER_4K=<radarr_root_folder_4k>
RADARR_ROOT_FOLDER_4K=<radarr_root_folder_4k> # /mnt/plex/Movies - 4K

RADARR_HOST_ANIME=<radarr_host_anime>
RADARR_HOST_ANIME=<radarr_host_anime> # http://radarranime:7878
RADARR_API_KEY_ANIME=<radarr_api_key_anime>
RADARR_ROOT_FOLDER_ANIME=<radarr_root_folder_anime>
RADARR_ROOT_FOLDER_ANIME=<radarr_root_folder_anime> # /mnt/plex/Movies - Anime

RADARR_HOST_MUX=<radarr_host_mux>
RADARR_HOST_MUX=<radarr_host_mux> # http://radarrmux:7878
RADARR_API_KEY_MUX=<radarr_api_key_mux>
RADARR_ROOT_FOLDER_MUX=<radarr_root_folder_mux>
RADARR_ROOT_FOLDER_MUX=<radarr_root_folder_mux> # /mnt/plex/Movies - Remux

#--------------------------#
# TAUTULLI - RECLAIM SPACE #
Expand All @@ -86,7 +90,7 @@ TAUTULLI_API_KEY=<tautulli_api_key>
REALDEBRID_ENABLED=true
REALDEBRID_HOST="https://api.real-debrid.com/rest/1.0/"
REALDEBRID_API_KEY=<realdebrid_api_key>
REALDEBRID_MOUNT_TORRENTS_PATH=
REALDEBRID_MOUNT_TORRENTS_PATH= # /path/torclone/mount/__all__

#---------------------------#
# TORBOX - BLACKHOLE, REPAIR #
Expand Down Expand Up @@ -123,6 +127,13 @@ BLACKHOLE_RD_MOUNT_REFRESH_SECONDS=200
BLACKHOLE_WAIT_FOR_TORRENT_TIMEOUT=60
BLACKHOLE_HISTORY_PAGE_SIZE=500

#--------------------------#
# BLACKHOLE UI - BLACKHOLE #
#--------------------------#

TMDB_API_KEY=
CONNECTION_VALUE=ws

#------------------------------#
# PLEX REQUEST - PLEX REQUEST #
#------------------------------#
Expand Down Expand Up @@ -154,3 +165,5 @@ PGID=
UMASK=002
DOCKER_NETWORK="scripts_default"
DOCKER_NETWORK_EXTERNAL=false


28 changes: 27 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,30 @@ logs/blackhole.log
blackhole/

# Tokens
shared/tokens.json
shared/tokens.json

# Development
.idea/
.vscode/
*.swp
*.swo
.env.local
.env.development.local
.env.test.local
.env.production.local

# Node/React
node_modules/
/build
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.eslintcache
*.tsbuildinfo

# Cache
.npm/

# Project specific
cache/
sockets/
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"cSpell.words": [
"bencode",
"blackhole",
"blackholemux",
"certresolver",
"cfdns",
"cloudflarewarp",
"cooldown",
"davyjones",
"loadbalancer",
"mediainfo",
"PGID",
"PUID",
"RADARR",
"repairanime",
"securetls",
"traefik",
"watchlist",
"websecure",
"westsurname"
]
}
68 changes: 46 additions & 22 deletions Dockerfile.blackhole
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
FROM python:3.9-slim

# Metadata labels
LABEL org.opencontainers.image.source="https://github.com/westsurname/scripts"
LABEL org.opencontainers.image.description="Docker image for the blackhole service"

ARG SERVICE_NAME=blackhole

# Set working directory
WORKDIR /app

# Copy only the files needed for pip install to maximize cache utilization
COPY requirements.txt ./

# Install Python dependencies
RUN grep -E "#.*($SERVICE_NAME|all)" requirements.txt | awk '{print $0}' > service_requirements.txt && \
pip install --no-cache-dir -r service_requirements.txt

# Copy the rest of the application
COPY . .

CMD ["python", "blackhole_watcher.py"]
# Frontend build stage
FROM node:18-slim AS frontend-builder
WORKDIR /app

# Copy package files first for better caching
COPY client/package*.json ./
RUN npm install

# Copy the rest of the client code
COPY client/ ./

# Build the frontend first
RUN npm run build

# Create directory structure for mediainfo images
RUN mkdir -p /app/build/static/images/mediainfo/codec \
/app/build/static/images/mediainfo/edition \
/app/build/static/images/mediainfo/resolution

# Copy mediainfo images to the correct location and verify
COPY client/src/images/mediainfo/codec/* /app/build/static/images/mediainfo/codec/
COPY client/src/images/mediainfo/edition/* /app/build/static/images/mediainfo/edition/
COPY client/src/images/mediainfo/resolution/* /app/build/static/images/mediainfo/resolution/

# Python application stage
FROM python:3.9-slim
LABEL org.opencontainers.image.source="https://github.com/westsurname/scripts"
LABEL org.opencontainers.image.description="Docker image for the blackhole service"

ARG SERVICE_NAME=blackhole
WORKDIR /app

# Install Python dependencies first for better caching
COPY requirements.txt ./
RUN grep -E "#.*($SERVICE_NAME|all)" requirements.txt | awk '{print $0}' > service_requirements.txt && \
pip install --no-cache-dir -r service_requirements.txt

# Copy application code
COPY . .

# Copy frontend build files
COPY --from=frontend-builder /app/build/* /app/static/

ENV PYTHONBUFFERED=1

CMD ["python", "blackhole_watcher.py"]
Loading
Loading