From 34136ef6173ae3a85251bec1eae54966a027207e Mon Sep 17 00:00:00 2001
From: salty
Date: Tue, 15 Dec 2020 02:57:01 +0100
Subject: [PATCH 1/9] build(dockerfile): Expose port 3000. (#278)
Allows for automated nginx reverse proxy setups to identify the port used in the container without having to bind the port to the host/localhost.
---
Dockerfile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Dockerfile b/Dockerfile
index e5198a4bc..d157d429b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,3 +21,5 @@ COPY --from=BUILD_IMAGE /app/.next ./.next
COPY --from=BUILD_IMAGE /app/node_modules ./node_modules
CMD yarn start
+
+EXPOSE 3000
From 33b54c08b52ae77742187b5bcc9697fcf45503ba Mon Sep 17 00:00:00 2001
From: "allcontributors[bot]"
<46447321+allcontributors[bot]@users.noreply.github.com>
Date: Tue, 15 Dec 2020 11:05:19 +0900
Subject: [PATCH 2/9] docs: add saltydk as a contributor (#286) [skip ci]
* docs: update README.md [skip ci]
* docs: update .all-contributorsrc [skip ci]
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
---
.all-contributorsrc | 9 +++++++++
README.md | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.all-contributorsrc b/.all-contributorsrc
index 56e321b3b..fac1d1f01 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -88,6 +88,15 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "saltydk",
+ "name": "salty",
+ "avatar_url": "https://avatars1.githubusercontent.com/u/6587950?v=4",
+ "profile": "https://github.com/saltydk",
+ "contributions": [
+ "infra"
+ ]
}
],
"badgeTemplate": "-orange.svg\"/>",
diff --git a/README.md b/README.md
index 4a19cfafc..544b2cd68 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
-
+
@@ -104,6 +104,7 @@ Our [Code of Conduct](https://github.com/sct/overseerr/blob/develop/CODE_OF_COND
jvennik 🌍 |
darknessgp 💻 |
+ salty 🚇 |
From f998873fc5669a547901f2733c9c785d744d27ca Mon Sep 17 00:00:00 2001
From: Alex Zoitos
Date: Mon, 14 Dec 2020 21:11:48 -0500
Subject: [PATCH 3/9] fix(services): improve logging for when Radarr movie
already exists (#285)
re #260
---
server/api/radarr.ts | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/server/api/radarr.ts b/server/api/radarr.ts
index fe22e72c9..4797ef5d7 100644
--- a/server/api/radarr.ts
+++ b/server/api/radarr.ts
@@ -76,11 +76,9 @@ class RadarrAPI {
}
};
- public addMovie = async (
- options: RadarrMovieOptions
- ): Promise => {
+ public addMovie = async (options: RadarrMovieOptions): Promise => {
try {
- const response = await this.axios.post(`/movie`, {
+ await this.axios.post(`/movie`, {
title: options.title,
qualityProfileId: options.qualityProfileId,
profileId: options.profileId,
@@ -94,15 +92,15 @@ class RadarrAPI {
searchForMovie: options.searchNow,
},
});
-
- return response.data;
} catch (e) {
- logger.error('Something went wrong adding a movie to Radarr', {
- label: 'Radarr',
- message: e.message,
- options,
- });
- throw new Error(`[Radarr] Failed to add movie: ${e.message}`);
+ logger.error(
+ 'Failed to add movie to Radarr. This might happen if the movie already exists, in which case you can safely ignore this error.',
+ {
+ label: 'Radarr',
+ errorMessage: e.message,
+ options,
+ }
+ );
}
};
From 3ba09d07eb0367c41603cd55e7ff41c66fb641c4 Mon Sep 17 00:00:00 2001
From: sct
Date: Tue, 15 Dec 2020 03:22:54 +0000
Subject: [PATCH 4/9] fix: add support for ssl when connecting to plex
fixes #275
---
server/api/plexapi.ts | 1 +
server/lib/settings.ts | 2 +
server/types/plex-api.d.ts | 1 +
src/components/Settings/SettingsPlex.tsx | 267 ++++++++++++++---------
src/i18n/locale/en.json | 4 +-
5 files changed, 165 insertions(+), 110 deletions(-)
diff --git a/server/api/plexapi.ts b/server/api/plexapi.ts
index a3abf0526..c8e123710 100644
--- a/server/api/plexapi.ts
+++ b/server/api/plexapi.ts
@@ -62,6 +62,7 @@ class PlexAPI {
this.plexClient = new NodePlexAPI({
hostname: settings.plex.ip,
port: settings.plex.port,
+ https: settings.plex.useSsl,
token: plexToken,
authenticator: {
authenticate: (
diff --git a/server/lib/settings.ts b/server/lib/settings.ts
index 1f33f3bee..f618615cb 100644
--- a/server/lib/settings.ts
+++ b/server/lib/settings.ts
@@ -14,6 +14,7 @@ export interface PlexSettings {
machineId?: string;
ip: string;
port: number;
+ useSsl?: boolean;
libraries: Library[];
}
@@ -109,6 +110,7 @@ class Settings {
name: '',
ip: '127.0.0.1',
port: 32400,
+ useSsl: false,
libraries: [],
},
radarr: [],
diff --git a/server/types/plex-api.d.ts b/server/types/plex-api.d.ts
index fd6db2dd9..9222faafc 100644
--- a/server/types/plex-api.d.ts
+++ b/server/types/plex-api.d.ts
@@ -4,6 +4,7 @@ declare module 'plex-api' {
hostname: string;
port: number;
token?: string;
+ https?: boolean;
authenticator: {
authenticate: (
_plexApi: PlexAPI,
diff --git a/src/components/Settings/SettingsPlex.tsx b/src/components/Settings/SettingsPlex.tsx
index d9d97c5d8..d4fa052ed 100644
--- a/src/components/Settings/SettingsPlex.tsx
+++ b/src/components/Settings/SettingsPlex.tsx
@@ -2,21 +2,23 @@ import React, { useState } from 'react';
import LoadingSpinner from '../Common/LoadingSpinner';
import type { PlexSettings } from '../../../server/lib/settings';
import useSWR from 'swr';
-import { useFormik } from 'formik';
+import { Formik, Field } from 'formik';
import Button from '../Common/Button';
import axios from 'axios';
import LibraryItem from './LibraryItem';
import Badge from '../Common/Badge';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
+import * as Yup from 'yup';
const messages = defineMessages({
plexsettings: 'Plex Settings',
plexsettingsDescription:
'Configure the settings for your Plex server. Overseerr uses your Plex server to scan your library at an interval and see what content is available.',
- servername: 'Server Name (Automatically Set)',
+ servername: 'Server Name (Automatically set after you save)',
servernamePlaceholder: 'Plex Server Name',
hostname: 'Hostname/IP',
port: 'Port',
+ ssl: 'SSL',
save: 'Save Changes',
saving: 'Saving...',
plexlibraries: 'Plex Libraries',
@@ -32,6 +34,8 @@ const messages = defineMessages({
librariesRemaining: 'Libraries Remaining: {count}',
startscan: 'Start Scan',
cancelscan: 'Cancel Scan',
+ validationHostnameRequired: 'You must provide a hostname/IP',
+ validationPortRequired: 'You must provide a port',
});
interface Library {
@@ -64,33 +68,15 @@ const SettingsPlex: React.FC = ({ onComplete }) => {
}
);
const [isSyncing, setIsSyncing] = useState(false);
- const [isUpdating, setIsUpdating] = useState(false);
const [submitError, setSubmitError] = useState(null);
- const formik = useFormik({
- initialValues: {
- hostname: data?.ip,
- port: data?.port,
- },
- enableReinitialize: true,
- onSubmit: async (values) => {
- setSubmitError(null);
- setIsUpdating(true);
- try {
- await axios.post('/api/v1/settings/plex', {
- ip: values.hostname,
- port: Number(values.port),
- } as PlexSettings);
- revalidate();
- if (onComplete) {
- onComplete();
- }
- } catch (e) {
- setSubmitError(e.response.data.message);
- } finally {
- setIsUpdating(false);
- }
- },
+ const PlexSettingsSchema = Yup.object().shape({
+ hostname: Yup.string().required(
+ intl.formatMessage(messages.validationHostnameRequired)
+ ),
+ port: Yup.number().required(
+ intl.formatMessage(messages.validationPortRequired)
+ ),
});
const activeLibraries =
@@ -164,91 +150,154 @@ const SettingsPlex: React.FC = ({ onComplete }) => {
-