C
Coder.comโ€ข3y ago
Mr_Neezer

Custom button, like the code-server one?

I setup a resource block like I saw in some of the example Coder templates for a different service running in my workspace, Tilt:
resource "coder_app" "tilt" {
agent_id = coder_agent.main.id
name = "tilt"
icon = "https://yt3.ggpht.com/ytc/AMLnZu_KBLJd3vBogFZfah1GLQHiB3LQmjL9t4ZKyVpR=s68-c-k-c0x00ffffff-no-rj"
url = "http://localhost:10350"
subdomain = false

healthcheck {
url = "http://localhost:10350"
interval = 3
threshold = 10
}
}
resource "coder_app" "tilt" {
agent_id = coder_agent.main.id
name = "tilt"
icon = "https://yt3.ggpht.com/ytc/AMLnZu_KBLJd3vBogFZfah1GLQHiB3LQmjL9t4ZKyVpR=s68-c-k-c0x00ffffff-no-rj"
url = "http://localhost:10350"
subdomain = false

healthcheck {
url = "http://localhost:10350"
interval = 3
threshold = 10
}
}
The button shows up on my workspace dashboard in Coder, and seems to accurately reflect the status (yay!). But trying to navigate to it and all my assets are broken; I think because they are relative to the root /asset/path and not relative ./asset/path. I saw https://github.com/coder/coder/pull/4263 was recently pushed, but I don't understand how this helps with relative_path going away... or is that not related? I tried changing subdomain = true but that made no discernible difference. Confused.
GitHub
feat: use app wildcards for apps if configured by deansheather ยท Pu...
Adds subdomain to the WorkspaceApp struct. Changes the dashboard to use subdomain app access if subdomain is true and an app hostname is set. Add a tooltip explaining why the app button is greyed o...
3 Replies
kyle
kyleโ€ข3y ago
https://coder.com/docs/coder-oss/latest/admin/configure#wildcard-access-url If you set up wildcard routing for your Coder deployment, then you can serve apps at /!
Configuration - Coder OSS main docs
Learn how to configure Coder.
Mr_Neezer
Mr_NeezerOPโ€ข3y ago
I had planned to use subdomains to make my apps directly accessible... possibly with more than one ingress. Will this mess with that at all, AFAYK? Admittedly I hadn't gotten far enough in my Coder setup to get this working yet... As an example: - tenant-1.state.workspace-name.coder.tld.dev => resolves to k8s cluster - tenant-2.state.workspace-name.coder.tld.dev => resolves to k8s cluster - etc. - coder.tld.dev => resolves to Coder - *.coder.tld.dev => resolves to Coder (suggestion above, with CODER_WILDCARD_ACCESS_URL) Ok, happy to report I got things working. Here are some notes about things I was missing from before: - The docs @kyle mentioned are necessary, but they're only part of the picture. You also need to ensure you're running Coder 0.9.7+ (I was previously on Coder 0.9.3, which didn't support the work on subdomain from the linked issue above). ๐Ÿคฆโ€โ™‚๏ธ - Still need to provide url in the resource block for coder_app, but it should be the localhost:PORT format (as if you were accessing it directly on the workspace host); Coder will automagically turn that into a subdomain link if subdomain = true but you (read: me) don't have to manually make that link yourself! ๐Ÿ˜Œ - Also, my DNS was wrong, as I wasn't resolving my wildcard domain correctly. So yeah, make sure your DNS is sorted before head-banging too much on Coder or your provision scripts. ๐Ÿ˜ถ - I rejiggered my domain names to put the coder.* and *.coder.* adjacent to (but not direct parents of) my other planned subdomain routes, so my earlier concern should be negated, if it was even valid to begin with. ๐Ÿคทโ€โ™‚๏ธ Continue to be amazed by how flexible, powerful, and (ultimately) easy Coder has been... I'm not ready to add "intuitive" to that list quite yet, but I am happy to discover my issues have simple solutions (so far, at least!) knocks on wood
kyle
kyleโ€ข3y ago
I appreciate the thorough description of little nits you encountered. Hopefully we can add intuitive to the lit soon enough ๐Ÿ™‚
Want results from more Discord servers?
Add your server