From c81faf7aab5e850636b0ad1e81af32633dba3900 Mon Sep 17 00:00:00 2001 From: westsurname <155189104+westsurname@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:28:21 -0400 Subject: [PATCH 1/6] Add nginx docker container --- .env.template | 6 +++ .github/workflows/docker-build-push.yml | 2 + Dockerfile.plex_request_nginx | 12 +++++ README.md | 7 +++ docker-compose.yml | 18 +++++++ plex_request_nginx.conf | 72 ++++++++++++++----------- 6 files changed, 85 insertions(+), 32 deletions(-) create mode 100644 Dockerfile.plex_request_nginx diff --git a/.env.template b/.env.template index bc8da81..8bca29c 100644 --- a/.env.template +++ b/.env.template @@ -123,6 +123,12 @@ BLACKHOLE_RD_MOUNT_REFRESH_SECONDS=200 BLACKHOLE_WAIT_FOR_TORRENT_TIMEOUT=60 BLACKHOLE_HISTORY_PAGE_SIZE=500 +#------------------------------# +# PLEX REQUEST - PLEX REQUEST # +#------------------------------# + +PLEX_REQUEST_SSL_PATH= + #-----------------------------------------------------------------------------------------------# # DISCORD - BLACKHOLE, WATCHLIST, PLEX AUTHENTICATION, PLEX REQUEST, MONITOR RAM, RECLAIM SPACE # #-----------------------------------------------------------------------------------------------# diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index cc9ad70..1893a19 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -27,6 +27,8 @@ jobs: image: ghcr.io/${{ github.repository }}/plex_request - dockerfile: ./Dockerfile.scripts image: ghcr.io/${{ github.repository }}/scripts + - dockerfile: ./Dockerfile.plex_request_nginx + image: ghcr.io/${{ github.repository }}/plex_request_nginx steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/Dockerfile.plex_request_nginx b/Dockerfile.plex_request_nginx new file mode 100644 index 0000000..dba4230 --- /dev/null +++ b/Dockerfile.plex_request_nginx @@ -0,0 +1,12 @@ +FROM nginx:alpine + +# Metadata labels +LABEL org.opencontainers.image.source="https://github.com/westsurname/scripts" +LABEL org.opencontainers.image.description="Docker image for the plex_request_nginx service" + +COPY plex_request_nginx.conf /etc/nginx/conf.d/default.conf + +# Expose port 8000 to the outside world +EXPOSE 8000 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md index a85303a..cfff65f 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,13 @@ - `BLACKHOLE_WAIT_FOR_TORRENT_TIMEOUT`: The timeout in seconds to wait for a torrent to be successful before failing. - `BLACKHOLE_HISTORY_PAGE_SIZE`: The number of history items to pull at once when attempting to mark a download as failed. + - **Plex Request** - Plex Request: + - `PLEX_REQUEST_SSL_PATH` (Optional): The path to SSL certificates for Plex Request. If provided, this directory should contain the following files: + - `fullchain.pem`: The full certificate chain file. + - `privkey.pem`: The private key file. + - `chain.pem`: The certificate chain file. + - `dhparam.pem`: The Diffie-Hellman parameters file. + - **Discord** - Blackhole, Watchlist, Plex Authentication, Plex Request, Monitor Ram, Reclaim Space: - `DISCORD_ENABLED`: Set to `true` to enable Discord error notifications. - `DISCORD_UPDATE_ENABLED`: Set to `true` to enable update notifications as well on Discord. diff --git a/docker-compose.yml b/docker-compose.yml index 426e38b..2ad737f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -184,6 +184,24 @@ services: restart: unless-stopped profiles: [plex_request, all] + plex_request_nginx: + build: + context: . + dockerfile: Dockerfile.plex_request_nginx + container_name: plex_request_nginx_service + image: ghcr.io/westsurname/scripts/plex_request_nginx:latest + pull_policy: always + volumes: + - ${PLEX_REQUEST_SSL_PATH:-/dev/null}:${PLEX_REQUEST_SSL_PATH:-/dev/null}:ro + ports: + - 8002:8000 + env_file: + - .env + restart: unless-stopped + profiles: [plex_request, all] + depends_on: + - plex_request + networks: default: name: ${DOCKER_NETWORK:-scripts_default} diff --git a/plex_request_nginx.conf b/plex_request_nginx.conf index 6af486f..6b0d866 100644 --- a/plex_request_nginx.conf +++ b/plex_request_nginx.conf @@ -4,9 +4,9 @@ ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; server { - listen 12598 ssl http2; + listen 8000; - server_name ; + server_name ${SERVER_DOMAIN}; send_timeout 100m; #Some players don't reopen a socket and playback stops totally instead of resuming after an extended pause (e.g. Chrome) @@ -14,34 +14,43 @@ server { resolver 8.8.4.4 8.8.8.8 valid=300s; resolver_timeout 10s; - # ssl - # ssl on; on; - ssl_certificate /path/to/ssl/fullchain.pem; - ssl_certificate_key /path/to/ssl/key.pem; - # ssl_certificate /etc/nginx/cert.pem; - # ssl_certificate_key /etc/nginx/key.pem; - - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_prefer_server_ciphers on; - #Intentionally not hardened for security for player support and encryption video streams has a lot of overhead with something like AES-256-GCM-SHA384. - ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'; - - #Why this is important: https://blog.cloudflare.com/ocsp-stapling-how-cloudflare-just-made-ssl-30/ - ssl_stapling on; - ssl_stapling_verify on; - #For letsencrypt.org you can get your chain like this: https://esham.io/2016/01/ocsp-stapling - ssl_trusted_certificate /path/to/ssl/chain.pem; - - #Reuse ssl sessions, avoids unnecessary handshakes - #Turning this on will increase performance, but at the cost of security. Read below before making a choice. - #https://github.com/mozilla/server-side-tls/issues/135 - #https://wiki.mozilla.org/Security/Server_Side_TLS#TLS_tickets_.28RFC_5077.29 - #ssl_session_tickets on; - ssl_session_tickets off; - - #Use: openssl dhparam -out dhparam.pem 2048 - 4096 is better but for overhead reasons 2048 is enough for Plex. - ssl_dhparam /path/to/ssl/dhparam.pem; - ssl_ecdh_curve secp384r1; + # SSL configuration + set $use_ssl 0; + if ($PLEX_REQUEST_SSL_PATH != "") { + set $use_ssl 1; + } + + if ($use_ssl = 1) { + listen 8000 ssl http2; + # ssl + # ssl on; on; + ssl_certificate ${PLEX_REQUEST_SSL_PATH}/fullchain.pem; + ssl_certificate_key ${PLEX_REQUEST_SSL_PATH}/privkey.pem; + # ssl_certificate /etc/nginx/cert.pem; + # ssl_certificate_key /etc/nginx/key.pem; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + #Intentionally not hardened for security for player support and encryption video streams has a lot of overhead with something like AES-256-GCM-SHA384. + ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'; + + #Why this is important: https://blog.cloudflare.com/ocsp-stapling-how-cloudflare-just-made-ssl-30/ + ssl_stapling on; + ssl_stapling_verify on; + #For letsencrypt.org you can get your chain like this: https://esham.io/2016/01/ocsp-stapling + ssl_trusted_certificate ${PLEX_REQUEST_SSL_PATH}/chain.pem; + + #Reuse ssl sessions, avoids unnecessary handshakes + #Turning this on will increase performance, but at the cost of security. Read below before making a choice. + #https://github.com/mozilla/server-side-tls/issues/135 + #https://wiki.mozilla.org/Security/Server_Side_TLS#TLS_tickets_.28RFC_5077.29 + #ssl_session_tickets on; + ssl_session_tickets off; + + #Use: openssl dhparam -out dhparam.pem 2048 - 4096 is better but for overhead reasons 2048 is enough for Plex. + ssl_dhparam ${PLEX_REQUEST_SSL_PATH}/dhparam.pem; + ssl_ecdh_curve secp384r1; + } #Plex has A LOT of javascript, xml and html. This helps a lot, but if it causes playback issues with devices turn it off. (Haven't encountered any yet) gzip on; @@ -92,7 +101,7 @@ server { proxy_buffering off; location / { - proxy_pass ; + proxy_pass ${PLEX_SERVER_HOST}; proxy_read_timeout 86400; # add_header 'Access-Control-Allow-Origin' '*'; @@ -140,4 +149,3 @@ server { access_log logs/plex.access.log; } } - From 9c19979e937c455e59531e54d326ffb2abc0bfff Mon Sep 17 00:00:00 2001 From: westsurname <155189104+westsurname@users.noreply.github.com> Date: Fri, 19 Jul 2024 21:34:40 +0000 Subject: [PATCH 2/6] Got plex_request working out of the box --- Dockerfile.plex_request_nginx | 7 ++++++ plex_request_nginx.conf | 40 ++++++++++++++----------------- plex_request_nginx_variables.conf | 11 +++++++++ 3 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 plex_request_nginx_variables.conf diff --git a/Dockerfile.plex_request_nginx b/Dockerfile.plex_request_nginx index dba4230..a57ac78 100644 --- a/Dockerfile.plex_request_nginx +++ b/Dockerfile.plex_request_nginx @@ -4,8 +4,15 @@ FROM nginx:alpine LABEL org.opencontainers.image.source="https://github.com/westsurname/scripts" LABEL org.opencontainers.image.description="Docker image for the plex_request_nginx service" +COPY plex_request_nginx_variables.conf /etc/nginx/templates/10-variables.conf.template COPY plex_request_nginx.conf /etc/nginx/conf.d/default.conf +RUN if [ -n "$PLEX_REQUEST_SSL_PATH" ]; then \ + sed -i '/# SSL_DISABLED_BEGIN/,/# SSL_DISABLED_END/d' /etc/nginx/conf.d/default.conf; \ + else \ + sed -i '/# SSL_ENABLED_BEGIN/,/# SSL_ENABLED_END/d' /etc/nginx/conf.d/default.conf; \ + fi + # Expose port 8000 to the outside world EXPOSE 8000 diff --git a/plex_request_nginx.conf b/plex_request_nginx.conf index 6b0d866..2c6f2f7 100644 --- a/plex_request_nginx.conf +++ b/plex_request_nginx.conf @@ -4,9 +4,7 @@ ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; server { - listen 8000; - - server_name ${SERVER_DOMAIN}; + server_name ${server_domain}; send_timeout 100m; #Some players don't reopen a socket and playback stops totally instead of resuming after an extended pause (e.g. Chrome) @@ -14,18 +12,16 @@ server { resolver 8.8.4.4 8.8.8.8 valid=300s; resolver_timeout 10s; - # SSL configuration - set $use_ssl 0; - if ($PLEX_REQUEST_SSL_PATH != "") { - set $use_ssl 1; - } + # SSL_DISABLED_BEGIN + listen 8000; + # SSL_DISABLED_END - if ($use_ssl = 1) { + # SSL_ENABLED_BEGIN listen 8000 ssl http2; # ssl # ssl on; on; - ssl_certificate ${PLEX_REQUEST_SSL_PATH}/fullchain.pem; - ssl_certificate_key ${PLEX_REQUEST_SSL_PATH}/privkey.pem; + ssl_certificate ${plex_request_ssl_path}/fullchain.pem; + ssl_certificate_key ${plex_request_ssl_path}/privkey.pem; # ssl_certificate /etc/nginx/cert.pem; # ssl_certificate_key /etc/nginx/key.pem; @@ -38,7 +34,7 @@ server { ssl_stapling on; ssl_stapling_verify on; #For letsencrypt.org you can get your chain like this: https://esham.io/2016/01/ocsp-stapling - ssl_trusted_certificate ${PLEX_REQUEST_SSL_PATH}/chain.pem; + ssl_trusted_certificate ${plex_request_ssl_path}/chain.pem; #Reuse ssl sessions, avoids unnecessary handshakes #Turning this on will increase performance, but at the cost of security. Read below before making a choice. @@ -48,9 +44,9 @@ server { ssl_session_tickets off; #Use: openssl dhparam -out dhparam.pem 2048 - 4096 is better but for overhead reasons 2048 is enough for Plex. - ssl_dhparam ${PLEX_REQUEST_SSL_PATH}/dhparam.pem; + ssl_dhparam ${plex_request_ssl_path}/dhparam.pem; ssl_ecdh_curve secp384r1; - } + # SSL_ENABLED_END #Plex has A LOT of javascript, xml and html. This helps a lot, but if it causes playback issues with devices turn it off. (Haven't encountered any yet) gzip on; @@ -101,7 +97,7 @@ server { proxy_buffering off; location / { - proxy_pass ${PLEX_SERVER_HOST}; + proxy_pass ${plex_server_host}; proxy_read_timeout 86400; # add_header 'Access-Control-Allow-Origin' '*'; @@ -120,7 +116,7 @@ server { # return 302 https://$request_uri; - access_log logs/plex.access.log; + # access_log logs/plex.access.log; # # enable the next two lines for http auth # auth_basic "Restricted"; @@ -132,20 +128,20 @@ server { } location /library/all { - proxy_pass http://localhost:8001; + proxy_pass http://plex_request:8000; - access_log logs/plex.access.log; + # access_log logs/plex.access.log; } location ~ ^/library/metadata/[^/]+/children$ { - proxy_pass http://localhost:8001; + proxy_pass http://plex_request:8000; - access_log logs/plex.access.log; + # access_log logs/plex.access.log; } location /library/request/ { - proxy_pass http://localhost:8001; + proxy_pass http://plex_request:8000; - access_log logs/plex.access.log; + # access_log logs/plex.access.log; } } diff --git a/plex_request_nginx_variables.conf b/plex_request_nginx_variables.conf new file mode 100644 index 0000000..24d6087 --- /dev/null +++ b/plex_request_nginx_variables.conf @@ -0,0 +1,11 @@ +map $host $server_domain { + default "$SERVER_DOMAIN"; +} + +map $host $plex_request_ssl_path { + default "$PLEX_REQUEST_SSL_PATH"; +} + +map $host $plex_server_host { + default "$PLEX_SERVER_HOST"; +} \ No newline at end of file From 1eee01d2e6361e0e8a78eb909647cc0806f1f67c Mon Sep 17 00:00:00 2001 From: westsurname <155189104+westsurname@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:56:59 +0000 Subject: [PATCH 3/6] misc fixes --- docker-compose.yml | 12 ++++++------ plex_authentication.py | 10 ++++++++-- plex_request.py | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2ad737f..2b07af8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -160,13 +160,13 @@ services: volumes: - ./shared/tokens.json:/app/shared/tokens.json ports: - - 8000:8000 + - 8010:8000 env_file: - .env - environment: - - SERVER_DOMAIN=${SERVER_DOMAIN}:8000 + # environment: + # - SERVER_DOMAIN=${SERVER_DOMAIN}:8010 restart: unless-stopped - profiles: [plex_authentication, all] + profiles: [plex_authentication, watchlist, plex_request, all] plex_request: build: @@ -178,7 +178,7 @@ services: volumes: - ./shared/tokens.json:/app/shared/tokens.json ports: - - 8001:8000 + - 8011:8000 env_file: - .env restart: unless-stopped @@ -194,7 +194,7 @@ services: volumes: - ${PLEX_REQUEST_SSL_PATH:-/dev/null}:${PLEX_REQUEST_SSL_PATH:-/dev/null}:ro ports: - - 8002:8000 + - 8012:8000 env_file: - .env restart: unless-stopped diff --git a/plex_authentication.py b/plex_authentication.py index a81b309..fa9971d 100644 --- a/plex_authentication.py +++ b/plex_authentication.py @@ -7,13 +7,14 @@ from shared.plex import getServerToken from werkzeug.serving import run_simple from werkzeug.middleware.dispatcher import DispatcherMiddleware +from werkzeug.middleware.proxy_fix import ProxyFix host = server['host'] # instantiate the app app = Flask(__name__) app.config.from_object(__name__) -app.config['SERVER_NAME'] = f"{host}" +# app.config['SERVER_NAME'] = f"{host}" @app.route('/', methods=['GET']) @@ -42,9 +43,13 @@ def setupComplete(pin): with open(tokensFilename, 'r+') as tokensFile: tokens = json.load(tokensFile) - token = tokens.get(user['id'], { 'etag': '' }) + token = tokens.get(userId, { 'etag': '' }) token['token'] = authToken token['serverToken'] = serverToken + + if serverToken == authToken: + token['owner'] = True + tokens[userId] = token tokensFile.seek(0) json.dump(tokens, tokensFile) @@ -55,6 +60,7 @@ def setupComplete(pin): return jsonify('There was an error, please try again.') # app.wsgi_app = DispatcherMiddleware(run_simple, {'/plexAuthentication': app.wsgi_app}) +app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1) if __name__ == '__main__': app.run('127.0.0.1', 12598) \ No newline at end of file diff --git a/plex_request.py b/plex_request.py index dea074d..d89a56c 100644 --- a/plex_request.py +++ b/plex_request.py @@ -140,6 +140,7 @@ def requestRatingKey(mediaType, mediaTypeNum, ratingKey, season=None): # return response # response = jsonify(json.loads(blankMediaContainer)) + response = Response('', status=204) response.headers.add('Access-Control-Allow-Origin', 'https://app.plex.tv') return response From 3087faddb1882b8d90701534eaadc422c6f88ac2 Mon Sep 17 00:00:00 2001 From: westsurname <155189104+westsurname@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:33:25 -0400 Subject: [PATCH 4/6] cleanup --- plex_authentication.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plex_authentication.py b/plex_authentication.py index fa9971d..3e05c66 100644 --- a/plex_authentication.py +++ b/plex_authentication.py @@ -5,8 +5,6 @@ from shared.shared import server, watchlist, plexHeaders, tokensFilename from shared.overseerr import getUserForPlexToken from shared.plex import getServerToken -from werkzeug.serving import run_simple -from werkzeug.middleware.dispatcher import DispatcherMiddleware from werkzeug.middleware.proxy_fix import ProxyFix host = server['host'] @@ -14,7 +12,6 @@ # instantiate the app app = Flask(__name__) app.config.from_object(__name__) -# app.config['SERVER_NAME'] = f"{host}" @app.route('/', methods=['GET']) @@ -59,7 +56,6 @@ def setupComplete(pin): return jsonify('There was an error, please try again.') -# app.wsgi_app = DispatcherMiddleware(run_simple, {'/plexAuthentication': app.wsgi_app}) app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1) if __name__ == '__main__': From 83dbff5f95f1743386cfd3b4b5f11e61ea83754d Mon Sep 17 00:00:00 2001 From: westsurname <155189104+westsurname@users.noreply.github.com> Date: Mon, 22 Jul 2024 21:29:14 -0400 Subject: [PATCH 5/6] More cleanup --- .env.template | 6 +++--- README.md | 2 +- docker-compose.yml | 2 -- plex_authentication.py | 4 +--- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.env.template b/.env.template index 8bca29c..a044785 100644 --- a/.env.template +++ b/.env.template @@ -7,9 +7,9 @@ # ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚══════╝ # #------------------------------------------------------# -#------------------------------# -# SERVER - PLEX AUTHENTICATION # -#------------------------------# +#--------# +# SERVER # +#--------# SERVER_DOMAIN= diff --git a/README.md b/README.md index cfff65f..cc6d793 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ ``` 4. Copy `.env.template` to `.env` and populate the (applicable) variables: - - **Server** - Plex Authentication: + - **Server**: - `SERVER_DOMAIN`: The domain name of your server. - **Plex** - Watchlist, Plex Authentication, Plex Request, Plex Refresh: diff --git a/docker-compose.yml b/docker-compose.yml index 2b07af8..ee1962b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -163,8 +163,6 @@ services: - 8010:8000 env_file: - .env - # environment: - # - SERVER_DOMAIN=${SERVER_DOMAIN}:8010 restart: unless-stopped profiles: [plex_authentication, watchlist, plex_request, all] diff --git a/plex_authentication.py b/plex_authentication.py index 3e05c66..9dce503 100644 --- a/plex_authentication.py +++ b/plex_authentication.py @@ -2,13 +2,11 @@ import json import urllib.parse from flask import Flask, jsonify, redirect, url_for -from shared.shared import server, watchlist, plexHeaders, tokensFilename +from shared.shared import watchlist, plexHeaders, tokensFilename from shared.overseerr import getUserForPlexToken from shared.plex import getServerToken from werkzeug.middleware.proxy_fix import ProxyFix -host = server['host'] - # instantiate the app app = Flask(__name__) app.config.from_object(__name__) From 2419b7322b7e5e3f2ca3d79293a59f653d40590f Mon Sep 17 00:00:00 2001 From: westsurname <155189104+westsurname@users.noreply.github.com> Date: Tue, 23 Jul 2024 01:45:21 +0000 Subject: [PATCH 6/6] More cleanup --- plex_request_nginx.conf | 2 -- plex_request_nginx_variables.conf | 4 ---- 2 files changed, 6 deletions(-) diff --git a/plex_request_nginx.conf b/plex_request_nginx.conf index 2c6f2f7..d3c12cf 100644 --- a/plex_request_nginx.conf +++ b/plex_request_nginx.conf @@ -4,8 +4,6 @@ ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; server { - server_name ${server_domain}; - send_timeout 100m; #Some players don't reopen a socket and playback stops totally instead of resuming after an extended pause (e.g. Chrome) #Faster resolving, improves stapling time. Timeout and nameservers may need to be adjusted for your location Google's have been used here. diff --git a/plex_request_nginx_variables.conf b/plex_request_nginx_variables.conf index 24d6087..95d7439 100644 --- a/plex_request_nginx_variables.conf +++ b/plex_request_nginx_variables.conf @@ -1,7 +1,3 @@ -map $host $server_domain { - default "$SERVER_DOMAIN"; -} - map $host $plex_request_ssl_path { default "$PLEX_REQUEST_SSL_PATH"; }