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 5 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/
49 changes: 28 additions & 21 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@
# ╚════██║██║ ██╔══██╗██║██╔═══╝ ██║ ╚════██║ #
# ███████║╚██████╗██║ ██║██║██║ ██║ ███████║ #
# ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚══════╝ #
# Created by @westsurname #
# #
# The headings contain the scripts that require the #
# the variables within. #
#------------------------------------------------------#

#--------#
# SERVER #
#--------#
#--------------#
# Blackhole UI #
#--------------#

SERVER_DOMAIN=<server_domain>
SERVER_DOMAIN=<server_domain> #add if using a domain name / reverse proxy
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this only pertinent to the ui?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During development it was, but I may have changed it. It was a cors variable.

TMDB_API_KEY=
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably have its own section, like with most other integrations.

CONNECTION_VALUE=ws #for most usecases, do not change

#-------------------------------------------------------------------#
# PLEX - WATCHLIST, PLEX AUTHENTICATION, PLEX REQUEST, PLEX REFRESH #
Expand All @@ -36,41 +42,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 +92,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 @@ -154,3 +160,4 @@ 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"
]
}
44 changes: 22 additions & 22 deletions Dockerfile.blackhole
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert whitespace changes

Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
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"]
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"]
46 changes: 46 additions & 0 deletions Dockerfile.blackhole-ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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/
Comment on lines +15 to +23
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably be simplified

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or removed? It doesn't seem like we're using the static folder here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s for the react build of the front end


# 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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this have it's own service with it's own python dependencies?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait this is a duplicate of blackhole just with the ui? Why have a separate docker image for it in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah the gitignore may have skipped the updated dependencies. I’ll check this

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