Skip to content

feat(xray): Add Xray 26.7.11 FinalMask xmc settings to hosts/inbound/subscription (UI too). Add sessionID compatibility + add 2 new fields: sessionIDTable + sessionIDLength (and the corresponding UI). - #671

Merged
ImMohammad20000 merged 28 commits into
PasarGuard:devfrom
FunLay123:merge/xhttp_sessionid-into-dev
Jul 26, 2026

Conversation

@FunLay123

@FunLay123 FunLay123 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR depends on PasarGuard/xray-config-kit#1 being merged and published to npm first. Do not merge this PR before that happens — dashboard/package.json currently points at a personal fork (@funlay/*-beta) for testing only. After xray-config-kit is merged, the maintainers should update core-kit, publish the official packages, and repoint dashboard/package.json from the temporary fork back to the official @pasarguard/* packages before merging this PR.

This branch adds Xray 26.6.22+ sessionID compatibility across backend, subscriptions, and the dashboard, and makes the editor/version checks depend on the node's actual Xray version.

  • Preserve and expose last-known xray_version/node_version data for nodes, and expose xray_version on GET /api/core/{id} so the dashboard can make version-aware decisions
  • Handle the XHTTP sessionPlacement/sessionKey -> sessionIDPlacement/sessionIDKey rename across backend config parsing, subscription generation, node upgrade flow, and automatic stored-config migration when a sole node crosses the 26.6.22 threshold
  • Add sessionIDTable / sessionIDLength controls to the Hosts UI, including locale strings
  • Make core-editor generation, validation, field visibility, and warnings version-aware via coreXrayVersion, including echForceQuery gating and the allowInsecure hard-error warning
  • Add XHTTP sessionIDTable/sessionIDLength room-size validation across the Hosts form, inbound dialog, and raw-JSON persist validation

Dependency Note

dashboard/package.json currently uses a temporary testing dependency: @pasarguard/core-kit is aliased to npm:@funlay/core-kit-beta@0.3.0-beta.1, and that build resolves @pasarguard/xray-config-kit to npm:@funlay/xray-config-kit-beta@0.4.0-beta.1 in dashboard/bun.lock. Before merge, both must be repointed to the official published @pasarguard/* packages, please.

Checked

  • Frontend: bun run test passes (19/19), and typecheck is clean for all touched frontend files
  • Backend: uv run pytest tests/api/test_node.py tests/test_subscription_clash_xhttp.py -v is green for the sessionID / xray_version coverage in this branch
  • The existing test_get_nodes_simple_* failures (KeyError: 'access_token') are pre-existing on dev, not introduced here
  • No new Alembic migration is required: xray_version / node_version columns already exist on dev
  • Locale files for en / ru / fa / zh are syntactically valid and include the new coreEditor.inbound.xhttp.* keys
  • Live UI behavior for echForceQuery / allowInsecure gates on nodes with different Xray versions
  • Room-size validation in all three entry points: Hosts form, inbound dialog, and raw JSON
  • A real node upgrade path across the 26.6.22 boundary to confirm the sessionID migration flow end-to-end

Summary by CodeRabbit

  • New Features

    • Added XHTTP session ID table and session ID length settings to host configuration, including preset/custom table selection.
    • Added “xmc” TCP final-mask type with hostname, usernames, and password fields.
    • Added localized UI labels/placeholders for the new XHTTP session settings.
  • Bug Fixes

    • Updated Xray config generation to consistently emit sessionID* fields (and prefer sessionIDPlacement/sessionIDKey).
    • Improved transport net selection fallback and tightened session ID validation.
    • Ensured session table/length fields are populated across relevant subscription/inbound paths.
  • Tests

    • Added coverage to verify Xray always uses sessionID* keys for XHTTP.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

XHTTP session ID table and length settings are added across backend models, Xray transport serialization, dashboard forms, host editing, inbound editor controls, localization, and regression tests. TCP final-mask configuration also gains an XMC variant with dashboard editing support.

Changes

XHTTP Session Configuration

Layer / File(s) Summary
Backend contracts and transport flow
app/models/..., app/core/..., app/subscription/...
Adds validated session fields, propagates inbound settings, serializes sessionID* keys, and supports legacy parsing fallbacks.
Dashboard session controls
dashboard/src/features/..., dashboard/src/service/api/index.ts, dashboard/public/statics/locales/*, dashboard/package.json
Adds API and form types, validation, host persistence, preset/custom controls, editor synchronization, translations, and dependency aliases.
Serialization regression coverage
tests/test_subscription_clash_xhttp.py
Verifies generated Xray extras use sessionID* keys and exclude legacy session keys.

XMC TCP Final Mask

Layer / File(s) Summary
XMC contracts
app/models/host.py, dashboard/src/service/api/index.ts
Adds the xmc discriminator, settings model, unions, dispatch mapping, and generated API types.
XMC editor controls
dashboard/src/features/hosts/components/finalmask-settings.tsx, dashboard/src/features/core-editor/components/shared/xray-stream-finalmask-editor.tsx
Adds xmc selection, initializes its settings, and renders hostname, password, and usernames fields.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant HostEditor
  participant HostForm
  participant XHTTPTransport
  participant XrayConfig
  HostEditor->>HostForm: set session ID table and length
  HostForm->>XHTTPTransport: submit validated XHTTP settings
  XHTTPTransport->>XrayConfig: emit sessionID fields
  XrayConfig->>XrayConfig: parse sessionID keys or legacy fallbacks
Loading

Possibly related PRs

Suggested labels: enhancement, Backend

Poem

I’m a rabbit with settings to share,
Session IDs hop through the air.
XMC layers join the flight,
Tables and lengths fit just right,
New keys sparkle in dashboard light.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately covers the main additions: XMC FinalMask support, sessionID compatibility, and the new sessionIDTable/sessionIDLength UI.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@M03ED

M03ED commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

First this version of xray is still pre release and there is no warranty this be the same in stable version.
Your migrating the user core without he's permission in backend and this is being forced, this is forbidden, user should have full access over data.
Also your code Check the node xray version from db, how you can prevent people from using same core on multiple versions of xray across the nodes ?

FunLay123 added 4 commits July 3, 2026 22:23
…se core versions

- Remove migrate_core_xhttp_session_keys_if_sole_node() and its call site in
  update_node_status(): the panel was silently rewriting an admin's stored
  Xray core JSON (sessionPlacement/sessionKey -> sessionIDPlacement/
  sessionIDKey) as soon as any node reported Xray >= 26.6.22, with no
  confirmation. This is redundant on top of the per-push rename already
  done in NodeOperation.connect_node (which translates a deep copy at the
  moment config is sent to a node, based on that node's own version) and
  the dual-name read fallback in XRayConfig/subscription builders, so
  removing it costs no functionality while no longer touching admin data
  behind their back.
- update-core-modal.tsx: warn when the selected/entered core version is a
  pre-release or numerically above the latest stable release, separate
  from the existing sessionID breaking-change warning.
…nt Xray versions

node-modal.tsx: when selecting a Core Config, fetch the other nodes already
using it (useGetNodes({ core_id })) and show a muted, non-blocking hint if
their reported Xray versions differ — that core is pushed to every node
unmodified except for the handful of fields the panel already translates
per node version, so anything else version-specific can behave differently
across them. Kept as a warning rather than a hard block, consistent with
not forcing changes on the admin's data.
get_xray_version_by_core_id previously picked an unordered .limit(1) row
when a core config is shared by multiple nodes, so the core-editor's
version-aware gating (e.g. Session ID Table/Length visibility) could pin
to an arbitrary sibling node's version instead of the one actually being
configured. Now it picks the highest reported version among all nodes on
that core, so the editor never hides a capability a real node on the core
actually supports; the admin is separately warned elsewhere when nodes on
a shared core report different versions.
…op redundant block

- Restyle the pre-release-version warning to match the removed
  breaking-change warning's amber styling instead of blue, so there's one
  consistent look instead of two stacked warnings when both applied.
- Drop the breaking-change warning's own UI block; the version-threshold
  check it was built on (isBreaking) stays, since the backend still
  requires `confirm: true` when actually crossing the sessionID-rename
  boundary — only the now-redundant dedicated banner is gone.
- Fix an unclear ru translation ("боевых нодах" → "продакшен-нодах").
@FunLay123

Copy link
Copy Markdown
Contributor Author

@M03ED
Thanks for the feedback — addressed all three points.

  1. Pre-release version

Added a non-blocking warning when the selected/entered version is a pre-release (or above current latest stable). It also covers the 26.6.22 sessionID-rename crossing — that used to be its own separate banner, but since practically every version past 26.4.13 is pre-release anyway, showing two stacked warnings for the same underlying situation was redundant, so I folded it into this one.

This isn't just caution — it has a real use case. Xray-core's e10347bf (v26.6.22) added SessionIDTable/SessionIDLength, the only way to stop XHTTP from putting a UUID in the request path — which a growing number of CDNs in Russia now filter on (and a lot of people were begging Xray-core's developers to merge that feature). I checked the officially published @pasarguard/xray-config-kit@0.3.4 (what dev actually depends on) directly: it doesn't know these fields exist at all — silently drops them in permissive mode, refuses to compile in strict mode, and its parity data doesn't go past v26.5.3. So today, on upstream, this isn't just untested — it's unreachable through the panel regardless of the node's actual Xray version. That's the concrete reason to track a version this new.

  1. Forced core migration

Removed migrate_core_xhttp_session_keys_if_sole_node() entirely — it silently rewrote the admin's stored core config in the DB. The DB is never touched without an explicit admin action now.

What's left is a transient, non-persisted rename (rename_xhttp_session_keys in NodeOperation.connect_node) applied only to the copy pushed to a given node, never written back to the DB. Same pattern the codebase already uses for Xray-core's earlier splithttp → xhttp rename (app/subscription/clash.py). Without it, an admin's configured sessionPlacement/sessionKey would silently stop applying once a node crosses 26.6.22. That said, I'm not attached to it — happy to just remove it too if you'd rather the panel not touch the outgoing config at all.

  1. Same core across multiple Xray versions

No hard block, but the node editor now warns when a Core Config is shared with nodes reporting a different Xray version.

checkSessionIdRoomSize() and its three call sites (Hosts form, inbound
editor, profile-level persist check) previously skipped validation
whenever either sessionIDTable or sessionIDLength was missing, treating
it as "nothing to check yet". That's only true in one direction: Xray-core
only runs this check when sessionIDTable is set at all (infra/conf/
transport_internet.go gates the whole block on `c.SessionIDTable != ""`),
but once a table is set there's no default for sessionIDLength — an
unset or invalid length hits the same Build()-time error as a too-small
range. A table configured without a length now gets flagged instead of
silently saving a config Xray would refuse to start.
@FunLay123

Copy link
Copy Markdown
Contributor Author

Is it okay now? Or something needs to be changed/fixed?

@FunLay123
FunLay123 marked this pull request as draft July 4, 2026 13:18
@FunLay123
FunLay123 marked this pull request as ready for review July 4, 2026 17:38
@M03ED

M03ED commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

this is all extra stuff, all you should add is a extraction from core file and placing them in client configuration (at most adding them to host if it make sense), core should not be dependent on node, node is dependent to core.
handling differences between xray versions is on user not us

@FunLay123

Copy link
Copy Markdown
Contributor Author

okay, got it. Give me some time to adapt that

@FunLay123
FunLay123 marked this pull request as draft July 8, 2026 14:44
@FunLay123
FunLay123 force-pushed the merge/xhttp_sessionid-into-dev branch from cbc3418 to 62cb780 Compare July 11, 2026 10:12
@FunLay123
FunLay123 marked this pull request as ready for review July 11, 2026 10:29
@FunLay123

Copy link
Copy Markdown
Contributor Author

Done. only kept extraction of session_id_table/session_id_length into the client config (+ host override), plus the corresponding frontend UI (host modal fields, core-editor inbound fields) and API types/locales for those two fields. Everything else removed — no version branching in subscriptions, no Core→Node dependency.

@FunLay123 FunLay123 changed the title Add Xray 26.6.22+ sessionID compatibility across backend, subscriptions, and the dashboard, and makes the editor/version checks depend on the node's actual Xray version Add Xray 26.6.22+ sessionID compatibility + add 2 new fields: sessionIDTable + sessionIDLength Jul 11, 2026
@FunLay123 FunLay123 changed the title Add Xray 26.6.22+ sessionID compatibility + add 2 new fields: sessionIDTable + sessionIDLength Add Xray 26.6.22+ sessionID compatibility + add 2 new fields: sessionIDTable + sessionIDLength (and the corresponding UI) Jul 11, 2026
@FunLay123
FunLay123 marked this pull request as draft July 14, 2026 13:59
FunLay123 and others added 6 commits July 15, 2026 12:22
…-bugs

# Conflicts:
#	dashboard/bun.lock
#	dashboard/package.json
#	dashboard/src/service/api/index.ts
Adds a direct dependency override so the panel picks up the published
0.3.6 release instead of the beta version pulled in transitively via core-kit.
method, sessionIDPlacement/sessionIDKey and session_id_table were passing through empty strings as real values instead of falling back to defaults like the rest of the xhttp settings already do.
@FunLay123 FunLay123 changed the title Add Xray 26.6.22+ sessionID compatibility + add 2 new fields: sessionIDTable + sessionIDLength (and the corresponding UI) Add Xray 26.7.11 FinalMask xmc settings to hosts/inbound/subscription (UI too). Add sessionID compatibility + add 2 new fields: sessionIDTable + sessionIDLength (and the corresponding UI). Jul 16, 2026
@FunLay123
FunLay123 marked this pull request as ready for review July 16, 2026 21:28
@FunLay123

FunLay123 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Well, i guess it's ready.

⚠️ Now that PR depends on PasarGuard/xray-config-kit#2 being merged and published to npm first.

What was added/changed:

  • Fixed some bugs mentioned by the bot and discovered during the work
  • Added xmc finalmask tcp layer to hosts/inbound/subscription introduced in Xray 26.7.11

Btw checked xmc finalmask settings in the real case, works wonderful 😊

(Checked XHTTP config with sessionIDKey, sessionIDPlacement, sessionIDTable, sessionIDLength through Yandex CDN, works good)

@FunLay123

Copy link
Copy Markdown
Contributor Author

@ImMohammad20000 Thanks for merging PasarGuard/xray-config-kit#2! Could you please update Core-kit accordingly so I can change dependencies in my PR to actual Pasarguard packages?

@ImMohammad20000

Copy link
Copy Markdown
Contributor

@FunLay123 i will do it my self

@FunLay123

Copy link
Copy Markdown
Contributor Author

@FunLay123 i will do it my self

ah, okay

@FunLay123

Copy link
Copy Markdown
Contributor Author

@ImMohammad20000 Hey, checking in on this — looks like xray-config-kit is still at 0.3.5 on npm, while the repo is already at 0.3.6. Whenever you get a chance, could you run the publish for it? The same for core-kit on npm (tho core-kit still points at 0.3.5 version of xray-confjg-kit, so it needs to be updated in the repo firstly, then published). I can open a small PR in core-kit myself to bump its xray-config-kit dependency to 0.3.6, if that helps move things along.

@FunLay123

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/models/host.py (1)

40-40: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the regex validation patterns.

(:?...) is an optional literal colon, not a non-capturing group, so values such as :tlshello and :rand are accepted. The apply_to pattern is unanchored and can accept invalid strings containing ip, ipv4, or ipv6.

Proposed fix
-    packets: str = Field(pattern=r"^(:?tlshello|[\d-]{1,16})$")
+    packets: str = Field(pattern=r"^(?:tlshello|[\d-]{1,16})$")

-    type: str = Field(pattern=r"^$|^(:?rand|array|str|base64|hex)$")
+    type: str = Field(pattern=r"^(?:rand|array|str|base64|hex)?$")

-    apply_to: str = Field(default="ip", pattern=r"ip|ipv4|ipv6")
+    apply_to: str = Field(default="ip", pattern=r"^(?:ip|ipv4|ipv6)$")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/models/host.py` at line 40, Correct the regex validation patterns in the
model fields: update the packets pattern to use a proper non-capturing group so
only tlshello or the numeric range format is accepted without a leading colon,
and anchor the apply_to pattern at both ends so only complete valid values (ip,
ipv4, or ipv6) are accepted.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@dashboard/package.json`:
- Line 21: Replace the temporary npm alias in the dashboard package manifest so
`@pasarguard/xray-config-kit` resolves directly to the published official
`@pasarguard` package at version 0.3.6, rather than the `@funlay` package.

In `@dashboard/src/features/hosts/components/finalmask-settings.tsx`:
- Around line 823-824: Mask the XMC password inputs by adding password input
types at both affected sites:
dashboard/src/features/hosts/components/finalmask-settings.tsx lines 823-824 and
dashboard/src/features/core-editor/components/shared/xray-stream-finalmask-editor.tsx
lines 905-906. Update the matching XMC password fields in the surrounding editor
components, preserving their existing form bindings and styling.

---

Outside diff comments:
In `@app/models/host.py`:
- Line 40: Correct the regex validation patterns in the model fields: update the
packets pattern to use a proper non-capturing group so only tlshello or the
numeric range format is accepted without a leading colon, and anchor the
apply_to pattern at both ends so only complete valid values (ip, ipv4, or ipv6)
are accepted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0705e313-49c6-45c5-b05d-796ab00648d5

📥 Commits

Reviewing files that changed from the base of the PR and between 62cb780 and 7243ae3.

⛔ Files ignored due to path filters (1)
  • dashboard/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (16)
  • app/core/hosts.py
  • app/core/xray.py
  • app/models/host.py
  • app/models/subscription.py
  • dashboard/package.json
  • dashboard/public/statics/locales/en.json
  • dashboard/public/statics/locales/fa.json
  • dashboard/public/statics/locales/ru.json
  • dashboard/public/statics/locales/zh.json
  • dashboard/src/features/core-editor/components/shared/xray-stream-finalmask-editor.tsx
  • dashboard/src/features/core-editor/components/xray/xray-inbounds-section.tsx
  • dashboard/src/features/hosts/components/finalmask-settings.tsx
  • dashboard/src/features/hosts/components/hosts-list.tsx
  • dashboard/src/features/hosts/dialogs/host-modal.tsx
  • dashboard/src/features/hosts/forms/host-form.ts
  • dashboard/src/service/api/index.ts
🚧 Files skipped from review as they are similar to previous changes (9)
  • app/models/subscription.py
  • app/core/xray.py
  • dashboard/public/statics/locales/ru.json
  • dashboard/public/statics/locales/en.json
  • dashboard/src/features/hosts/dialogs/host-modal.tsx
  • dashboard/src/features/hosts/forms/host-form.ts
  • dashboard/public/statics/locales/zh.json
  • dashboard/public/statics/locales/fa.json
  • dashboard/src/features/core-editor/components/xray/xray-inbounds-section.tsx

Comment thread dashboard/package.json Outdated
Comment thread dashboard/src/features/hosts/components/finalmask-settings.tsx
@FunLay123

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot removed the Frontend label Jul 23, 2026
@FunLay123

Copy link
Copy Markdown
Contributor Author

@coderabbitai is that PR ready for merge? Except dependencies, I guess

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== PR state, reviews, and check rollup =='
gh pr view 671 --repo PasarGuard/panel \
  --json state,isDraft,mergeable,reviewDecision,statusCheckRollup,reviews,comments \
  --jq '{
    state, isDraft, mergeable, reviewDecision,
    checks: [.statusCheckRollup[]? | {name, status, conclusion, detailsUrl}],
    reviews: [.reviews[]? | {author: .author.login, state, submittedAt}],
    recentComments: [.comments[-10:][]? | {author: .author.login, body, createdAt}]
  }'

echo
echo '== Changed files =='
gh pr view 671 --repo PasarGuard/panel --json files \
  --jq '.files[].path'

echo
echo '== Relevant source outlines =='
for f in \
  app/core/hosts.py \
  app/core/xray.py \
  app/models/host.py \
  app/models/subscription.py \
  app/subscription/links.py \
  app/subscription/xray.py \
  tests/test_subscription_clash_xhttp.py \
  dashboard/src/features/hosts/forms/host-form.ts \
  dashboard/src/features/hosts/dialogs/host-modal.tsx \
  dashboard/src/features/core-editor/components/xray/xray-inbounds-section.tsx \
  dashboard/src/features/hosts/components/finalmask-settings.tsx \
  dashboard/src/features/core-editor/components/shared/xray-stream-finalmask-editor.tsx
do
  if [ -f "$f" ]; then
    echo "-- $f"
    ast-grep outline "$f" --items all --view compact 2>/dev/null || true
  fi
done

echo
echo '== Focused static consistency searches =='
rg -n -C 2 --glob '*.py' \
  'sessionID(Table|Length|Placement|Key)|session_(id_table|id_length|placement|key)|FinalMaskTcpType\.xmc|FinalMaskXmcSettings' \
  app tests || true

rg -n -C 2 --glob '*.{ts,tsx,json}' \
  'sessionId(Table|Length)|sessionid(table|length|placement|key)|session_id_(table|length)|FinalMaskXmcSettings|["'\'']xmc["'\'']' \
  dashboard/src dashboard/public/statics/locales || true

Length of output: 47449


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Failed Ruff job metadata =='
gh api repos/PasarGuard/panel/actions/jobs/89349573533 \
  --jq '{name, status, conclusion, started_at, completed_at, steps: [.steps[] | {name, status, conclusion, number}]}'

echo
echo '== Ruff failure diagnostics =='
gh run view 30049920083 --repo PasarGuard/panel --job 89349573533 --log-failed

Length of output: 209659


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base_sha=$(gh pr view 671 --repo PasarGuard/panel --json baseRefOid --jq .baseRefOid)
head_sha=$(gh pr view 671 --repo PasarGuard/panel --json headRefOid --jq .headRefOid)

echo "== Changed-line coverage for Ruff diagnostics =="
git diff --unified=0 "$base_sha" "$head_sha" -- \
  app/core/hosts.py \
  app/core/xray.py \
  app/models/host.py \
  app/subscription/links.py \
  app/subscription/xray.py \
  | awk '
    /^\+\+\+ / { file=$2; sub(/^b\//, "", file) }
    /^@@ / {
      if (match($0, /\+[0-9]+(,[0-9]+)?/)) {
        range=substr($0, RSTART+1, RLENGTH-1)
        split(range, parts, ",")
        start=parts[1]
        count=(length(parts)>1 ? parts[2] : 1)
        if (count == 0) next
        end=start+count-1
        print file ":" start "-" end
      }
    }'

echo
echo '== PR changes around potential Ruff diagnostics =='
git diff --unified=4 "$base_sha" "$head_sha" -- \
  app/core/hosts.py \
  app/core/xray.py \
  app/models/host.py \
  app/subscription/links.py \
  app/subscription/xray.py

Length of output: 10082


@FunLay123 Yes — apart from the package-release/dependency prerequisite, I don’t see a PR-specific blocker to merging #671.

What I verified:

  • The PR is mergeable and all functional checks passed:
    • Python and TypeScript analysis
    • CodeQL
    • SQLite, PostgreSQL, TimescaleDB, MySQL, and MariaDB tests
  • The new Session ID values are consistently connected through parsing, host overrides, subscription output, dashboard forms, API types, and locales.
  • The added focused test confirms Xray output uses sessionIDPlacement, sessionIDKey, sessionIDTable, and sessionIDLength, without emitting the legacy session key names.
  • XMC FinalMask support is present in backend models, generated API types, host UI, and core-editor UI.

The only red check is Ruff. It installs an unpinned latest Ruff (0.16.0) and reports a large repository-wide backlog. Its diagnostics in PR-touched files are not on lines changed by this PR, so this is pre-existing CI/configuration debt rather than a regression here. It may still need a maintainer override or a separate Ruff-baseline/config fix if branch protection requires green checks.

So the remaining merge prerequisites are:

  1. Publish/update the official @pasarguard/xray-config-kit and @pasarguard/core-kit packages.
  2. Replace the temporary npm alias dependencies and refresh dashboard/bun.lock.
  3. Handle the existing Ruff gate according to repository policy.

@ImMohammad20000 ImMohammad20000 changed the title Add Xray 26.7.11 FinalMask xmc settings to hosts/inbound/subscription (UI too). Add sessionID compatibility + add 2 new fields: sessionIDTable + sessionIDLength (and the corresponding UI). feat: Add Xray 26.7.11 FinalMask xmc settings to hosts/inbound/subscription (UI too). Add sessionID compatibility + add 2 new fields: sessionIDTable + sessionIDLength (and the corresponding UI). Jul 26, 2026
@ImMohammad20000 ImMohammad20000 changed the title feat: Add Xray 26.7.11 FinalMask xmc settings to hosts/inbound/subscription (UI too). Add sessionID compatibility + add 2 new fields: sessionIDTable + sessionIDLength (and the corresponding UI). feat(xray): Add Xray 26.7.11 FinalMask xmc settings to hosts/inbound/subscription (UI too). Add sessionID compatibility + add 2 new fields: sessionIDTable + sessionIDLength (and the corresponding UI). Jul 26, 2026
@ImMohammad20000
ImMohammad20000 merged commit 86688e4 into PasarGuard:dev Jul 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: PasarGuard generates sessionPlacement instead of sessionIdPlacement for XHTTP subscriptions

3 participants