diff --git a/backend/apps/management/commands/imedia.py b/backend/apps/management/commands/imedia.py new file mode 100644 index 0000000..16b746b --- /dev/null +++ b/backend/apps/management/commands/imedia.py @@ -0,0 +1,17 @@ +"""Creates the media category for the home portal.""" + +from typing import Any, no_type_check + +from django.core.management.base import BaseCommand + +from apps.models import HomePortalCategory + + +class Command(BaseCommand): + """Create the media category for the home portal.""" + + @no_type_check + def handle(self, *args: Any, **options: Any) -> None: + """Create the media category for the home portal.""" + category = HomePortalCategory.objects.create(title="Media", icon="PlayCircleOutlined") + category.save() diff --git a/backend/apps/management/commands/iplex.py b/backend/apps/management/commands/iplex.py new file mode 100644 index 0000000..c85c683 --- /dev/null +++ b/backend/apps/management/commands/iplex.py @@ -0,0 +1,32 @@ +"""Creates the plex app for the home portal.""" + +from typing import Any, no_type_check + +from django.core.management.base import BaseCommand + +from apps.models import HomePortalApplication, HomePortalCategory + + +class Command(BaseCommand): + """Create the plex app for the home portal.""" + + @no_type_check + def handle(self, *args: Any, **options: Any) -> None: + """Create the plex app for the home portal.""" + category = HomePortalCategory.objects.get(title="Media") + + link = input( + "Please enter your plex link (This will be a direct link and not proxied via the HomePortal): " # noqa + ) + + app = HomePortalApplication.objects.create( + title="Plex", + description="Plex is a media server that allows you to stream your media to any device.", # noqa + link_name="Plex", + link=link, + side_menu_visible=True, + category=category, + side_menu_name="Plex", + side_menu_icon="PlayCircleOutlined", + ) + app.save() diff --git a/backend/apps/management/commands/iprowlarr.py b/backend/apps/management/commands/iprowlarr.py new file mode 100644 index 0000000..8d26529 --- /dev/null +++ b/backend/apps/management/commands/iprowlarr.py @@ -0,0 +1,32 @@ +"""Creates the prowlarr app for the home portal.""" + +from typing import Any, no_type_check + +from django.core.management.base import BaseCommand + +from apps.models import HomePortalApplication, HomePortalCategory + + +class Command(BaseCommand): + """Create the prowlarr app for the home portal.""" + + @no_type_check + def handle(self, *args: Any, **options: Any) -> None: + """Create the prowlarr app for the home portal.""" + category = HomePortalCategory.objects.get(title="Media") + + link = input( + "Please enter your prowlarr link (This will be a direct link and not proxied via the HomePortal): " # noqa + ) + + app = HomePortalApplication.objects.create( + title="Prowlarr", + description="", + link_name="Prowlarr", + link=link, + side_menu_visible=True, + category=category, + side_menu_name="Prowlarr", + side_menu_icon="VerticalAlignBottomOutlined", + ) + app.save() diff --git a/backend/apps/management/commands/iradarr.py b/backend/apps/management/commands/iradarr.py new file mode 100644 index 0000000..dc0fd77 --- /dev/null +++ b/backend/apps/management/commands/iradarr.py @@ -0,0 +1,32 @@ +"""Creates the radarr app for the home portal.""" + +from typing import Any, no_type_check + +from django.core.management.base import BaseCommand + +from apps.models import HomePortalApplication, HomePortalCategory + + +class Command(BaseCommand): + """Create the radarr app for the home portal.""" + + @no_type_check + def handle(self, *args: Any, **options: Any) -> None: + """Create the radarr app for the home portal.""" + category = HomePortalCategory.objects.get(title="Media") + + link = input( + "Please enter your radarr link (This will be a direct link and not proxied via the HomePortal): " # noqa + ) + + app = HomePortalApplication.objects.create( + title="Radarr", + description="", + link_name="Radarr", + link=link, + side_menu_visible=True, + category=category, + side_menu_name="Radarr", + side_menu_icon="VerticalAlignBottomOutlined", + ) + app.save() diff --git a/backend/apps/management/commands/isonarr.py b/backend/apps/management/commands/isonarr.py new file mode 100644 index 0000000..9c11005 --- /dev/null +++ b/backend/apps/management/commands/isonarr.py @@ -0,0 +1,32 @@ +"""Creates the sonarr app for the home portal.""" + +from typing import Any, no_type_check + +from django.core.management.base import BaseCommand + +from apps.models import HomePortalApplication, HomePortalCategory + + +class Command(BaseCommand): + """Create the sonarr app for the home portal.""" + + @no_type_check + def handle(self, *args: Any, **options: Any) -> None: + """Create the sonarr app for the home portal.""" + category = HomePortalCategory.objects.get(title="Media") + + link = input( + "Please enter your sonarr link (This will be a direct link and not proxied via the HomePortal): " # noqa + ) + + app = HomePortalApplication.objects.create( + title="Sonarr", + description="", + link_name="Sonarr", + link=link, + side_menu_visible=True, + category=category, + side_menu_name="Sonarr", + side_menu_icon="VerticalAlignBottomOutlined", + ) + app.save() diff --git a/docker/site/Dockerfile b/docker/site/Dockerfile index bb017ea..6eb5ddb 100644 --- a/docker/site/Dockerfile +++ b/docker/site/Dockerfile @@ -1,17 +1,23 @@ FROM python:3.12.4-alpine3.20 AS backend +COPY backend/requirements.dev.txt /build/install/ +WORKDIR /build/install +RUN pip install -r requirements.dev.txt + COPY backend/ /build/backend/ WORKDIR /build/backend - -RUN pip install -r requirements.dev.txt RUN pytest . --cov=. --no-cov-on-fail --cov-report term-missing && coverage html FROM python:3.12.4-alpine3.20 AS docs +COPY docs/requirements.txt /build/install/ +WORKDIR /build/install + +RUN pip install -r requirements.txt + COPY docs/ /build/docs/ WORKDIR /build/docs -RUN pip install -r requirements.txt RUN mkdocs build FROM node:20.16.0-alpine3.20 AS components diff --git a/docs/docs/guides/plex.md b/docs/docs/guides/plex.md new file mode 100644 index 0000000..9307b0d --- /dev/null +++ b/docs/docs/guides/plex.md @@ -0,0 +1,23 @@ +# Plex Media Server + +This is a relatively simple guide to setting up Plex Media Server on your home portal. This guide assumes you have already setup your home portal and have a working instance of Plex Media Server running on your network. + +## 0. Install the media category + +There are a few apps that fall under the media category. To install the media category, run the following command: + +NOTE: You should only run this command if you have not already installed the media category. + +```bash +./scripts/media.sh +``` + +## 1. Integrate plex with the home portal + +To integrate Plex with the home portal, you will need to run the following script: + +```bash +./scripts/plex.sh +``` + +And that is it, the script will ask for your link to plex and setup a redirect to it via the home portal. diff --git a/docs/docs/guides/prowlarr.md b/docs/docs/guides/prowlarr.md new file mode 100644 index 0000000..7ebbdff --- /dev/null +++ b/docs/docs/guides/prowlarr.md @@ -0,0 +1,23 @@ +# Prowlarr + +This is a relatively simple guide to setting up Prowlarr on your home portal. This guide assumes you have already setup your home portal and have a working instance of Prowlarr running on your network. + +## 0. Install the media category + +There are a few apps that fall under the media category. To install the media category, run the following command: + +NOTE: You should only run this command if you have not already installed the media category. + +```bash +./scripts/media.sh +``` + +## 1. Integrate prowlarr with the home portal + +To integrate prowlarr with the home portal, you will need to run the following script: + +```bash +./scripts/prowlarr.sh +``` + +And that is it, the script will ask for your link to prowlarr and setup a redirect to it via the home portal. diff --git a/docs/docs/guides/radarr.md b/docs/docs/guides/radarr.md new file mode 100644 index 0000000..96fe007 --- /dev/null +++ b/docs/docs/guides/radarr.md @@ -0,0 +1,23 @@ +# Radarr + +This is a relatively simple guide to setting up Radarr on your home portal. This guide assumes you have already setup your home portal and have a working instance of Radarr running on your network. + +## 0. Install the media category + +There are a few apps that fall under the media category. To install the media category, run the following command: + +NOTE: You should only run this command if you have not already installed the media category. + +```bash +./scripts/media.sh +``` + +## 1. Integrate Radarr with the home portal + +To integrate Radarr with the home portal, you will need to run the following script: + +```bash +./scripts/radarr.sh +``` + +And that is it, the script will ask for your link to radarr and setup a redirect to it via the home portal. diff --git a/docs/docs/guides/sonarr.md b/docs/docs/guides/sonarr.md new file mode 100644 index 0000000..0efd647 --- /dev/null +++ b/docs/docs/guides/sonarr.md @@ -0,0 +1,23 @@ +# Sonarr + +This is a relatively simple guide to setting up Sonarr on your home portal. This guide assumes you have already setup your home portal and have a working instance of Sonarr running on your network. + +## 0. Install the media category + +There are a few apps that fall under the media category. To install the media category, run the following command: + +NOTE: You should only run this command if you have not already installed the media category. + +```bash +./scripts/media.sh +``` + +## 1. Integrate Sonarr with the home portal + +To integrate Sonarr with the home portal, you will need to run the following script: + +```bash +./scripts/sonarr.sh +``` + +And that is it, the script will ask for your link to Sonarr and setup a redirect to it via the home portal. diff --git a/docs/mkdocs.yaml b/docs/mkdocs.yaml index 4366bc2..c97b978 100644 --- a/docs/mkdocs.yaml +++ b/docs/mkdocs.yaml @@ -9,5 +9,9 @@ nav: - Application Setup Guides: - Development Applications: apps/development.md - Shopping List App Application: apps/shopping-app.md + - Plex Media Server Application: apps/plex.md + - Prowlarr: apps/prowlarr.md + - Radarr: apps/radarr.md + - Sonarr: apps/sonarr.md - Update Guides: - V0.2.0: update/update0-2-0.md diff --git a/frontend/src/constants/IconMap.tsx b/frontend/src/constants/IconMap.tsx index bc552be..a103e34 100644 --- a/frontend/src/constants/IconMap.tsx +++ b/frontend/src/constants/IconMap.tsx @@ -1,5 +1,5 @@ import { ReactNode } from "react"; -import { CodeFilled, DatabaseOutlined, HomeOutlined, MenuOutlined, TeamOutlined, UserOutlined, BookOutlined, DesktopOutlined, CheckSquareOutlined, ShoppingCartOutlined } from "@ant-design/icons"; +import { CodeFilled, DatabaseOutlined, HomeOutlined, MenuOutlined, TeamOutlined, UserOutlined, BookOutlined, DesktopOutlined, CheckSquareOutlined, ShoppingCartOutlined, PlayCircleOutlined, VerticalAlignBottomOutlined } from "@ant-design/icons"; export const iconMap = new Map(); iconMap.set("MenuOutlined", ); @@ -12,3 +12,5 @@ iconMap.set("BookOutlined", ); iconMap.set("DesktopOutlined", ); iconMap.set("CheckSquareOutlined", ); iconMap.set("ShoppingCartOutlined", ); +iconMap.set("PlayCircleOutlined", ); +iconMap.set("VerticalAlignBottomOutlined", ); diff --git a/scripts/media.sh b/scripts/media.sh new file mode 100755 index 0000000..a89fbfa --- /dev/null +++ b/scripts/media.sh @@ -0,0 +1 @@ +docker exec -it hp-admin python manage.py imedia \ No newline at end of file diff --git a/scripts/plex.sh b/scripts/plex.sh new file mode 100755 index 0000000..db20e31 --- /dev/null +++ b/scripts/plex.sh @@ -0,0 +1 @@ +docker exec -it hp-admin python manage.py iplex \ No newline at end of file diff --git a/scripts/prowlarr.sh b/scripts/prowlarr.sh new file mode 100755 index 0000000..0256d78 --- /dev/null +++ b/scripts/prowlarr.sh @@ -0,0 +1 @@ +docker exec -it hp-admin python manage.py iprowlarr \ No newline at end of file diff --git a/scripts/radarr.sh b/scripts/radarr.sh new file mode 100755 index 0000000..2d435c7 --- /dev/null +++ b/scripts/radarr.sh @@ -0,0 +1 @@ +docker exec -it hp-admin python manage.py iradarr \ No newline at end of file diff --git a/scripts/sonarr.sh b/scripts/sonarr.sh new file mode 100755 index 0000000..7d748a8 --- /dev/null +++ b/scripts/sonarr.sh @@ -0,0 +1 @@ +docker exec -it hp-admin python manage.py isonarr \ No newline at end of file