You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/client/web
Will Norris 33de922d57 client/web: only enforce path prefix in CGI mode
The client has changed a bit since we introduced the path prefix.  It is
now used for two things:

- its original purpose, of ensuring that when the client is run in CGI
  mode at arbitrary paths, then relative paths for assets continue to
  work

- we also now pass the path to the frontend and use wouter to manage
  routes for the various subpages of the client.

When the client is run behind a reverse proxy (as it is in Home
Assistant), it is common for the proxy to rewrite the request so that
the backend application doesn't see the path it's being served at. In
this case, we don't need to call enforcePrefix, since it's already
stripped before it reaches us.  However, wouter (or react router
library) still sees the original path in the browser, and needs to know
what part of it is the prefix that needs to be stripped off.

We're handling this by now only calling enforcePrefix when run in CGI
mode. For Home Assistant, or any other platform that runs the client
behind a reverse proxy with a custom path, they will still need to pass
the `-prefix` flag to `tailscale web`, but we will only use it for route
handling in the frontend.

Updates #10261

Signed-off-by: Will Norris <will@tailscale.com>
2 years ago
..
build client/web: precompress assets 2 years ago
src client/web: small UI cleanups 2 years ago
assets.go client/web: precompress assets 2 years ago
auth.go client/web: add logging of device management type for web client (#10492) 2 years ago
index.html client/web: small tweaks for small screens 2 years ago
package.json client/web: start using swr for some fetching 2 years ago
qnap.go client/web: add readonly/manage toggle 2 years ago
styles.json client/web: adjust colors and some UI margins 2 years ago
synology.go client/web: add readonly/manage toggle 2 years ago
tailwind.config.js client/web: adjust colors and some UI margins 2 years ago
tsconfig.json client/web: add debug mode for web client ui updates 2 years ago
vite.config.ts client/web: fix hotreload proxy 2 years ago
web.go client/web: only enforce path prefix in CGI mode 2 years ago
web_test.go client/web: add logging of device management type for web client (#10492) 2 years ago
yarn.lock client/web: start using swr for some fetching 2 years ago