Preconfigured Shared Ports
Is there a way to preconfigure shared ports to public in a coder template?
I am trying to run Hasura in a docker container within coder (docker in Envbox). Another dashboard docker image uses the exposed Hasura URL. I don't have a way to set
credentials: "include"
within the fetch calls of the dashboard. The only way to get everything working is for me to manually set the "Shared Port" to public
. I am trying to automate creating a workspace and running the docker stack and would prefer to not have to manually set this value on every workspace. Is there a way to preconfigure this port to be public or script the startup script to expose the port as public?
Solution:Jump to solution
I was able to get this url to load:
https://nhost-dashboard--main--a1--jovermier.coder.hahomelabs.com
but this url with the additional apps didn't work.
https://nhost-dashboard--main--a1--jovermier-apps.coder.hahomelabs.com/
...7 Replies
Would a
coder_app
suit your needs?
It's basically just a permanently open port
https://registry.terraform.io/providers/coder/coder/latest/docs/resources/app#share-1sure that would work
I have tried this approach but the dashboard still has auth redirect issue. Only when i manually add "Shared Ports" to public did it start working.




I don't completely follow, but it looks like your service running on
8082
is trying to hit port 1337
via browser portforwarding (1337--<agent>...
), and not the app url. The app URL would start with the slug
of the app
<slug>--<agent>--<workspace>--<username>--apps.example.coder.com
Solution
I was able to get this url to load:
https://nhost-dashboard--main--a1--jovermier.coder.hahomelabs.com
but this url with the additional apps didn't work.
https://nhost-dashboard--main--a1--jovermier-apps.coder.hahomelabs.com/
I haven't seen the apps suffix on a username before in the docs. Is this a feature?
Switching to using the slug rather than the port number fixed the issue. Thank you for the help 🙂I haven't seen the apps suffix on a username before in the docs. Is this a feature?ah nah sorry, my mistake, that's from our own coder configuration glad to hear that worked!
@Phorcys closed the thread.