Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Self-hosted version provides http src as 127.0.0.1:3000 #109

Closed
BackedUpBooty opened this issue Jun 11, 2022 · 5 comments
Closed

Self-hosted version provides http src as 127.0.0.1:3000 #109

BackedUpBooty opened this issue Jun 11, 2022 · 5 comments

Comments

@BackedUpBooty
Copy link

BackedUpBooty commented Jun 11, 2022

Describe the bug
I created a reverse proxy to access the gui via my sub.domain.com. The documentation I found doesn't really give info for this, however the tags being generated for applications still show src=http://127.0.0.1:3000/edge/xxxxxxxxxxxxxxxxxxx. I have tried changing the PROXY_LOCATION and the S8_EDGE_SERVER to my sub.domain.com but the generated tags still show the src listed above.

How do we change the tag so that it will work via reverse proxy? Doing it manually doesn't seem to work

To Reproduce
Steps to reproduce the behavior:

  1. Create service via docker-compose (including trying to use https://mysub.domain.com as proxy location and edge server)
  2. Create reverse proxy to access via 'mysub.domain.com`
  3. Create User
  4. Log in
  5. Create application
  6. View generated tag

Expected behavior
Generated tag would follow a template which allowed for reverse proxies, something like:

<script src="https://sub.domain.com/[platformID]/tm.js" async></script>

Additional context
Hardware

  • Synology NAS (DS920+)
  • Nameserver is Cloudflare
@BackedUpBooty BackedUpBooty changed the title Self-hosted version provides http src as 127.0.0.0:3000 Self-hosted version provides http src as 127.0.0.1:3000 Jun 11, 2022
@cwbeck
Copy link
Contributor

cwbeck commented Jun 11, 2022

@BackedUpBooty thank you for the bug report.

Just to clarify that you are using a load balancer to terminate SSL and then proxy that on? Are you doing it all via docker-compose locally?

We'll investigate using the steps you have provided and update this thread with configuration steps or push a fix.

@BackedUpBooty
Copy link
Author

Hey thanks for the quick reply.

I only have the one server which both the proxy and scale8 services are running on.

Proxy is a pre-existing SWAG docker container (essentially nginx + LE certificate host) which is pointing at the router container (which I guess is an nginx container itself at the end of the day).

Yes everything is being run via docker-compose locally.

@cwbeck
Copy link
Contributor

cwbeck commented Jun 11, 2022

Awesome, thank you for the extra info. We'll replicate your setup and get this sorted for you.

@cwbeck
Copy link
Contributor

cwbeck commented Jun 11, 2022

@BackedUpBooty - I have updated docker-compose.yml to reflect the router setting requirement.

#111

api:
        image: scale8/api:latest
        container_name: api
        depends_on:
            - mongodb
        expose:
            - "8082"
        environment:
            # To connect to a local version of MongoDB, use mongodb://host.docker.internal .
            MONGO_CONNECT_STRING: "mongodb://mongodb"
            # When booting, we want the server to run the setup job (this will race if multiple API servers are booted at the same time)
            SETUP_MODE: "true"
            # The UI server...
            S8_UI_SERVER: "http://127.0.0.1:8080"

If you change S8_UI_SERVER to https://mysub.domain.com that will make sure the generated tag is correct.

edge:
        image: scale8/edge:latest
        container_name: edge
        depends_on:
            - mongodb
        expose:
            - "6080"
        environment:
            # Run in production
            S8_ENV: "production"
            # To connect to a local version of MongoDB, use mongodb://host.docker.internal .
            MONGO_CONNECT_STRING: "mongodb://mongodb"
            # The API server - required for generating live previews. Here we refer to the 'api' server as defined below.
            S8_API_SERVER: "http://api:8082"
            # The root server refers to the entry point of the network. In this example, we are using the 'route' defined below.
            S8_EDGE_SERVER: "http://127.0.0.1:8080"
            # Proxy a platform's live build in. PROXY_FOR can be either be 'core' or the platform id associated with the platform.
            # PROXY_FOR: "core"
            # PROXY_LOCATION: "http://host.docker.internal:3124/main.js"

Then in the edge config, change S8_EDGE_SERVER to https://mysub.domain.com.

PROXY_LOCATION is purely for debugging and creating platforms. You don't need to change it.

Please let me know if you have any other issues.

@BackedUpBooty
Copy link
Author

Hey thanks very much, that did it! I'll close the ticket now, thanks for such a speedy fix. Looking forward to playing around with this now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants