René's URL Explorer Experiment


Title: feat: Add serving applications on subdomains and port-based proxying by Emyrk · Pull Request #3753 · coder/coder · GitHub

Open Graph Title: feat: Add serving applications on subdomains and port-based proxying by Emyrk · Pull Request #3753 · coder/coder

X Title: feat: Add serving applications on subdomains and port-based proxying by Emyrk · Pull Request #3753 · coder/coder

Description: What this does This PR adds the ability to serve applications at / on subdomains. It also allows accessing ports inside a workspace with an anonymous application. Examples: Status Quo. An app on a path https://dev.coder.com/@Emyrk/dev-dogfood/apps/code-server/ NEW App on subdomain https://emyrk--dev-dogfood--main-code-server.dev.coder.com/ NEW Port on path https://dev.coder.com/@Emyrk/dev-dogfood/apps/8080/ NEW Port on subdomain https://emyrk--dev-dogfood--main-8080.dev.coder.com/ Conversation Wanted I hit a wall working on this, and want some discussion before I proceed. Token Scoping + Security We need to scope the session_token used for application authentication. It should only have access to application endpoints, and nothing else. This is so a malicious application cannot make authenticated requests on a user's behalf. We can do this with RBAC token scopes as defined in the RFC, or by making a new token type like we did for agent authentication. The new token can live in coder_application_token. If the application is using the path based routing, then the session_token of the primary auth can still be used. We need to either have a security setting to always host applications on another subdomain, or somehow reject api calls from these paths (??). Applications on another domain Eventually we want to serve applications on another domain for security reasons. To do this, we need to implement a way to insert a cookie on that subdomain, like we did with devurls in V1. I suggest we do this as a follow up PR. Applications on subpath We should be checking if authenticated requests come from an app via the Origin header. If it is, we should not allow that Origin to make authenticated requests. At present At present we do not allow sharing these application URLs to other users. So all of the security considerations can be follow ups. Future Work Support serving apps on other domains Scoped tokens to just application authentication Security check on the things above, might need some setting toggles to disallow certain things.

Open Graph Description: What this does This PR adds the ability to serve applications at / on subdomains. It also allows accessing ports inside a workspace with an anonymous application. Examples: Status Quo. An app on a...

X Description: What this does This PR adds the ability to serve applications at / on subdomains. It also allows accessing ports inside a workspace with an anonymous application. Examples: Status Quo. An app on a...

Opengraph URL: https://github.com/coder/coder/pull/3753

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:1e6ab30d-7b3d-29e0-e996-e07cf9de6ca1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE142:3A73AA:1D0268E:24BCFAE:6B019866
html-safe-noncee6a85bc96e56ae5430e7e2202508a7d070471b5e4d5fd575815ba4bcd520d4a1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTQyOjNBNzNBQToxRDAyNjhFOjI0QkNGQUU6NkIwMTk4NjYiLCJ2aXNpdG9yX2lkIjoiOTcwOTc2MjU5MjY3OTkxNjU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacbc24ba92211446b21a72c00c954127e86589770ba4b6cebfb5c4d2ca634acbe4
hovercard-subject-tagpull_request:1040959264
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/coder/coder/pull/3753/files
twitter:imagehttps://avatars.githubusercontent.com/u/5446298?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/5446298?s=400&v=4
og:image:altWhat this does This PR adds the ability to serve applications at / on subdomains. It also allows accessing ports inside a workspace with an anonymous application. Examples: Status Quo. An app on a...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/coder/coder git https://github.com/coder/coder.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id440752086
octolytics-dimension-repository_nwocoder/coder
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id440752086
octolytics-dimension-repository_network_root_nwocoder/coder
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/coder/coder/pull/3753/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fpull%2F3753%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fpull%2F3753%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=coder%2Fcoder
Reloadhttps://github.com/coder/coder/pull/3753/files
Reloadhttps://github.com/coder/coder/pull/3753/files
Reloadhttps://github.com/coder/coder/pull/3753/files
coderhttps://github.com/coder
coderhttps://github.com/coder/coder
Codehttps://github.com/coder/coder
Issues320 (320)https://github.com/coder/coder/issues
Pull requests470 (470)https://github.com/coder/coder/pulls
Discussionshttps://github.com/coder/coder/discussions
Actionshttps://github.com/coder/coder/actions
Projectshttps://github.com/coder/coder/projects
Security and quality49 (49)https://github.com/coder/coder/security
Insightshttps://github.com/coder/coder/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fcoder%2Fcoder%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcoder%2Fcoder%2Fissues%2Fnew%2Fchoose
deansheatherhttps://github.com/deansheather
mainhttps://github.com/coder/coder/tree/main
stevenmasley/unnamed-appshttps://github.com/coder/coder/tree/stevenmasley/unnamed-apps
Conversation 58 https://github.com/coder/coder/pull/3753
Commits 29 https://github.com/coder/coder/pull/3753/commits
Checks 0 https://github.com/coder/coder/pull/3753/checks
Files changed https://github.com/coder/coder/pull/3753/files
Please reload this pagehttps://github.com/coder/coder/pull/3753/files
feat: Add serving applications on subdomains and port-based proxying https://github.com/coder/coder/pull/3753/files#top
Show all changes 29 commits https://github.com/coder/coder/pull/3753/files
35ee5d6 chore: Add subdomain parser for applications Emyrk Aug 26, 2022 https://github.com/coder/coder/pull/3753/commits/35ee5d665650e84a6c091c17697519ef3fbf9952
a7e5bd6 Add basic router for applications using same codepath Emyrk Aug 26, 2022 https://github.com/coder/coder/pull/3753/commits/a7e5bd657cdfa8a7d7ad6398ec2c96942336fa2d
03c697d Merge remote-tracking branch 'origin/main' into stevenmasley/unnamed-… Emyrk Aug 29, 2022 https://github.com/coder/coder/pull/3753/commits/03c697df552fb31655edc9c774909519faef909d
3e30cdd Handle ports as app names Emyrk Aug 29, 2022 https://github.com/coder/coder/pull/3753/commits/3e30cddefd4c015ca3435b11868d59e4ba6d2eae
8397306 Add comments Emyrk Aug 30, 2022 https://github.com/coder/coder/pull/3753/commits/83973061a8d636e0b2f74202a41e66be998bde6b
f994ec3 Cleanup Emyrk Aug 30, 2022 https://github.com/coder/coder/pull/3753/commits/f994ec3bdb214fc6a764438e8a48c482e9da7075
fda80b8 Linting Emyrk Aug 30, 2022 https://github.com/coder/coder/pull/3753/commits/fda80b88f71c55392e59b9f2cb72b363f186ecee
6b09a0f Push cookies to subdomains on the access url as well Emyrk Aug 30, 2022 https://github.com/coder/coder/pull/3753/commits/6b09a0f040297777e47df5856f9e7f58335a5c46
634cd2e Fix unit test Emyrk Aug 30, 2022 https://github.com/coder/coder/pull/3753/commits/634cd2e04445b8ca72b8b72e95fd2d43540a4512
82df6f1 Fix comment Emyrk Aug 30, 2022 https://github.com/coder/coder/pull/3753/commits/82df6f183321dd27eed748da39dd1b8ff951abb7
49084e2 Reuse regex from validation Emyrk Aug 30, 2022 https://github.com/coder/coder/pull/3753/commits/49084e21620dcfe1d69efb82df45e1a240da838d
4696bf9 Export valid name regex Emyrk Aug 31, 2022 https://github.com/coder/coder/pull/3753/commits/4696bf9f4bad11c8b325eed48c87932518471070
b5d1f6a Move to workspaceapps.go Emyrk Aug 31, 2022 https://github.com/coder/coder/pull/3753/commits/b5d1f6aa8d6ed1c3acd39d4737d718152ef2c693
0578588 Change app url name order Emyrk Aug 31, 2022 https://github.com/coder/coder/pull/3753/commits/0578588bb7c4e9b8cb4bb627e097296735132bba
77d3452 Import order Emyrk Aug 31, 2022 https://github.com/coder/coder/pull/3753/commits/77d3452ae5aa7ce6016bd8ab3a10212237fa4050
931ecb2 Merge remote-tracking branch 'origin/main' into stevenmasley/unnamed-… Emyrk Aug 31, 2022 https://github.com/coder/coder/pull/3753/commits/931ecb2fadca50b79e444d92802dafbcfc1b5949
54f2bdd Deleted duplicate code Emyrk Aug 31, 2022 https://github.com/coder/coder/pull/3753/commits/54f2bdd4cc4cc92e250b49890c02bfe1ba1ae405
f1d7670 Rename subdomain handler Emyrk Aug 31, 2022 https://github.com/coder/coder/pull/3753/commits/f1d7670af634df34b974111a27ea751580997b4a
46e0900 Merge branch 'main' into stevenmasley/unnamed-apps deansheather Sep 8, 2022 https://github.com/coder/coder/pull/3753/commits/46e0900240b0ab72b592658a8a1b23de9658a70d
56c1d00 Change the devurl syntax to app--agent--workspace--user deansheather Sep 8, 2022 https://github.com/coder/coder/pull/3753/commits/56c1d0079a7fbf6ce46b544937d7813ee4816f58
25d776a more devurls support stuff, everything should work now deansheather Sep 9, 2022 https://github.com/coder/coder/pull/3753/commits/25d776a2268dd8a777ae13cec4c271d8ad113e7c
f3c6645 devurls working + tests deansheather Sep 12, 2022 https://github.com/coder/coder/pull/3753/commits/f3c664576e7b14ec0b173fed14a3e9f919e668bf
75c4713 Merge branch 'main' into stevenmasley/unnamed-apps deansheather Sep 12, 2022 https://github.com/coder/coder/pull/3753/commits/75c4713ae1d5354db837d910218bbe5dd6ad80a4
1f8a1f0 Move stuff to httpapi deansheather Sep 12, 2022 https://github.com/coder/coder/pull/3753/commits/1f8a1f08f08640c0702916b001d6c50114cc0e78
2c7bcc1 fixup! Move stuff to httpapi deansheather Sep 12, 2022 https://github.com/coder/coder/pull/3753/commits/2c7bcc17e62e64316201823fa9a1b7bf565bbaa6
dc0d348 Merge branch 'main' into stevenmasley/unnamed-apps deansheather Sep 12, 2022 https://github.com/coder/coder/pull/3753/commits/dc0d348ac5eddaa3c8b39a6e20a851a274289ac7
58653d4 kyle comments deansheather Sep 12, 2022 https://github.com/coder/coder/pull/3753/commits/58653d4aa4963b848b133af47f26fc4e22a5feed
5321bef fixup! kyle comments deansheather Sep 13, 2022 https://github.com/coder/coder/pull/3753/commits/5321befc69cbaa825b94f311cbe97dd2ff36d7ce
ad53b42 fixup! kyle comments deansheather Sep 13, 2022 https://github.com/coder/coder/pull/3753/commits/ad53b429c481777427dbac4f93aac1baff2d1b54
Clear filters https://github.com/coder/coder/pull/3753/files
Please reload this pagehttps://github.com/coder/coder/pull/3753/files
Please reload this pagehttps://github.com/coder/coder/pull/3753/files
server.go https://github.com/coder/coder/pull/3753/files#diff-9eaf2cc14b6524865ff24229bdeddfefc132e366ebdf33971774f68570dfb949
coderd.go https://github.com/coder/coder/pull/3753/files#diff-cae99a4758751d753f0ebcc421c2e10c55cbdc9cc6a08bfd89a7eb970db55f36
coderdtest.go https://github.com/coder/coder/pull/3753/files#diff-ce351d3003b0d62f64a8a41cddbe8d08a84895cd70b7bfe385b6e667477f6351
url.go https://github.com/coder/coder/pull/3753/files#diff-caac037fa3f598aa2c834f568a41be541a43aa16e0159ba76a428d96a973317e
url_test.go https://github.com/coder/coder/pull/3753/files#diff-09048af6ce6c48ba39ffebbfffaff39c72b8b383b4603c01f0de6e450841e4c8
username.go https://github.com/coder/coder/pull/3753/files#diff-96723ca11dd75ef6b237f8291ac42c08a53300c19150fc9d082e0b0126516064
apikey.go https://github.com/coder/coder/pull/3753/files#diff-309476c9621e252572e816ecc90fca9285c5712839587ef85c4656636b83aa43
logger.go https://github.com/coder/coder/pull/3753/files#diff-4597387e07ecc813ca0971daee8e4b40d5a8a9f9871ba4e10297efca4b1d09c5
userauth.go https://github.com/coder/coder/pull/3753/files#diff-0bdad5dd6f860b794a5f97ea3f7be5a74a7ad2a5aadcfcf02e67a63efd4222fd
users.go https://github.com/coder/coder/pull/3753/files#diff-b4e10e23e473674139719f634b3ad7e760467574e342916c4bbb42df7a613722
users_test.go https://github.com/coder/coder/pull/3753/files#diff-a3640fd39a07c39f0d43ef2fbcba3836a7613e979df14583a78508acd5731dee
workspaceapps.go https://github.com/coder/coder/pull/3753/files#diff-b7f37713e50164cfafef68116cbda1c6c3f15cd32fc2ab714be6f7b2d6165bf3
workspaceapps_test.go https://github.com/coder/coder/pull/3753/files#diff-6aebce7862b7549e27a2cdc21fda0ffe369a8b9c321305c4baec40b74efebd8e
coder-dev.sh https://github.com/coder/coder/pull/3753/files#diff-bfb1e2da4fa2d69b1fbd7fad9e06aa2f50c4f651422b5fea3fedcc8eff1315b5
develop.sh https://github.com/coder/coder/pull/3753/files#diff-8539668e211a0923c7f7cda23c3c8a977cf2025f59977659ddf9b3356a30b735
AppLink.tsx https://github.com/coder/coder/pull/3753/files#diff-e7c07a3fa8e6652b50b6acea6d995d365d3a81c19fc6bfcb4ae0717707ecba90
cli/server.gohttps://github.com/coder/coder/pull/3753/files#diff-9eaf2cc14b6524865ff24229bdeddfefc132e366ebdf33971774f68570dfb949
View file https://github.com/coder/coder/blob/ad53b429c481777427dbac4f93aac1baff2d1b54/cli/server.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/3753/{{ revealButtonHref }}
https://github.com/coder/coder/pull/3753/files#diff-9eaf2cc14b6524865ff24229bdeddfefc132e366ebdf33971774f68570dfb949
Please reload this pagehttps://github.com/coder/coder/pull/3753/files
https://github.com/coder/coder/pull/3753/files#diff-9eaf2cc14b6524865ff24229bdeddfefc132e366ebdf33971774f68570dfb949
coderd/coderd.gohttps://github.com/coder/coder/pull/3753/files#diff-cae99a4758751d753f0ebcc421c2e10c55cbdc9cc6a08bfd89a7eb970db55f36
View file https://github.com/coder/coder/blob/ad53b429c481777427dbac4f93aac1baff2d1b54/coderd/coderd.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/3753/{{ revealButtonHref }}
https://github.com/coder/coder/pull/3753/files#diff-cae99a4758751d753f0ebcc421c2e10c55cbdc9cc6a08bfd89a7eb970db55f36
https://github.com/coder/coder/pull/3753/files#diff-cae99a4758751d753f0ebcc421c2e10c55cbdc9cc6a08bfd89a7eb970db55f36
coderd/coderdtest/coderdtest.gohttps://github.com/coder/coder/pull/3753/files#diff-ce351d3003b0d62f64a8a41cddbe8d08a84895cd70b7bfe385b6e667477f6351
View file https://github.com/coder/coder/blob/ad53b429c481777427dbac4f93aac1baff2d1b54/coderd/coderdtest/coderdtest.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/3753/{{ revealButtonHref }}
https://github.com/coder/coder/pull/3753/files#diff-ce351d3003b0d62f64a8a41cddbe8d08a84895cd70b7bfe385b6e667477f6351
https://github.com/coder/coder/pull/3753/files#diff-ce351d3003b0d62f64a8a41cddbe8d08a84895cd70b7bfe385b6e667477f6351
coderd/httpapi/url.gohttps://github.com/coder/coder/pull/3753/files#diff-caac037fa3f598aa2c834f568a41be541a43aa16e0159ba76a428d96a973317e
View file https://github.com/coder/coder/blob/ad53b429c481777427dbac4f93aac1baff2d1b54/coderd/httpapi/url.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/3753/{{ revealButtonHref }}
Please reload this pagehttps://github.com/coder/coder/pull/3753/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.