Skip to content

[BUG 976] Make useLocalInstall() more complete#981

Draft
alanhargreaves wants to merge 2 commits into
accius:Stagingfrom
alanhargreaves:useLocalInstall
Draft

[BUG 976] Make useLocalInstall() more complete#981
alanhargreaves wants to merge 2 commits into
accius:Stagingfrom
alanhargreaves:useLocalInstall

Conversation

@alanhargreaves
Copy link
Copy Markdown
Collaborator

What does this PR do?

  • Makes useLocalInstall() check a few more domain names
  • Tidies up useLocalInstall()
  • Removes extra instances of isLocalInstall (passing the one copy around) and reduces the calls to useLocalInstall to teh single call in App
  • Adds a .env variable called localServer, which defaults to false. If this is set to true it will override all other checks in `useLocalInstall()

Type of change

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor / code cleanup
  • Documentation
  • Translation
  • Map layer plugin

How to test

TODO

Checklist

  • App loads without console errors
  • Tested in Dark, Light, and Retro themes
  • Responsive at different screen sizes (desktop + mobile)
  • If touching server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)
  • If adding an API route: includes caching and error handling
  • If adding a panel: wired into Modern, Classic, and Dockable layouts
  • No hardcoded colors — uses CSS variables (var(--accent-cyan), etc.)
  • No .bak, .old, console.log debug lines, or test scripts included

Screenshots (if visual change)

Make use of  serverCfg.serverLocal if it exists in useLocalInstall()
Make useLocalInstall() check a few more things, including allowing a true setting for serverCfg.serverLocal overriding anything else
Copy link
Copy Markdown
Owner

@accius accius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good direction overall. Adding the .home / .lan / .internal host patterns expands coverage cleanly, and hoisting the useLocalInstall() call up to App and passing the boolean down via props eliminates the duplicate hook calls in SettingsPanel/WorldMap. The serverLocal env-driven override is a useful escape hatch for unusual deployments (Tailscale, reverse-proxied LAN hosts on public-looking domains, etc.).

Two things before this is ready to come out of draft:

  1. The "How to test" section in the PR description is still TODO — please fill that in so reviewers (and future you) can validate the expanded host pattern matrix and the serverLocal override path.
  2. The frontend reads serverCfg.serverLocal in useAppConfig.js, but I don't see the corresponding server-side change that surfaces that field through /api/config (or wherever getServerConfig() resolves). If that lives in another commit on the branch, great — otherwise it'll need to be added so the override actually flows through end-to-end.

Holding the merge until it's out of draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] useLocalInstall() does not recognize common homelab/internal DNS domains such as .home

2 participants