Repository navigation
Rename this server in Dagu Console from Dagu - #3202
Conversation
Dagu Console showed a connected server only by the name it reports, often a cryptic hostname, and only a config change and a restart could change it. PUT /api/v1/license/server-name sets the name Dagu Console shows for the server, and an empty name returns to the reported one. The license status now reports the name Dagu Console shows, carried in the license token, beside the name the server reports.
The Server row on Plan & features gets a Rename button for a server that checks in with Dagu Console. It shows the name Dagu Console uses and, once renamed, the name the server reports beside it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
Dagu Console showed a connected server only by the name it reports (
license.server_name, else the hostname, e.g.s-macbook-pro.taild5c75a.ts.net), and changing it took a config edit, a restart, and up to an hour.PUT /api/v1/license/server-name(admin only, also through remote nodes) sends the name to Dagu Console and returns the license status. It refuses names over 100 characters and licenses that never check in, and explains a refusal by Dagu Console. Each rename is audited aslicense_server_rename.serverNameis now the name Dagu Console shows, read from the license token's newserver_nameclaim; the newreportedNameis the name the server reports. Without the claim (older Console),serverNamestays the reported name.Dagu Console keeps the name, so there is one source for it. Owners can also rename a server on its Settings tab in the console, and check-ins no longer overwrite a name a person gave. The console side (
POST /api/v1/licenses/renameand theserver_nameclaim) is already deployed.Docs: dagucloud/docs#46
Testing
internal/license: client request/response, rename applies and saves the returned token without counting as a check-in, empty name clears, length limit counts characters, Console refusal keeps the license, 404 from an older Console, licenses that never check in.internal/service/frontend/api/v1: rename through a fake Console, refusal message, unreachable Console (502), name too long, no check-in, admin-only, audit entry.make check,make testfor the touched packages,pnpm test,pnpm typecheck,pnpm build.Summary by cubic
Lets you rename this server in Dagu Console from the Plan & features page, so the console no longer shows only the cryptic hostname the server reports.
PUT /api/v1/license/server-name(admin only) sends the name to Dagu Console, refuses names over 100 characters, explains a refusal by Dagu Console, and is audited aslicense_server_rename.serverNameand the reported name asreportedName; without aserver_nameclaim,serverNamefalls back to the reported name.Written for commit a19bf76. Summary will update on new commits.
Summary by CodeRabbit