Skip to content

Document root env configuration#874

Merged
Fangliding merged 9 commits into
XTLS:mainfrom
OneXray:codex/add-env-config-docs
Jul 10, 2026
Merged

Document root env configuration#874
Fangliding merged 9 commits into
XTLS:mainfrom
OneXray:codex/add-env-config-docs

Conversation

@yiguodev

@yiguodev yiguodev commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Document the root-level env object in Chinese, English, and Russian.
  • List supported runtime env keys and preload-only env keys.
  • Add env to the root configuration overview pages.

Validation

  • pnpm docs:build
  • git diff --check

@yiguodev yiguodev marked this pull request as ready for review July 4, 2026 05:34
Copilot AI review requested due to automatic review settings July 4, 2026 05:34

Copilot AI 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.

Pull request overview

This PR expands the configuration documentation to cover the root-level env object across Chinese, English, and Russian docs, and links it from the root configuration overview pages.

Changes:

  • Added "env": {} to the root configuration JSON examples in CN/EN/RU overview pages.
  • Added env to the “Basic/Basics configuration modules” lists in CN/EN/RU index pages with a short description.
  • Expanded the CN/EN/RU env feature pages to document the root env object (supported keys, string value requirement, and priority/restrictions).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/ru/config/index.md Adds env to the RU root config example and module list.
docs/ru/config/features/env.md Documents RU root-level env object, supported keys, and precedence/restrictions.
docs/en/config/index.md Adds env to the EN root config example and module list.
docs/en/config/features/env.md Documents EN root-level env object, supported keys, and precedence/restrictions.
docs/config/index.md Adds env to the ZH root config example and module list.
docs/config/features/env.md Documents ZH root-level env object, supported keys, and precedence/restrictions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/en/config/index.md Outdated
Comment thread docs/config/index.md Outdated
@yiguodev

Copy link
Copy Markdown
Contributor Author

@RPRX 改好了。

@RPRX

RPRX commented Jul 10, 2026

Copy link
Copy Markdown
Member

文档只保留大写的那种吧(虽然代码仍兼容小写),对环境变量的介绍分为三段,3+2+N,对于 N 像之前一样简单列一下即可

@Fangliding @Meo597 然后你俩看下没问题就合了吧,不用等发版

@yiguodev

Copy link
Copy Markdown
Contributor Author

已调整。

@Fangliding Fangliding merged commit 63d932f into XTLS:main Jul 10, 2026
4 checks passed
@RPRX

RPRX commented Jul 10, 2026

Copy link
Copy Markdown
Member

看文档发现两个问题,一是应该叫“环境变量”而不是“环境配置”,不知道的还以为要配置环境,二是侧边栏“特性详解”跑下面了

@Meo597

Meo597 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

我来搞一下吧

Meo597 added a commit that referenced this pull request Jul 11, 2026
XTLS/Xray-core#6400

---------

Co-authored-by: yiguodev <147401898+yiguodev@users.noreply.github.com>
Meo597 added a commit that referenced this pull request Jul 11, 2026
XTLS/Xray-core#6400

Co-authored-by: yiguodev <147401898+yiguodev@users.noreply.github.com>
@Meo597

Meo597 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

好了 93302d5

@RPRX

RPRX commented Jul 11, 2026

Copy link
Copy Markdown
Member

@Meo597 #874 (comment)

@Fangliding

Copy link
Copy Markdown
Member

本来正文已经写好了怎么修格式还把正文改了

@Meo597

Meo597 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

以前莫名引入了一个 根 env 的概念云里雾里的,我看到下意识认为是不是还能继续套娃
还大篇幅写了 env 生效时机,但用户不可能去硬翻代码
以及进程和实例的概念,xray 应该没法一个进程跑多个实例吧现在

也没讲怎么用 shell 设环境变量,现在既然提到了 conf 必须通过它就应该讲一下

所以我直接重做了这一页

@RPRX

RPRX commented Jul 11, 2026

Copy link
Copy Markdown
Member

这下听得我云里雾里的

总之至少文档别保留小写

Meo597 added a commit that referenced this pull request Jul 11, 2026
XTLS/Xray-core#6400

Co-authored-by: yiguodev <147401898+yiguodev@users.noreply.github.com>
@Meo597

Meo597 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

可能跟他那个 PR 最开始的实现方式有关系
一开始不是 os.SetEnv 因此一个进程内的多个实例是各自独立的
文档有了这个概念又没完全解释清楚

不提小写
3+2+n 顺序调了
加了几个 go 的 env

改好了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants