Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/core url not set for gui SOFIE-94 #8

Draft
wants to merge 5 commits into
base: release51
Choose a base branch
from

Conversation

olzzon
Copy link
Collaborator

@olzzon olzzon commented May 16, 2024

About the Contributor

This PR was made on behalf of BBC

Type of Contribution

This is a bug fix

Current Behavior

Currently the Sofie GUI had to have "/" as it's path to work.

New Behavior

It's now possible to have a sub-path as root for the GUI

Testing Instructions

Run a Nginx in front of Sofie Core with a reverse proxy AND wb socket support.
Like this:

 server {
        listen       8080;
        server_name  localhost;
    
        location /sofie {
            proxy_pass http://127.0.0.1:3000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
}

Time Frame

This Fix is ready for testing

Status

  • [x ] PR is ready to be reviewed.
  • [ x] The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

Copy link

@jstarpl jstarpl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe it would be good to create our own wrapper around Meteor.absoluteUrl() and put it somewhere in lib, so that when we migrate away from Meteor, the change will only be needed in one place and there will be only a single import to replace.

meteor/client/main.tsx Outdated Show resolved Hide resolved
meteor/client/ui/i18n.ts Outdated Show resolved Hide resolved
olzzon and others added 2 commits May 16, 2024 11:03
@olzzon
Copy link
Collaborator Author

olzzon commented Aug 20, 2024

Issue:
Deep links does not parse CSS expect when having e.g. Nginx in front

@Julusian
Copy link
Collaborator

Julusian commented Sep 18, 2024

I am not having any luck when testing this (development env, not docker).
If I use proxy_pass http://127.0.0.1:3000/;, and don't set a ROOT_URL for meteor, then it fails to load all the js files, as meteor is unaware it is being served from a folder.

If I use proxy_pass http://127.0.0.1:3000/sofie/; and set a ROOT_URL="https://my-domain/sofie", then it loads most things, but is missing the css.
Trying to download a snapshot fails, as it is trying to fetch https://my-domain/api/...., not scoped under the sofie directory. I expect this will be the case in the other places we do these http requests.
But also worth noting that sofie is not correctly scoping the handlers for those koa-backed routes (ie http://localhost:3000/api/.... is the correct url even though the ui is accessed at http://localhost:3000/sofie)

This could all behave differently when run from the docker images.

And I think it worth noting that the move to vite that nrk has in release52 will require this to be re-tested, and could break this in other ways.

@@ -9,7 +9,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" data-href="/site.webmanifest" />
<link rel="manifest" href="/site.webmanifest" data-href="./site.webmanifest" />
Copy link
Collaborator

@Julusian Julusian Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work properly.
If you load the page https://my-domain/sofie/settings/tools/snapshots, the client tries to find this at https://my-domain/sofie/settings/tools/site.webmanifest?lng=en-GB, which is not correct.

The other paths which are still absolute also fail to load

@Julusian Julusian changed the title Fix/core url not set for gui Fix/core url not set for gui SOFIE-94 Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants