mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 07:54:49 +03:00
fix(nodes): isolate traffic sync and report client apply outcomes (#7308)
Isolate traffic synchronization with bounded round-robin per-node workers, independent maintenance and publication, cancellation and ordered shutdown drain. Recheck online eligibility inside the serialized writer before merging snapshots and retain the latest valid speed sample per node, with expiry and explicit empty publication.
Report direct per-node applied/pending/failed outcomes without changing local-save success semantics. Propagate downstream pending separately from direct ACKs so acknowledged batch items do not abort subsequent work. Integrate live admission into the existing #7314 ordered dispatcher with separate four-second queue and batch budgets, retaining monotonic dirty generations, exclusive full-delete/reconcile turns, durable deletion outbox, generation-matched settlement, cross-node recreation safeguards and targeted fingerprint invalidation. Preserve legacy peer compatibility and update generated API documentation.
Validation: all 12 CI jobs and Docs CI passed on reviewed head d13850474f (runs 46871519847 and 46871519831). PostgreSQL logs confirm eight ordering regressions, including saturation, lost ACK, cross-node recreation and bulk recovery. Author reports make verify, focused SQLite/PostgreSQL race tests, four mixed-version node E2E pairings and Xray E2E. No independent production-scale latency measurement or universal HTTP timeout guarantee.
Residual follow-ups: possible conservative false-pending result when a final full delete settles an intermediate superseded intent on the same node; add per-logical-operation settlement regression. Verify shutdown drain under a blocked writer/maintenance worker. These static-review concerns remain open for follow-up, not demonstrated data loss or a new deadlock.
Refs #7293
This commit is contained in:
@@ -390,6 +390,19 @@ merged with GUID-based baselines to avoid double counting after resets.
|
||||
`model.NodeClientTraffic`, `model.ClientGlobalTraffic` (cross-master totals).
|
||||
A client reset is queued per hosting node in `model.NodePendingReset` (`service/node_reset_queue.go`)
|
||||
and replayed by the node sync until the node accepts it.
|
||||
|
||||
Client mutations reserve node dispatch turns when their local transactions commit. The writer and
|
||||
inbound mutex are released before dispatch waits. Conflicting inbounds are ordered, independent
|
||||
inbounds can use any of four live slots on a node, and full deletion and reconciliation use an
|
||||
exclusive node turn. Each live push waits up to four seconds for its turn and then receives up to
|
||||
four seconds for the whole RPC batch. A saturated delta is left dirty for reconciliation. Full
|
||||
deletions are stored in the transactional node outbox and retried until the direct peer confirms
|
||||
deletion or absence. HTTP requests can also include validation, writer waits and multiple waves of
|
||||
inbound work. A direct acknowledgment can report downstream work pending alongside these results.
|
||||
|
||||
Node traffic polls run independently within the shared worker limit. The publisher sums the latest
|
||||
valid speed sample from every eligible node. Display samples expire after two five-second windows
|
||||
and leave the cumulative counter baseline available for the next poll.
|
||||
Periodic resets: `job/periodic_traffic_reset_job.go` (keyed off `Inbound.TrafficReset`).
|
||||
|
||||
Cross-panel totals are stored per master GUID and hosted email, separately from local
|
||||
|
||||
@@ -812,6 +812,16 @@ _openapi:
|
||||
(`inbound 7: <message>`), and several failures are reported together,
|
||||
one per line. `limitHwid` is applied only when every inbound
|
||||
succeeded, so re-run the call after fixing the failure.
|
||||
|
||||
|
||||
For node-backed inbounds, `obj.nodeResults` reports each affected
|
||||
node. `applied` means the direct peer acknowledged the change with no
|
||||
reported downstream work, `pending` means a locally saved change still
|
||||
needs reconciliation, and `failed` means a local inbound write failed.
|
||||
For several inbounds on one node, the least complete result is
|
||||
reported. `obj.nodePending` is true when any local change still needs
|
||||
reconciliation. The outer `success` continues to report local save
|
||||
success. `obj` is null when no node result is available.
|
||||
heading: create-a-new-client-and-attach-it-to-one-or-more-inbounds-in-a-single-call-body-is-json-per-protocol-secrets-are-generated-server-side-when-omitted-so-callers-can-send-only-the-universal-fields
|
||||
- content: Uses the same calendar and catch-up calculation as auto-renew in the
|
||||
panel timezone. resetWeekday is 1 (Monday) to 7 (Sunday), 0 disables
|
||||
@@ -823,7 +833,8 @@ _openapi:
|
||||
preview is informational and does not reserve an allowance or
|
||||
guarantee node availability.
|
||||
heading: preview-client-auto-renewal-dates-without-saving-or-resetting-anything
|
||||
- content: 'An omitted `flow` leaves every attached inbound on its own flow. Send
|
||||
- content: >-
|
||||
An omitted `flow` leaves every attached inbound on its own flow. Send
|
||||
`"reverse": null` to remove the reverse tag. Credentials (`id`,
|
||||
`password`, `auth`, `secret`, `subId`) and WireGuard/AmneziaWG
|
||||
`allowedIPs` are never cleared: an empty value keeps the stored one.
|
||||
@@ -834,9 +845,20 @@ _openapi:
|
||||
still have applied the edit to the remaining inbounds. The client
|
||||
record is written after the inbounds, so a failure there is reported
|
||||
without an `inbound <id>:` prefix and leaves the inbound edits in
|
||||
place.'
|
||||
place.
|
||||
|
||||
|
||||
For node-backed inbounds, `obj.nodeResults` reports each affected
|
||||
node. `applied` means the direct peer acknowledged the change with no
|
||||
reported downstream work, `pending` means a locally saved change still
|
||||
needs reconciliation, and `failed` means a local inbound write failed.
|
||||
For several inbounds on one node, the least complete result is
|
||||
reported. `obj.nodePending` is true when any local change still needs
|
||||
reconciliation. The outer `success` continues to report local save
|
||||
success. `obj` is null when no node result is available.
|
||||
heading: update-an-existing-client-by-email-changes-propagate-to-every-attached-inbound-body-is-the-json-client-payload-omitted-fields-keep-their-current-values-and-an-explicit-zero-empty-or-null-value-clears-a-field-except-as-noted-below
|
||||
- content: 'Query-parameter alias for the path endpoint. Use email=. or email=..
|
||||
- content: >-
|
||||
Query-parameter alias for the path endpoint. Use email=. or email=..
|
||||
to manage legacy reserved names without URL dot-segment normalization.
|
||||
An omitted `flow` leaves every attached inbound on its own flow. Send
|
||||
`"reverse": null` to remove the reverse tag. Credentials (`id`,
|
||||
@@ -849,9 +871,20 @@ _openapi:
|
||||
still have applied the edit to the remaining inbounds. The client
|
||||
record is written after the inbounds, so a failure there is reported
|
||||
without an `inbound <id>:` prefix and leaves the inbound edits in
|
||||
place.'
|
||||
place.
|
||||
|
||||
|
||||
For node-backed inbounds, `obj.nodeResults` reports each affected
|
||||
node. `applied` means the direct peer acknowledged the change with no
|
||||
reported downstream work, `pending` means a locally saved change still
|
||||
needs reconciliation, and `failed` means a local inbound write failed.
|
||||
For several inbounds on one node, the least complete result is
|
||||
reported. `obj.nodePending` is true when any local change still needs
|
||||
reconciliation. The outer `success` continues to report local save
|
||||
success. `obj` is null when no node result is available.
|
||||
heading: update-an-existing-client-by-email-changes-propagate-to-every-attached-inbound-body-is-the-json-client-payload-omitted-fields-keep-their-current-values-and-an-explicit-zero-empty-or-null-value-clears-a-field-except-as-noted-below-1
|
||||
- content: 'The inbounds are applied concurrently and independently: one that
|
||||
- content: >-
|
||||
The inbounds are applied concurrently and independently: one that
|
||||
fails no longer stops the others. Every inbound error names the
|
||||
inbound it came from (`inbound 7: <message>`), and several failures
|
||||
are reported together, one per line. So a `success:false` response can
|
||||
@@ -859,9 +892,20 @@ _openapi:
|
||||
record is kept in that case, so re-running the call retries exactly
|
||||
the leftovers. The record and traffic rows are dropped after the
|
||||
inbounds, so a failure there is reported without an `inbound <id>:`
|
||||
prefix and leaves the client already removed from every inbound.'
|
||||
prefix and leaves the client already removed from every inbound.
|
||||
|
||||
|
||||
For node-backed inbounds, `obj.nodeResults` reports each affected
|
||||
node. `applied` means the direct peer acknowledged the change with no
|
||||
reported downstream work, `pending` means a locally saved change still
|
||||
needs reconciliation, and `failed` means a local inbound write failed.
|
||||
For several inbounds on one node, the least complete result is
|
||||
reported. `obj.nodePending` is true when any local change still needs
|
||||
reconciliation. The outer `success` continues to report local save
|
||||
success. `obj` is null when no node result is available.
|
||||
heading: delete-a-client-by-email-removes-it-from-every-attached-inbound-and-drops-its-traffic-record-unless-keeptraffic1-is-passed
|
||||
- content: 'Query-parameter alias for the path endpoint. Use email=. or email=..
|
||||
- content: >-
|
||||
Query-parameter alias for the path endpoint. Use email=. or email=..
|
||||
to manage legacy reserved names without URL dot-segment normalization.
|
||||
The inbounds are applied concurrently and independently: one that
|
||||
fails no longer stops the others. Every inbound error names the
|
||||
@@ -871,23 +915,55 @@ _openapi:
|
||||
record is kept in that case, so re-running the call retries exactly
|
||||
the leftovers. The record and traffic rows are dropped after the
|
||||
inbounds, so a failure there is reported without an `inbound <id>:`
|
||||
prefix and leaves the client already removed from every inbound.'
|
||||
prefix and leaves the client already removed from every inbound.
|
||||
|
||||
|
||||
For node-backed inbounds, `obj.nodeResults` reports each affected
|
||||
node. `applied` means the direct peer acknowledged the change with no
|
||||
reported downstream work, `pending` means a locally saved change still
|
||||
needs reconciliation, and `failed` means a local inbound write failed.
|
||||
For several inbounds on one node, the least complete result is
|
||||
reported. `obj.nodePending` is true when any local change still needs
|
||||
reconciliation. The outer `success` continues to report local save
|
||||
success. `obj` is null when no node result is available.
|
||||
heading: delete-a-client-by-email-removes-it-from-every-attached-inbound-and-drops-its-traffic-record-unless-keeptraffic1-is-passed-1
|
||||
- content: 'A WireGuard client brings its stored `allowedIPs` into the new inbound
|
||||
- content: >-
|
||||
A WireGuard client brings its stored `allowedIPs` into the new inbound
|
||||
instead of being given a fresh address, so the call fails with
|
||||
`inbound <id>: wireguard: allowedIPs entry <entry> overlaps <address>
|
||||
used by another client` when its range overlaps an address or prefix a
|
||||
different client of the target inbound holds. Free the address on that
|
||||
inbound first — see POST /panel/api/clients/add for the full rule.
|
||||
Inbounds are applied independently, so the remaining ones are still
|
||||
attached and a `success:false` response can be partial.'
|
||||
attached and a `success:false` response can be partial.
|
||||
|
||||
|
||||
For node-backed inbounds, `obj.nodeResults` reports each affected
|
||||
node. `applied` means the direct peer acknowledged the change with no
|
||||
reported downstream work, `pending` means a locally saved change still
|
||||
needs reconciliation, and `failed` means a local inbound write failed.
|
||||
For several inbounds on one node, the least complete result is
|
||||
reported. `obj.nodePending` is true when any local change still needs
|
||||
reconciliation. The outer `success` continues to report local save
|
||||
success. `obj` is null when no node result is available.
|
||||
heading: attach-an-existing-client-to-one-or-more-additional-inbounds-body-is-json
|
||||
- content: 'The inbounds are applied concurrently and independently: one that
|
||||
- content: >-
|
||||
The inbounds are applied concurrently and independently: one that
|
||||
fails no longer stops the others. Every inbound error names the
|
||||
inbound it came from (`inbound 7: <message>`), and several failures
|
||||
are reported together, one per line. So a `success:false` response can
|
||||
still have detached the remaining inbounds. Detach writes nothing
|
||||
beyond the inbounds, so every error carries the prefix.'
|
||||
beyond the inbounds, so every error carries the prefix.
|
||||
|
||||
|
||||
For node-backed inbounds, `obj.nodeResults` reports each affected
|
||||
node. `applied` means the direct peer acknowledged the change with no
|
||||
reported downstream work, `pending` means a locally saved change still
|
||||
needs reconciliation, and `failed` means a local inbound write failed.
|
||||
For several inbounds on one node, the least complete result is
|
||||
reported. `obj.nodePending` is true when any local change still needs
|
||||
reconciliation. The outer `success` continues to report local save
|
||||
success. `obj` is null when no node result is available.
|
||||
heading: detach-a-client-from-one-or-more-inbounds-without-deleting-the-client
|
||||
- content: The original credentials remain the primary device. Additional devices
|
||||
share their parent client email, traffic quota, expiry and enable
|
||||
@@ -909,6 +985,41 @@ _openapi:
|
||||
previously downloaded configuration loses access after the
|
||||
configuration is applied.
|
||||
heading: delete-an-additional-wireguard-device-and-release-its-address
|
||||
- content: For node-backed changes, the result can include obj.nodeResults and
|
||||
obj.nodePending alongside the bulk counts and per-email results. A
|
||||
direct acknowledgment with downstream work pending still allows the
|
||||
batch to continue.
|
||||
heading: shift-expiry-andor-traffic-quota-for-many-clients-in-one-call-adddaysaddbytes-may-be-negative-clients-with-unlimited-expiry-expirytime0-or-unlimited-traffic-totalgb0-are-skipped-for-the-corresponding-field--bulk-extend-never-converts-unlimited-to-limited-a-client-that-was-auto-disabled-solely-because-it-was-depleted-expired-or-over-quota-is-automatically-re-enabled--locally-and-on-its-node--when-the-adjustment-lifts-it-out-of-depletion-a-manually-disabled-or-still-depleted-client-is-left-disabled-the-optional-flow-directive-sets-the-xtls-flow-on-every-client-none-clears-it-xtls-rprx-visionxtls-rprx-vision-udp443-set-it-where-the-inbound-supports-it-omit-or--to-leave-it-unchanged-the-optional-limithwid-sets-maximum-registered-devices-0--unlimited-the-optional-adtag-sets-mtproto-telegram-sponsor-channel-none-clears-alternatively-send-externallinks-to-append-external-share-links-and-https-subscriptions-to-each-selected-client-in-one-transaction-this-mode-cannot-be-combined-with-other-adjustments-existing-entries-metadata-and-ordering-are-preserved-duplicates-match-kind-value-per-client-including-repeated-input-rows-the-first-entry-wins-missing-clients-are-not-written-and-appear-in-skipped-externallinksadded-counts-inserted-rows-externallinksskipped-counts-duplicate-rows-across-found-clients-externallinkserrors-counts-missing-clients-and-adjusted-counts-clients-receiving-at-least-one-new-row-validation-or-database-failure-aborts-the-whole-append-without-writes-repeating-an-append-is-idempotent-and-does-not-restart-xray
|
||||
- content: For node-backed changes, the result can include obj.nodeResults and
|
||||
obj.nodePending alongside the bulk counts and per-email results. A
|
||||
direct acknowledgment with downstream work pending still allows the
|
||||
batch to continue.
|
||||
heading: enable-many-clients-in-one-call-emails-are-grouped-by-inbound-and-applied-with-a-single-read-modify-write-per-inbound-the-running-xray-local-or-remote-node-is-updated-to-add-each-user-note-that-enabling-a-client-whose-quota-is-exhausted-or-whose-expiry-has-passed-only-flips-the-flag--the-traffic-loop-will-disable-it-again-on-the-next-tick-returns-the-changed-count-and-per-email-skip-reasons
|
||||
- content: For node-backed changes, the result can include obj.nodeResults and
|
||||
obj.nodePending alongside the bulk counts and per-email results. A
|
||||
direct acknowledgment with downstream work pending still allows the
|
||||
batch to continue.
|
||||
heading: disable-many-clients-in-one-call-emails-are-grouped-by-inbound-and-applied-with-a-single-read-modify-write-per-inbound-the-running-xray-local-or-remote-node-is-updated-to-remove-each-user-returns-the-changed-count-and-per-email-skip-reasons
|
||||
- content: For node-backed changes, the result can include obj.nodeResults and
|
||||
obj.nodePending alongside the bulk counts and per-email results. A
|
||||
direct acknowledgment with downstream work pending still allows the
|
||||
batch to continue.
|
||||
heading: delete-many-clients-in-one-call-the-server-processes-the-list-sequentially-so-each-delete-sees-the-committed-state-of-the-previous-one--avoids-the-race-the-per-email-fan-out-had-on-the-panel-side-pass-keeptraffictrue-to-retain-the-xray_client_traffic-rows-after-deletion
|
||||
- content: For node-backed changes, the result can include obj.nodeResults and
|
||||
obj.nodePending alongside the bulk counts and per-email results. A
|
||||
direct acknowledgment with downstream work pending still allows the
|
||||
batch to continue.
|
||||
heading: create-many-clients-in-one-call-body-is-a-json-array-of-client-inboundids-payloads--the-same-shape-add-accepts-items-are-processed-sequentially-per-email-skip-reasons-are-returned-for-items-that-fail-eg-duplicate-email-triggers-a-single-xray-restart-at-the-end-if-any-inbound-was-running
|
||||
- content: For node-backed changes, the result can include obj.nodeResults and
|
||||
obj.nodePending alongside the bulk counts and per-email results. A
|
||||
direct acknowledgment with downstream work pending still allows the
|
||||
batch to continue.
|
||||
heading: attach-many-existing-clients-to-many-inbounds-in-one-call-each-client-keeps-its-identity-emailuuidpasswordsubid-and-a-shared-traffic-row-all-clients-are-added-to-a-target-inbound-in-a-single-addinboundclient-call-clients-already-present-on-a-target-are-reported-under-skipped-explicit-email-requests-return-per-email-lists-alternatively-submit-selection-with-explicit-clientids-or-a-frozen-allmatching-scopetoken-plus-excludedclientids-and-the-search-and-group-it-was-frozen-under-scoped-requests-start-a-background-job-and-return-jobid-poll-get-bulkattachid-for-counts-or-a-stale-selection-error-newer-ids-stay-outside-the-frozen-scope-changes-to-the-frozen-membership-are-rejected-before-applying-changes-triggers-a-single-xray-restart-if-any-target-inbound-was-running
|
||||
- content: For node-backed changes, the result can include obj.nodeResults and
|
||||
obj.nodePending alongside the bulk counts and per-email results. A
|
||||
direct acknowledgment with downstream work pending still allows the
|
||||
batch to continue.
|
||||
heading: mirror-of-bulkattach-detach-many-existing-clients-from-many-inbounds-in-one-call-for-each-email-intersects-the-clients-current-inbounds-with-the-requested-set-and-detaches-from-those-only-email-inbound-pairs-where-the-client-is-not-currently-attached-are-silently-no-ops-emails-not-attached-to-any-of-the-requested-inbounds-are-reported-under-skipped-client-records-are-kept-even-if-they-become-orphaned--use-bulkdel-for-full-removal-returns-per-email-detachedskippederrors-lists-and-triggers-a-single-xray-restart-if-any-target-inbound-was-running
|
||||
---
|
||||
|
||||
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
|
||||
|
||||
+535
-48
@@ -2114,6 +2114,16 @@
|
||||
],
|
||||
"nullable": true
|
||||
},
|
||||
"nodePending": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"nodeResults": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"skipped": {
|
||||
"example": [],
|
||||
"items": {
|
||||
@@ -2127,6 +2137,170 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"BulkAttachResult": {
|
||||
"description": "BulkAttachResult reports the outcome of a bulk attach across target inbounds.",
|
||||
"properties": {
|
||||
"attached": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"errors": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"nodePending": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"nodeResults": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"skipped": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"attached",
|
||||
"errors",
|
||||
"skipped"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"BulkCreateReport": {
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"reason": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"email",
|
||||
"reason"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"BulkCreateResult": {
|
||||
"description": "BulkCreateResult mirrors BulkAdjustResult for the create flow.",
|
||||
"properties": {
|
||||
"created": {
|
||||
"type": "integer"
|
||||
},
|
||||
"nodePending": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"nodeResults": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"skipped": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/BulkCreateReport"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"created"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"BulkDeleteReport": {
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"reason": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"email",
|
||||
"reason"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"BulkDeleteResult": {
|
||||
"description": "BulkDeleteResult mirrors BulkAdjustResult: total deleted plus per-email\nskip reasons when an email could not be processed.",
|
||||
"properties": {
|
||||
"deleted": {
|
||||
"type": "integer"
|
||||
},
|
||||
"nodePending": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"nodeResults": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"skipped": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/BulkDeleteReport"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"deleted"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"BulkDetachResult": {
|
||||
"description": "BulkDetachResult reports the outcome of a bulk detach across target inbounds.",
|
||||
"properties": {
|
||||
"detached": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"errors": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"nodePending": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"nodeResults": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"skipped": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"detached",
|
||||
"errors",
|
||||
"skipped"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"BulkExternalLinksResult": {
|
||||
"properties": {
|
||||
"added": {
|
||||
@@ -2149,6 +2323,48 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"BulkSetEnableReport": {
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"reason": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"email",
|
||||
"reason"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"BulkSetEnableResult": {
|
||||
"properties": {
|
||||
"changed": {
|
||||
"type": "integer"
|
||||
},
|
||||
"nodePending": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"nodeResults": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"skipped": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/BulkSetEnableReport"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"changed"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"Client": {
|
||||
"description": "Client represents a client configuration for Xray inbounds with traffic limits and settings.",
|
||||
"properties": {
|
||||
@@ -2419,6 +2635,42 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ClientNodeApplyOutcome": {
|
||||
"properties": {
|
||||
"nodeId": {
|
||||
"example": 7,
|
||||
"type": "integer"
|
||||
},
|
||||
"reason": {
|
||||
"example": "timeout",
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"example": "pending",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"nodeId",
|
||||
"status"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ClientNodeApplyResponse": {
|
||||
"properties": {
|
||||
"nodePending": {
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"nodeResults": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ClientNodeApplyOutcome"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"ClientNodeUsage": {
|
||||
"description": "ClientNodeUsage is one node's counters for a client since its last reset.",
|
||||
"properties": {
|
||||
@@ -10552,7 +10804,7 @@
|
||||
],
|
||||
"summary": "Create a new client and attach it to one or more inbounds in a single call. Body is JSON. Per-protocol secrets are generated server-side when omitted, so callers can send only the universal fields.",
|
||||
"operationId": "post_panel_api_clients_add",
|
||||
"description": "Client email must not be exactly `.` or `..`. Existing reserved-name clients can be read, renamed to a valid name, or deleted using the query-parameter /get, /update and /del aliases. Fields the server fills in when they are omitted — a valid value sent by the caller is never overwritten. Re-adding an email that already exists, with its stored `subId`, reuses the stored `id`, `password`, `auth` and `secret` instead of minting new ones, so the identity stays in sync across its inbounds.\n\n- **VLESS / VMess** — `id`, a fresh UUID\n- **Trojan** — `password`\n- **Shadowsocks** — `password`. On a `2022-blake3-*` inbound a supplied password that does not base64-decode to the key length of the cipher (16 or 32 bytes) is replaced by a generated key and the call still succeeds, so read the client back if you did not let the server pick. Legacy ciphers keep any non-empty password\n- **Hysteria** — `auth`\n- **mtproto** — `secret`, a FakeTLS secret derived from the fronting domain of the inbound, or from `www.cloudflare.com` when it has none\n- **WireGuard** — `privateKey` and `publicKey` when both are blank, or `publicKey` alone when only a `privateKey` was sent, plus `allowedIPs`: one free `/32` taken from the /24 the existing peers of that inbound already sit in, or from `10.0.0.0/24` when it has none\n\nAccepted on the same body but never generated: `preSharedKey` and `keepAlive` (WireGuard), `adTag` (mtproto).\n\nWireGuard is the only one of these that can fail. Allocation widens the search to the containing /16 before giving up with `inbound <id>: wireguard: no free address available in <scope>`, and an `allowedIPs` supplied by the caller is validated instead of allocated: `inbound <id>: wireguard: allowedIPs entry <entry> overlaps <address> used by another client` when its range overlaps an address or prefix a different client of that same inbound holds, or `... used by a client on <inbound>` when the holder sits on another WireGuard or AmneziaWG inbound. Ranges are compared, not strings, so `10.0.0.9/24` collides with `10.0.0.5/32`; a `/0` entry collides with every address of its family another client holds, and only a `0.0.0.0/0` or `::/0` default route that is already stored (legacy peers) keeps nobody out. Allocation likewise skips every address inside a prefix another client holds. The same validation runs on POST /panel/api/clients/{email}/attach, where a client that already carries an address brings it along.\n\nAn `inboundIds` entry that names no existing inbound rejects the whole call before anything is written. Past that, the inbounds are applied concurrently and independently: one that fails no longer stops the others, so a `success:false` response can still have created the client on the rest. Every error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. `limitHwid` is applied only when every inbound succeeded, so re-run the call after fixing the failure.",
|
||||
"description": "Client email must not be exactly `.` or `..`. Existing reserved-name clients can be read, renamed to a valid name, or deleted using the query-parameter /get, /update and /del aliases. Fields the server fills in when they are omitted — a valid value sent by the caller is never overwritten. Re-adding an email that already exists, with its stored `subId`, reuses the stored `id`, `password`, `auth` and `secret` instead of minting new ones, so the identity stays in sync across its inbounds.\n\n- **VLESS / VMess** — `id`, a fresh UUID\n- **Trojan** — `password`\n- **Shadowsocks** — `password`. On a `2022-blake3-*` inbound a supplied password that does not base64-decode to the key length of the cipher (16 or 32 bytes) is replaced by a generated key and the call still succeeds, so read the client back if you did not let the server pick. Legacy ciphers keep any non-empty password\n- **Hysteria** — `auth`\n- **mtproto** — `secret`, a FakeTLS secret derived from the fronting domain of the inbound, or from `www.cloudflare.com` when it has none\n- **WireGuard** — `privateKey` and `publicKey` when both are blank, or `publicKey` alone when only a `privateKey` was sent, plus `allowedIPs`: one free `/32` taken from the /24 the existing peers of that inbound already sit in, or from `10.0.0.0/24` when it has none\n\nAccepted on the same body but never generated: `preSharedKey` and `keepAlive` (WireGuard), `adTag` (mtproto).\n\nWireGuard is the only one of these that can fail. Allocation widens the search to the containing /16 before giving up with `inbound <id>: wireguard: no free address available in <scope>`, and an `allowedIPs` supplied by the caller is validated instead of allocated: `inbound <id>: wireguard: allowedIPs entry <entry> overlaps <address> used by another client` when its range overlaps an address or prefix a different client of that same inbound holds, or `... used by a client on <inbound>` when the holder sits on another WireGuard or AmneziaWG inbound. Ranges are compared, not strings, so `10.0.0.9/24` collides with `10.0.0.5/32`; a `/0` entry collides with every address of its family another client holds, and only a `0.0.0.0/0` or `::/0` default route that is already stored (legacy peers) keeps nobody out. Allocation likewise skips every address inside a prefix another client holds. The same validation runs on POST /panel/api/clients/{email}/attach, where a client that already carries an address brings it along.\n\nAn `inboundIds` entry that names no existing inbound rejects the whole call before anything is written. Past that, the inbounds are applied concurrently and independently: one that fails no longer stops the others, so a `success:false` response can still have created the client on the rest. Every error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. `limitHwid` is applied only when every inbound succeeded, so re-run the call after fixing the failure.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@@ -10609,12 +10861,34 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ClientNodeApplyResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"nullable": true,
|
||||
"enum": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"msg": "Client added"
|
||||
"obj": {
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10720,7 +10994,7 @@
|
||||
],
|
||||
"summary": "Update an existing client by email. Changes propagate to every attached inbound. Body is the JSON client payload: omitted fields keep their current values, and an explicit zero, empty or null value clears a field, except as noted below.",
|
||||
"operationId": "post_panel_api_clients_update_email",
|
||||
"description": "An omitted `flow` leaves every attached inbound on its own flow. Send `\"reverse\": null` to remove the reverse tag. Credentials (`id`, `password`, `auth`, `secret`, `subId`) and WireGuard/AmneziaWG `allowedIPs` are never cleared: an empty value keeps the stored one. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have applied the edit to the remaining inbounds. The client record is written after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the inbound edits in place.",
|
||||
"description": "An omitted `flow` leaves every attached inbound on its own flow. Send `\"reverse\": null` to remove the reverse tag. Credentials (`id`, `password`, `auth`, `secret`, `subId`) and WireGuard/AmneziaWG `allowedIPs` are never cleared: an empty value keeps the stored one. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have applied the edit to the remaining inbounds. The client record is written after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the inbound edits in place.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "email",
|
||||
@@ -10764,12 +11038,34 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ClientNodeApplyResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"nullable": true,
|
||||
"enum": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"msg": "Client updated"
|
||||
"obj": {
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10784,7 +11080,7 @@
|
||||
],
|
||||
"summary": "Update an existing client by email. Changes propagate to every attached inbound. Body is the JSON client payload: omitted fields keep their current values, and an explicit zero, empty or null value clears a field, except as noted below.",
|
||||
"operationId": "post_panel_api_clients_update",
|
||||
"description": "Query-parameter alias for the path endpoint. Use email=. or email=.. to manage legacy reserved names without URL dot-segment normalization. An omitted `flow` leaves every attached inbound on its own flow. Send `\"reverse\": null` to remove the reverse tag. Credentials (`id`, `password`, `auth`, `secret`, `subId`) and WireGuard/AmneziaWG `allowedIPs` are never cleared: an empty value keeps the stored one. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have applied the edit to the remaining inbounds. The client record is written after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the inbound edits in place.",
|
||||
"description": "Query-parameter alias for the path endpoint. Use email=. or email=.. to manage legacy reserved names without URL dot-segment normalization. An omitted `flow` leaves every attached inbound on its own flow. Send `\"reverse\": null` to remove the reverse tag. Credentials (`id`, `password`, `auth`, `secret`, `subId`) and WireGuard/AmneziaWG `allowedIPs` are never cleared: an empty value keeps the stored one. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have applied the edit to the remaining inbounds. The client record is written after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the inbound edits in place.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "email",
|
||||
@@ -10828,12 +11124,34 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ClientNodeApplyResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"nullable": true,
|
||||
"enum": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"msg": "Client updated"
|
||||
"obj": {
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10848,7 +11166,7 @@
|
||||
],
|
||||
"summary": "Delete a client by email. Removes it from every attached inbound and drops its traffic record unless keepTraffic=1 is passed.",
|
||||
"operationId": "post_panel_api_clients_del_email",
|
||||
"description": "The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have removed the client from the remaining inbounds; the client record is kept in that case, so re-running the call retries exactly the leftovers. The record and traffic rows are dropped after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the client already removed from every inbound.",
|
||||
"description": "The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have removed the client from the remaining inbounds; the client record is kept in that case, so re-running the call retries exactly the leftovers. The record and traffic rows are dropped after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the client already removed from every inbound.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "email",
|
||||
@@ -10883,12 +11201,34 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ClientNodeApplyResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"nullable": true,
|
||||
"enum": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"msg": "Client deleted"
|
||||
"obj": {
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10903,7 +11243,7 @@
|
||||
],
|
||||
"summary": "Delete a client by email. Removes it from every attached inbound and drops its traffic record unless keepTraffic=1 is passed.",
|
||||
"operationId": "post_panel_api_clients_del",
|
||||
"description": "Query-parameter alias for the path endpoint. Use email=. or email=.. to manage legacy reserved names without URL dot-segment normalization. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have removed the client from the remaining inbounds; the client record is kept in that case, so re-running the call retries exactly the leftovers. The record and traffic rows are dropped after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the client already removed from every inbound.",
|
||||
"description": "Query-parameter alias for the path endpoint. Use email=. or email=.. to manage legacy reserved names without URL dot-segment normalization. The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have removed the client from the remaining inbounds; the client record is kept in that case, so re-running the call retries exactly the leftovers. The record and traffic rows are dropped after the inbounds, so a failure there is reported without an `inbound <id>:` prefix and leaves the client already removed from every inbound.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "email",
|
||||
@@ -10938,12 +11278,34 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ClientNodeApplyResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"nullable": true,
|
||||
"enum": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"msg": "Client deleted"
|
||||
"obj": {
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10958,7 +11320,7 @@
|
||||
],
|
||||
"summary": "Attach an existing client to one or more additional inbounds. Body is JSON.",
|
||||
"operationId": "post_panel_api_clients_email_attach",
|
||||
"description": "A WireGuard client brings its stored `allowedIPs` into the new inbound instead of being given a fresh address, so the call fails with `inbound <id>: wireguard: allowedIPs entry <entry> overlaps <address> used by another client` when its range overlaps an address or prefix a different client of the target inbound holds. Free the address on that inbound first — see POST /panel/api/clients/add for the full rule. Inbounds are applied independently, so the remaining ones are still attached and a `success:false` response can be partial.",
|
||||
"description": "A WireGuard client brings its stored `allowedIPs` into the new inbound instead of being given a fresh address, so the call fails with `inbound <id>: wireguard: allowedIPs entry <entry> overlaps <address> used by another client` when its range overlaps an address or prefix a different client of the target inbound holds. Free the address on that inbound first — see POST /panel/api/clients/add for the full rule. Inbounds are applied independently, so the remaining ones are still attached and a `success:false` response can be partial.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "email",
|
||||
@@ -11012,11 +11374,34 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ClientNodeApplyResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"nullable": true,
|
||||
"enum": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true
|
||||
"success": true,
|
||||
"obj": {
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11031,7 +11416,7 @@
|
||||
],
|
||||
"summary": "Detach a client from one or more inbounds without deleting the client.",
|
||||
"operationId": "post_panel_api_clients_email_detach",
|
||||
"description": "The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have detached the remaining inbounds. Detach writes nothing beyond the inbounds, so every error carries the prefix.",
|
||||
"description": "The inbounds are applied concurrently and independently: one that fails no longer stops the others. Every inbound error names the inbound it came from (`inbound 7: <message>`), and several failures are reported together, one per line. So a `success:false` response can still have detached the remaining inbounds. Detach writes nothing beyond the inbounds, so every error carries the prefix.\n\nFor node-backed inbounds, `obj.nodeResults` reports each affected node. `applied` means the direct peer acknowledged the change with no reported downstream work, `pending` means a locally saved change still needs reconciliation, and `failed` means a local inbound write failed. For several inbounds on one node, the least complete result is reported. `obj.nodePending` is true when any local change still needs reconciliation. The outer `success` continues to report local save success. `obj` is null when no node result is available.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "email",
|
||||
@@ -11084,11 +11469,34 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ClientNodeApplyResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"nullable": true,
|
||||
"enum": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true
|
||||
"success": true,
|
||||
"obj": {
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11862,6 +12270,7 @@
|
||||
],
|
||||
"summary": "Shift expiry and/or traffic quota for many clients in one call. addDays/addBytes may be negative. Clients with unlimited expiry (expiryTime=0) or unlimited traffic (totalGB=0) are skipped for the corresponding field — bulk extend never converts unlimited to limited. A client that was auto-disabled solely because it was depleted (expired or over quota) is automatically re-enabled — locally and on its node — when the adjustment lifts it out of depletion; a manually-disabled or still-depleted client is left disabled. The optional flow directive sets the XTLS flow on every client: \"none\" clears it, \"xtls-rprx-vision\"/\"xtls-rprx-vision-udp443\" set it where the inbound supports it (omit or \"\" to leave it unchanged). The optional limitHwid sets maximum registered devices (0 = unlimited). The optional adTag sets MTProto Telegram sponsor channel (\"none\" clears). Alternatively, send externalLinks to append external share links and http(s) subscriptions to each selected client in one transaction. This mode cannot be combined with other adjustments. Existing entries, metadata, and ordering are preserved. Duplicates match (kind, value) per client, including repeated input rows; the first entry wins. Missing clients are not written and appear in skipped. externalLinks.added counts inserted rows, externalLinks.skipped counts duplicate rows across found clients, externalLinks.errors counts missing clients, and adjusted counts clients receiving at least one new row. Validation or database failure aborts the whole append without writes. Repeating an append is idempotent and does not restart Xray.",
|
||||
"operationId": "post_panel_api_clients_bulkAdjust",
|
||||
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@@ -11953,6 +12362,14 @@
|
||||
"obj": {
|
||||
"adjusted": 2,
|
||||
"externalLinks": null,
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
],
|
||||
"skipped": []
|
||||
}
|
||||
}
|
||||
@@ -11969,6 +12386,7 @@
|
||||
],
|
||||
"summary": "Enable many clients in one call. Emails are grouped by inbound and applied with a single read-modify-write per inbound; the running Xray (local or remote node) is updated to add each user. Note that enabling a client whose quota is exhausted or whose expiry has passed only flips the flag — the traffic loop will disable it again on the next tick. Returns the changed count and per-email skip reasons.",
|
||||
"operationId": "post_panel_api_clients_bulkEnable",
|
||||
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@@ -11999,17 +12417,27 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"$ref": "#/components/schemas/BulkSetEnableResult"
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"obj": {
|
||||
"changed": 2,
|
||||
"changed": 0,
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
],
|
||||
"skipped": [
|
||||
{
|
||||
"email": "carol",
|
||||
"reason": "client not found"
|
||||
"email": "",
|
||||
"reason": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -12027,6 +12455,7 @@
|
||||
],
|
||||
"summary": "Disable many clients in one call. Emails are grouped by inbound and applied with a single read-modify-write per inbound; the running Xray (local or remote node) is updated to remove each user. Returns the changed count and per-email skip reasons.",
|
||||
"operationId": "post_panel_api_clients_bulkDisable",
|
||||
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@@ -12057,17 +12486,27 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"$ref": "#/components/schemas/BulkSetEnableResult"
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"obj": {
|
||||
"changed": 2,
|
||||
"changed": 0,
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
],
|
||||
"skipped": [
|
||||
{
|
||||
"email": "carol",
|
||||
"reason": "client not found"
|
||||
"email": "",
|
||||
"reason": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -12085,6 +12524,7 @@
|
||||
],
|
||||
"summary": "Delete many clients in one call. The server processes the list sequentially so each delete sees the committed state of the previous one — avoids the race the per-email fan-out had on the panel side. Pass keepTraffic=true to retain the xray_client_traffic rows after deletion.",
|
||||
"operationId": "post_panel_api_clients_bulkDel",
|
||||
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@@ -12116,17 +12556,27 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"$ref": "#/components/schemas/BulkDeleteResult"
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"obj": {
|
||||
"deleted": 2,
|
||||
"deleted": 0,
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
],
|
||||
"skipped": [
|
||||
{
|
||||
"email": "carol",
|
||||
"reason": "client not found"
|
||||
"email": "",
|
||||
"reason": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -12144,6 +12594,7 @@
|
||||
],
|
||||
"summary": "Create many clients in one call. Body is a JSON array of {client, inboundIds} payloads — the same shape /add accepts. Items are processed sequentially; per-email skip reasons are returned for items that fail (e.g., duplicate email). Triggers a single Xray restart at the end if any inbound was running.",
|
||||
"operationId": "post_panel_api_clients_bulkCreate",
|
||||
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@@ -12195,17 +12646,27 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"$ref": "#/components/schemas/BulkCreateResult"
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"obj": {
|
||||
"created": 2,
|
||||
"created": 0,
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
],
|
||||
"skipped": [
|
||||
{
|
||||
"email": "alice@example.com",
|
||||
"reason": "email already in use"
|
||||
"email": "",
|
||||
"reason": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -12328,6 +12789,7 @@
|
||||
],
|
||||
"summary": "Attach many existing clients to many inbounds in one call. Each client keeps its identity (email/UUID/password/subId) and a shared traffic row; all clients are added to a target inbound in a single AddInboundClient call. Clients already present on a target are reported under skipped. Explicit email requests return per-email lists. Alternatively submit selection with explicit clientIds or a frozen allMatching scopeToken plus excludedClientIds and the search and group it was frozen under. Scoped requests start a background job and return {jobId}. Poll GET /bulkAttach/:id for counts or a stale-selection error. Newer IDs stay outside the frozen scope. Changes to the frozen membership are rejected before applying changes. Triggers a single Xray restart if any target inbound was running.",
|
||||
"operationId": "post_panel_api_clients_bulkAttach",
|
||||
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@@ -12385,20 +12847,31 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"$ref": "#/components/schemas/BulkAttachResult"
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"obj": {
|
||||
"attached": [
|
||||
"alice",
|
||||
"bob"
|
||||
""
|
||||
],
|
||||
"errors": [
|
||||
""
|
||||
],
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
],
|
||||
"skipped": [
|
||||
"bob"
|
||||
],
|
||||
"errors": []
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12466,6 +12939,7 @@
|
||||
],
|
||||
"summary": "Mirror of bulkAttach: detach many existing clients from many inbounds in one call. For each email, intersects the client's current inbounds with the requested set and detaches from those only; (email, inbound) pairs where the client is not currently attached are silently no-ops. Emails not attached to any of the requested inbounds are reported under skipped. Client records are kept even if they become orphaned — use bulkDel for full removal. Returns per-email detached/skipped/errors lists and triggers a single Xray restart if any target inbound was running.",
|
||||
"operationId": "post_panel_api_clients_bulkDetach",
|
||||
"description": "For node-backed changes, the result can include obj.nodeResults and obj.nodePending alongside the bulk counts and per-email results. A direct acknowledgment with downstream work pending still allows the batch to continue.",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@@ -12520,18 +12994,31 @@
|
||||
"msg": {
|
||||
"type": "string"
|
||||
},
|
||||
"obj": {}
|
||||
"obj": {
|
||||
"$ref": "#/components/schemas/BulkDetachResult"
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"success": true,
|
||||
"obj": {
|
||||
"detached": [
|
||||
"alice",
|
||||
"bob"
|
||||
""
|
||||
],
|
||||
"skipped": [],
|
||||
"errors": []
|
||||
"errors": [
|
||||
""
|
||||
],
|
||||
"nodePending": true,
|
||||
"nodeResults": [
|
||||
{
|
||||
"nodeId": 7,
|
||||
"reason": "timeout",
|
||||
"status": "pending"
|
||||
}
|
||||
],
|
||||
"skipped": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user