feat(cli): Add disable-remote command (#10587)

* fix(remotes): improve unresponsive remote handling
This commit is contained in:
spacotte-vates
2026-10-28 10:05:11 +01:00
committed by GitHub
parent 9e1fc78f84
commit 54c52e8f24
2 changed files with 28 additions and 0 deletions

View File

@@ -22,6 +22,7 @@
- [Pool/Dashboard] In the CPU and RAM usage cards, show a "No data to calculate" message when there is no host or VM to rank (PR [#10386](https://github.com/vatesfr/xen-orchestra/pull/10386))
- [i18n] Update Chinese (Simplified Han script), Czech, Danish, Dutch, German, Italian, Portuguese, Portuguese (Brasil), Russian, Slovak, Spanish, Swedish and Ukrainian translations (PR [#10464](https://github.com/vatesfr/xen-orchestra/pull/10464))
- [i18n] Update Arabic, Danish, Finnish, Italian, Japanese, Korean, Norwegian, Persian, Polish, Portuguese (Brasil), Russian and Ukrainian translations (PR [#10641](https://github.com/vatesfr/xen-orchestra/pull/10641))
- [CLI] Add new command to `xo-server-db` cli: `disable-remote <id>`, disables a remote while xo-server is stopped (PR [#10587](https://github.com/vatesfr/xen-orchestra/pull/10587/))
### Bug fixes

View File

@@ -94,6 +94,26 @@ const COMMANDS = {
repl.on('error', reject).on('exit', resolve)
})
},
async 'disable-remote'(args) {
const id = args[0]
assert(id, 'disable-remote requires a remote id')
const db = await this.getDb('remote')
const remote = await db.first(id)
assert(remote, `Remote ${id} not found`)
if (remote.enabled !== true && remote.enabled !== 'true') {
process.stdout.write(`Remote ${remote.name} (${id}) already disabled\n`)
return
}
remote.enabled = false
await db.update(remote)
process.stdout.write(`Remote ${remote.name} (${id}) disabled\n`)
},
}
async function main(args) {
@@ -124,6 +144,13 @@ xo-server-db repl
- redis: a raw node-redis instance connected to the database
- <namespace>: an xo-collection instance to the corresponding namespace in the database
xo-server-db disable-remote <id>
Disable a remote so that xo-server does not mount it on its next start.
<id>
The id of the remote to disable.
`)
return
}