mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-02 03:05:02 +03:00
fix(nodetoken): stop refusing every node-token key file on Windows
FileKeySource rejected any key file whose mode had group or other bits, but Windows has no such bits: Stat reports every writable file as 0666. On the Windows builds release.yml ships, the key file therefore never loaded, not even one written 0600, and only XUI_NODE_TOKEN_KEY could supply a key. The mode check now applies off Windows only, the stance the DB permission tests already take; there the file's NTFS ACL guards it, and env-vars.mdx says so in all four locales. The load test is split so the half that must hold everywhere, an owner-only file loading, also runs on Windows, and the rejection half asserts the exact error instead of any error.
This commit is contained in:
@@ -42,7 +42,7 @@ icon: Variable
|
||||
| Variable | Default | Description |
|
||||
| ------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `NODE_TOKEN_ENCRYPTION` | `off` | `off`، `migration` (خواندن هم متن ساده و هم متن رمزشده را میپذیرد، نوشتن همیشه رمز میکند) یا `required` (نوشتن یکسان، اما بدون کلید اجرا شکست میخورد). به نبودِ پیشوند `XUI_` توجه کنید. |
|
||||
| `XUI_NODE_TOKEN_KEY_FILE` | `/etc/x-ui/node_token_key.json` | حلقهکلید JSON با دسترسی `0600` یا محدودتر. نخست همین بارگذاری میشود. |
|
||||
| `XUI_NODE_TOKEN_KEY_FILE` | `/etc/x-ui/node_token_key.json` | حلقهکلید JSON با دسترسی `0600` یا محدودتر (در ویندوز بررسی نمیشود و مجوزهای NTFS از آن محافظت میکنند). نخست همین بارگذاری میشود. |
|
||||
| `XUI_NODE_TOKEN_KEY` | — | یک کلید ۳۲ بایتی base64 که فقط هنگام شکست بارگذاری فایل کلید خوانده میشود. شناسهی کلید آن ثابت و برابر `env` است، پس امکان چرخش ندارد. |
|
||||
|
||||
فایل کلید، کلید فعال بههمراه هر کلید قدیمیای را که هنوز برای رمزگشایی لازم است نام میبرد:
|
||||
|
||||
Reference in New Issue
Block a user