Skip to content

Commit

Permalink
feat(Media): Allow for plex, prowlarr, sonarr and radarr applications…
Browse files Browse the repository at this point in the history
… in home portal
  • Loading branch information
Evanlab02 committed Sep 30, 2024
1 parent 0467794 commit a45bd63
Show file tree
Hide file tree
Showing 17 changed files with 258 additions and 4 deletions.
17 changes: 17 additions & 0 deletions backend/apps/management/commands/imedia.py
Original file line number Diff line number Diff line change
@@ -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()
32 changes: 32 additions & 0 deletions backend/apps/management/commands/iplex.py
Original file line number Diff line number Diff line change
@@ -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()
32 changes: 32 additions & 0 deletions backend/apps/management/commands/iprowlarr.py
Original file line number Diff line number Diff line change
@@ -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()
32 changes: 32 additions & 0 deletions backend/apps/management/commands/iradarr.py
Original file line number Diff line number Diff line change
@@ -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()
32 changes: 32 additions & 0 deletions backend/apps/management/commands/isonarr.py
Original file line number Diff line number Diff line change
@@ -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()
12 changes: 9 additions & 3 deletions docker/site/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 23 additions & 0 deletions docs/docs/guides/plex.md
Original file line number Diff line number Diff line change
@@ -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.
23 changes: 23 additions & 0 deletions docs/docs/guides/prowlarr.md
Original file line number Diff line number Diff line change
@@ -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.
23 changes: 23 additions & 0 deletions docs/docs/guides/radarr.md
Original file line number Diff line number Diff line change
@@ -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.
23 changes: 23 additions & 0 deletions docs/docs/guides/sonarr.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 4 additions & 0 deletions docs/mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion frontend/src/constants/IconMap.tsx
Original file line number Diff line number Diff line change
@@ -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<string, ReactNode>();
iconMap.set("MenuOutlined", <MenuOutlined />);
Expand All @@ -12,3 +12,5 @@ iconMap.set("BookOutlined", <BookOutlined />);
iconMap.set("DesktopOutlined", <DesktopOutlined />);
iconMap.set("CheckSquareOutlined", <CheckSquareOutlined />);
iconMap.set("ShoppingCartOutlined", <ShoppingCartOutlined />);
iconMap.set("PlayCircleOutlined", <PlayCircleOutlined />);
iconMap.set("VerticalAlignBottomOutlined", <VerticalAlignBottomOutlined />);
1 change: 1 addition & 0 deletions scripts/media.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker exec -it hp-admin python manage.py imedia
1 change: 1 addition & 0 deletions scripts/plex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker exec -it hp-admin python manage.py iplex
1 change: 1 addition & 0 deletions scripts/prowlarr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker exec -it hp-admin python manage.py iprowlarr
1 change: 1 addition & 0 deletions scripts/radarr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker exec -it hp-admin python manage.py iradarr
1 change: 1 addition & 0 deletions scripts/sonarr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker exec -it hp-admin python manage.py isonarr

0 comments on commit a45bd63

Please sign in to comment.