Improvements to URL handling in the webapp allowing for SSL (when behind a proxy) #104296

Merged
Sybren A. Stüvel merged 5 commits from william-at-counter/flamenco:main into main 2024-04-11 15:00:55 +02:00
Contributor

Ran into an issue today in which putting flamenco-manager behind a reverse proxy (such as Nginx Proxy Manager) caused web sockets to break if the proxy was providing SSL. This is due to the treatment of URLs in the web app, where the "ws" protocol is always used regardless of whether the site is being accessed through http or https.

I also commented out a block of code that I believe was committed in error since it makes port 8081 inexplicably broken in the release version! 😁

Ran into an issue today in which putting flamenco-manager behind a reverse proxy (such as [Nginx Proxy Manager](https://nginxproxymanager.com/)) caused web sockets to break if the proxy was providing SSL. This is due to the treatment of URLs in the web app, where the "ws" protocol is always used regardless of whether the site is being accessed through http or https. I also commented out a block of code that I believe was committed in error since it makes port 8081 inexplicably broken in the release version! 😁
William Gardner added 2 commits 2024-04-06 06:13:59 +02:00
William Gardner added 1 commit 2024-04-06 06:35:20 +02:00
Author
Contributor

Figured I might as well add a better mechanism for running the dev server while I'm at it.

Using --mode development in your vite dev or build commands will instruct urls.js to force port 8080 rather than having to comment/uncomment each time.

Figured I might as well add a better mechanism for running the dev server while I'm at it. Using `--mode development` in your vite dev or build commands will instruct `urls.js` to force port 8080 rather than having to comment/uncomment each time.
William Gardner added 1 commit 2024-04-06 06:40:31 +02:00
Sybren A. Stüvel requested changes 2024-04-08 10:43:43 +02:00
Dismissed
Sybren A. Stüvel left a comment
Owner

Thanks, this is a great improvement!

Just one little note, if you could address that then we can land this before 3.5 is released.

Thanks, this is a great improvement! Just one little note, if you could address that then we can land this before 3.5 is released.
@ -3,2 +2,2 @@
// API, for example when using the Vite devserver. Set the API port here.
if (url.port == '8081') {
// When using Vite development mode, access the API on port 8080.

The new comment doesn't explain why this piece of code is there to begin with. Please do keep the explanation that when using Vite in dev mode, the web app runs on a different port than the API.

The new comment doesn't explain why this piece of code is there to begin with. Please do keep the explanation that when using Vite in dev mode, the web app runs on a different port than the API.
william-at-counter marked this conversation as resolved
William Gardner added 1 commit 2024-04-08 21:35:15 +02:00
Author
Contributor

Done 👍

Done 👍
Author
Contributor

Putting this here for anyone facing SSL issues coming from search, you can use the following command to patch the flamenco-3.4-linux-amd64 version of flamenco-manager with an approximate fix (see this Dockerfile)

printf 'const bw=Ew.replace("http","ws")  ' | dd of=/opt/flamenco/flamenco-manager bs=1 seek=13860098 count=34 conv=notrunc
Putting this here for anyone facing SSL issues coming from search, you can use the following command to patch the `flamenco-3.4-linux-amd64` version of flamenco-manager with an approximate fix (see [this Dockerfile](https://github.com/wg4568/flamenco-docker/blob/main/Dockerfile)) ``` printf 'const bw=Ew.replace("http","ws") ' | dd of=/opt/flamenco/flamenco-manager bs=1 seek=13860098 count=34 conv=notrunc ```
Contributor

Thanks @William-Gardner so much for this patch... really useful!

Thanks @William-Gardner so much for this patch... really useful!

Putting this here for anyone facing SSL issues coming from search, you can use the following command to patch the flamenco-3.4-linux-amd64 version of flamenco-manager with an approximate fix

I don't think it's a good idea to suggest patching the executable. Better to either build your own executable with a fix backported locally, or wait for the new release.

> Putting this here for anyone facing SSL issues coming from search, you can use the following command to patch the `flamenco-3.4-linux-amd64` version of flamenco-manager with an approximate fix I don't think it's a good idea to suggest patching the executable. Better to either build your own executable with a fix backported locally, or wait for the new release.
Sybren A. Stüvel approved these changes 2024-04-11 14:51:56 +02:00
Sybren A. Stüvel left a comment
Owner

Thanks!

Thanks!
Sybren A. Stüvel merged commit ea68faa577 into main 2024-04-11 15:00:55 +02:00
Sign in to join this conversation.
No description provided.