Skip to content

Commit

Permalink
Merge pull request #160 from pabloromeo/experimental
Browse files Browse the repository at this point in the history
Add support for "Required" Secure Connections
  • Loading branch information
pabloromeo authored Jul 23, 2022
2 parents 824b164 + 8326d76 commit 2e77b7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ The image extends the [LinuxServer Plex](https://hub.docker.com/r/linuxserver/pl
| `TRANSCODE_EAE_LOCALLY` | Force media which requires EasyAudioEncoder to transcode locally |
| `TRANSCODE_OPERATING_MODE` | "local" => only local transcoding (no workers), "remote" => only remote workers transcoding, "both" (default) => Remote first, local if it fails |
| `TRANSCODER_VERBOSE` | "0" (default) => info level, "1" => debug logging |
| `FORCE_HTTPS` | "0" (Default) uses Plex's default http callback, "1" forces HTTPS to be used.<br>**IMPORTANT:** You must set this to "1" if you have set "Secure Connections" in Plex to "Required". |

### Orchestrator

Expand Down
10 changes: 9 additions & 1 deletion pms/app/transcoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const TRANSCODER_VERBOSE = process.env.TRANSCODER_VERBOSE || '0'
// both
const TRANSCODE_OPERATING_MODE = process.env.TRANSCODE_OPERATING_MODE || 'both'
const TRANSCODE_EAE_LOCALLY = process.env.TRANSCODE_EAE_LOCALLY || false
const FORCE_HTTPS = process.env.FORCE_HTTPS || "0"

const { spawn } = require('child_process');
var ON_DEATH = require('death')({debug: true})
Expand All @@ -29,9 +30,16 @@ if (TRANSCODE_OPERATING_MODE == 'local') {
}
}

let networkProtocol = "http";
if (FORCE_HTTPS == '1') {
console.log('Forcing HTTPS in progress callback');
networkProtocol = "https";
}

let newArgs = process.argv.slice(2).map((v) => {
return v
.replace('127.0.0.1:', `${PMS_IP}:`)
.replace('http://127.0.0.1:', `${networkProtocol}://${PMS_IP}:`)
.replace('https://127.0.0.1:', `https://${PMS_IP}:`)
.replace('aac_lc', 'aac'); // workaround for error -> Unknown decoder 'aac_lc'
})

Expand Down

0 comments on commit 2e77b7c

Please sign in to comment.