Skip to content

Commit

Permalink
Merge branch 'main' into Fix/#679
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenn92 authored Jan 8, 2024
2 parents 19f75bd + 30fef1f commit 3989631
Show file tree
Hide file tree
Showing 23 changed files with 355 additions and 176 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Build and push Docker image"

on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- 'main'
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
build_docker_image:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/jorenn92/maintainerr
- name: Log in to GitHub Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build & Push image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ steps.meta.outputs.tags }}
jorenn92/maintainerr:develop
labels: ${{ steps.meta.outputs.labels }}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## [1.7.1](https://github.com/jorenn92/Maintainerr/compare/v1.7.0...v1.7.1) (2024-01-06)


### Bug Fixes

* **maintenance:** Extended the maintenance task with an action to remove orphaned collection objects ([f5826cc](https://github.com/jorenn92/Maintainerr/commit/f5826cc1f4e2997586ec1fa2cc704d7a85d01e8e))
* **plex:** Fixed an issue where fetching Plex users would fail if connection to plex.tv failed ([2458a8f](https://github.com/jorenn92/Maintainerr/commit/2458a8f62797d3122e2577493f73948c85ab4c9b))
* **rules:** Extended the Plex - rating rule ([ef95481](https://github.com/jorenn92/Maintainerr/commit/ef95481d8653d0d84bf3c00a92bf046b8abc50e6))
* **rules:** Fixed an issue where 'Plex - Present in amount of other collections' wouldn't work as expected ([1c4accd](https://github.com/jorenn92/Maintainerr/commit/1c4accdacf17738878cb60bde60bd176b3dc6426))
* **rules:** Fixed an issue where an item would be stuck inside the internal collection when it was removed manually ([1eae15f](https://github.com/jorenn92/Maintainerr/commit/1eae15f094ad081d20829db638f3cb44789f2137))
* **rules:** Fixed an issue where the "Plex - Last episode added at" rule order was affected by the library's Plex Episode Sorting setting ([67299c4](https://github.com/jorenn92/Maintainerr/commit/67299c4d6f94aa2f104694e4fab265fe4767af70))
* **rules:** Resolved an issue where a nullpointer could occur when fetching playlists. ([a0400b8](https://github.com/jorenn92/Maintainerr/commit/a0400b865999a986cfdcef6bb8603f8f0483e62b))

# [1.7.0](https://github.com/jorenn92/Maintainerr/compare/v1.6.10...v1.7.0) (2023-12-21)


Expand Down
21 changes: 13 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY server/ /opt/server/
COPY ui/ /opt/ui/
COPY docs/ /opt/docs/
COPY package.json /opt/package.json
COPY yarn.lock /opt/yarn.lock
COPY yarn.lock /opt/yarn.lock
COPY datasource-config.ts /opt/datasource-config.ts
COPY ormconfig.json /opt/ormconfig.json
COPY jsdoc.json /opt/jsdoc.json
Expand All @@ -34,10 +34,10 @@ RUN yarn run docs-generate && \
rm -rf ./docs

RUN \
case "${TARGETPLATFORM}" in ('linux/arm64' | 'linux/amd64') \
case "${TARGETPLATFORM}" in ('linux/arm64' | 'linux/amd64') \
yarn add --save --network-timeout 99999999 sharp \
;; \
esac
;; \
esac

RUN yarn --production --non-interactive --ignore-scripts --prefer-offline --frozen-lockfile --network-timeout 99999999

Expand All @@ -49,6 +49,9 @@ ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}

ARG DEBUG=false
ENV DEBUG=${DEBUG}

# Temporary workaround for https://github.com/libuv/libuv/pull/4141
ENV UV_USE_IO_URING=0

Expand All @@ -60,9 +63,11 @@ COPY --from=BUILDER /opt ./
COPY supervisord.conf /etc/supervisord.conf

RUN apk add supervisor && \
rm -rf /tmp/* && \
mkdir /opt/data
rm -rf /tmp/* && \
mkdir /opt/data && \
chown -R node:node /opt

VOLUME [ "/opt/data" ]
USER node

ENTRYPOINT ["/opt/start.sh"]
VOLUME [ "/opt/data" ]
ENTRYPOINT ["/opt/start.sh"]
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,25 @@
<a href="https://hub.docker.com/r/jorenn92/maintainerr"><img src="https://img.shields.io/docker/pulls/jorenn92/maintainerr" alt="Docker pulls" width="16.5%"></a>
</p>

<b>Maintainerr</b> makes managing your media easy.
- Do you hate being the janitor of your server?
- Do you have a lot of media that never gets watched?
- Do your users constantly request media, and let it sit there afterward never to be touched again?

<b>Maintainerr</b> makes managing your media easy.

- Do you hate being the janitor of your server?
- Do you have a lot of media that never gets watched?
- Do your users constantly request media, and let it sit there afterward never to be touched again?

If you answered yes to any of those questions.. You NEED <b>Maintainerr</b>.
It's a one-stop-shop for handling those outlying shows and movies that take up precious space on your server.

# Features

- Configure rules specific to your needs, based off of several available options from Plex, Overseerr, Radarr, and Sonarr.
- Manually add media to a collection, in case it's not included after rule execution. (one-off items that don't match a rule set)
- Selectively exclude media from being added to a collection, even if it matches a rule.
- Show a collection, containing rule matched media, on the Plex home screen for a specific duration before deletion. Think "Leaving soon".
- Show a collection, containing rule matched media, on the Plex home screen for a specific duration before deletion. Think "Leaving soon".
- Optionally, use a manual Plex collection, in case you don't want <b>Maintainerr</b> to add & remove Plex collections at will.
- Manage media straight from the collection within Plex. <b>Maintainerr</b> will sync and add or exclude media to/from the internal collection.

- Remove or unmonitor media from *arr
- Remove or unmonitor media from \*arr
- Clear requests from Overseerr
- Delete files from disk

Expand All @@ -39,22 +41,22 @@ Currently, <b>Maintainerr</b> supports rule parameters from these apps :
- Overseerr
- Radarr
- Sonarr

# Preview

# Preview

![image](https://github.com/ydkmlt84/Maintainerr/assets/2887742/8edabd29-ed98-4a9f-b41f-251b2e7d309c)
![image](https://github.com/ydkmlt84/Maintainerr/assets/2887742/c9916c90-4c67-4341-a0c1-32613518aa20)
![image](https://github.com/ydkmlt84/Maintainerr/assets/2887742/00740a16-e4fe-4429-a769-64ffcd568cba)



# Installation

Docker images for amd64, arm64 & armv7 are available under jorenn92/maintainerr. <br />
Docker images for amd64 & arm64 are available under jorenn92/maintainerr. <br />
Data is saved within the container under /opt/data, it is recommended to tie a persistent volume to this location in your docker command/compose file.

For more information, visit the [installation guide](docs/2-getting-started/1-installation/Installation.md) or navigate to \<maintainerr_url\>:\<port\>/docs after starting your <b>Maintainerr</b> container.

Docker run:

```Yaml
docker run -d \
--name maintainerr \
Expand All @@ -64,24 +66,29 @@ docker run -d \
--restart unless-stopped \
jorenn92/maintainerr
```
Docker-compose:

Docker-compose:

```Yaml
version: '3'

services:
maintainerr:
image: jorenn92/maintainerr:latest
container_name: maintainerr
# user: 1000:1000 # only use this with release 2.0 and up
volumes:
- <persistent-local-volume>:/opt/data
environment:
- TZ=Europe/Brussels
# - DEBUG=true # uncomment to enable verbose logs
ports:
- 8154:80
restart: unless-stopped
```
# Credits
Maintainerr is heavily inspired by Overseerr. Some parts of Maintainerr's code are plain copies. Big thanks to the Overseerr team for creating and maintaining such an amazing app!
Please support them at https://github.com/sct/overseerr
9 changes: 7 additions & 2 deletions docs/2-getting-started/1-installation/Installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The easiest way to start Maintainerr is with Docker.

images for amd64, arm64 & armv7 are available under jorenn92/maintainerr.
images for amd64 & arm64 are available under jorenn92/maintainerr.
Data is saved under /opt/data, a volume should be created to persist the configuration.

# Run
Expand Down Expand Up @@ -35,7 +35,10 @@ You may alternatively use a third-party updating mechanism, such as Watchtower o

# Compose

Define the Maintainerr service in your docker-compose.yml as follows:
Define the Maintainerr service in your docker-compose.yml as follows.

> Starting from release 2.0, you have the option to define a User and Group ID for running the container. Maintainerr will operate using this specified UID:GID, and any files it generates within your data volume will also be associated with this designated user and group. If not explicitly specified, the default UID:GID is set to 1000:1000, representing the 'node' user inside the container. Don't use this with 1.x releases, the container will fail to start.

```Yaml
version: '3'
Expand All @@ -44,10 +47,12 @@ services:
maintainerr:
image: jorenn92/maintainerr:latest
container_name: maintainerr
# user: 1000:1000 # only use this with release 2.0 and up
volumes:
- ./data:/opt/data
environment:
- TZ=Europe/Brussels
# - DEBUG=true # uncomment to enable verbose logs
ports:
- 8154:80
restart: unless-stopped
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maintainerr",
"version": "1.7.0",
"version": "1.7.1",
"private": true,
"repository": {
"type": "git",
Expand Down
7 changes: 6 additions & 1 deletion server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import { NestFactory } from '@nestjs/core';
import { AppModule } from './app/app.module';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const app = await NestFactory.create(AppModule, {
logger:
process.env.NODE_ENV !== 'production' || process.env.DEBUG == 'true'
? ['log', 'debug', 'error', 'verbose', 'warn']
: ['error', 'warn', 'log'],
});
app.enableCors();
await app.listen(3001);
}
Expand Down
8 changes: 8 additions & 0 deletions server/src/modules/api/external-api/external-api.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Logger } from '@nestjs/common';
import axios, { AxiosInstance, RawAxiosRequestConfig } from 'axios';
import NodeCache from 'node-cache';

Expand Down Expand Up @@ -53,6 +54,7 @@ export class ExternalApiService {

return response.data;
} catch (err) {
Logger.debug(`GET request failed: ${err}`);
return undefined;
}
}
Expand All @@ -64,6 +66,7 @@ export class ExternalApiService {
try {
return (await this.axios.get<T>(endpoint, config)).data;
} catch (err) {
Logger.debug(`GET request failed: ${err}`);
return undefined;
}
}
Expand All @@ -76,6 +79,7 @@ export class ExternalApiService {
const response = await this.axios.delete<T>(endpoint, config);
return response.data;
} catch (err) {
Logger.debug(`DELETE request failed: ${err}`);
return undefined;
}
}
Expand All @@ -89,6 +93,7 @@ export class ExternalApiService {
const response = await this.axios.put<T>(endpoint, data, config);
return response.data;
} catch (err) {
Logger.debug(`PUT request failed: ${err}`);
return undefined;
}
}
Expand All @@ -102,6 +107,7 @@ export class ExternalApiService {
const response = await this.axios.post<T>(endpoint, data, config);
return response.data;
} catch (err) {
Logger.debug(`POST request failed: ${err}`);
return undefined;
}
}
Expand Down Expand Up @@ -138,6 +144,7 @@ export class ExternalApiService {

return response.data;
} catch (err) {
Logger.debug(`GET request failed: ${err}`);
return undefined;
}
}
Expand All @@ -153,6 +160,7 @@ export class ExternalApiService {

return `${this.baseUrl}${endpoint}${JSON.stringify(params)}`;
} catch (err) {
Logger.debug(`Failed serializing cache key: ${err}`);
return undefined;
}
}
Expand Down
Loading

0 comments on commit 3989631

Please sign in to comment.