Skip to content

feat: add nickname field to web server settings#3891

Open
zaaakher wants to merge 4 commits intoDokploy:canaryfrom
zaaakher:feat-server-nickname
Open

feat: add nickname field to web server settings#3891
zaaakher wants to merge 4 commits intoDokploy:canaryfrom
zaaakher:feat-server-nickname

Conversation

@zaaakher
Copy link
Contributor

@zaaakher zaaakher commented Mar 4, 2026

The problem I'm solving

I'm a self-hosting hobbyist and i have 2 dokploy instances (one in a laptop in my room and another in a VPS I'm paying for)
The following two tabs are for two different Dokploy instances and its hard to tell which is which
Image


  • Added a nickname field in the web server domain settings
  • I felt it might be unnecessary to add a new section just for a single field so i kept it in the web server domain settings
  • added migration to add the nickname field
  • updated the test file and ran the tests
Image

Before

Image

After

Image

Updated Settings UI

Image

Currently the nickname only shows up when i'm in the home page of my dokploy instance. Different pages don't use the nickname yet. If the maintainers are interested i can make another PR to have that nickname persist in all pages.

Kindly let me know if I missed something.

Greptile Summary

This PR adds a nickname field to the web server settings that gets displayed in the browser tab title as [nickname] - Dokploy, helping users distinguish between multiple Dokploy instances. The database migration, schema changes, API router wiring, and form UI are all cleanly implemented.

Key observations:

  • Redundant title update: _app.tsx sets the page title via both a <Head><title> element and a useEffect(() => { document.title = pageTitle }, [pageTitle]). In Next.js, the <Head> component from next/head already handles reactive DOM title updates — the useEffect is unnecessary and can be removed.
  • Unauthenticated page overhead: The getWebServerSettings query is a protectedProcedure but is now called unconditionally in _app.tsx (which wraps all pages, including the login page). This generates a failed 401 API request on every unauthenticated page load. Adding enabled: !!session (or an equivalent auth guard) would avoid this.
  • Missing nickname length limit: The nickname field has no maximum length constraint in the Zod form schema, which could result in an unusably long browser tab title.

Confidence Score: 4/5

  • This PR is safe to merge with minor issues around redundant title logic and an unnecessary API call on unauthenticated pages.
  • The core feature (nickname field with DB migration, schema, API, and UI) is correctly implemented end-to-end. The issues found are non-blocking: the useEffect/<Head> redundancy is harmless, the unauthenticated query call fails gracefully (React Query swallows the error), and missing length validation is a minor UX concern. No data integrity or security issues were found.
  • apps/dokploy/pages/_app.tsx — redundant useEffect and unconditional protected query on all pages.

Last reviewed commit: 7a50f77

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

@zaaakher zaaakher requested a review from Siumauricio as a code owner March 4, 2026 23:50
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 4, 2026
@zaaakher
Copy link
Contributor Author

zaaakher commented Mar 4, 2026

I forgot to mention, I included the defaultformatter to be biome in the vscode settings. So that if a contributor has prettier and biome the settings will automatically set biome as the default formatter

@dosubot dosubot bot added the enhancement New feature or request label Mar 4, 2026
@dosubot
Copy link

dosubot bot commented Mar 4, 2026

Related Documentation

Checked 7 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

Comment on lines +38 to +40
useEffect(() => {
document.title = pageTitle;
}, [pageTitle]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Redundant document.title assignment

The useEffect on line 38 sets document.title = pageTitle directly, but the <Head> component at line 52 already sets <title>{pageTitle}</title> through Next.js conventions. In Next.js, the <Head> component from next/head reactively updates the DOM <title> element whenever pageTitle changes, making the useEffect redundant.

Additionally, this useEffect could interfere with page-level <Head> titles set by individual pages: the document.title write fires once when the query resolves and then persists, potentially fighting with page-specific titles on subsequent navigations.

Consider removing the useEffect and relying solely on the <Head> component:

Suggested change
useEffect(() => {
document.title = pageTitle;
}, [pageTitle]);
return (

Comment on lines +31 to +36
const { data: webServerSettings } =
api.settings.getWebServerSettings.useQuery();

const pageTitle = webServerSettings?.nickname
? `[${webServerSettings.nickname}] - Dokploy`
: "Dokploy";
Copy link
Contributor

Choose a reason for hiding this comment

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

getWebServerSettings called on every page including unauthenticated routes

_app.tsx wraps all pages, including public/unauthenticated routes such as the login page. getWebServerSettings is a protectedProcedure that requires authentication, so it will produce a failed (401) request for every unauthenticated page load. While React Query catches this gracefully and webServerSettings stays undefined (defaulting pageTitle to "Dokploy"), it creates unnecessary failed API calls on every login/signup visit.

Consider guarding the query with an authentication check, or using the enabled option so the query only fires when a user session exists:

const { data: session } = api.auth.getSession.useQuery(); // or however auth state is exposed
const { data: webServerSettings } =
  api.settings.getWebServerSettings.useQuery(undefined, {
    enabled: !!session,
  });

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

Labels

enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant