2023-04-01 08:20:39 -07:00
# Environment Variables
2021-05-26 19:05:53 +08:00
2023-04-01 08:20:39 -07:00
Xray provides the following environment variables for modifying some of its underlying configurations.
2021-05-26 19:05:53 +08:00
2023-04-01 08:20:39 -07:00
## Xray Asset Location
2021-05-26 19:05:53 +08:00
2023-04-01 08:20:39 -07:00
- Name: `xray.location.asset` or `XRAY_LOCATION_ASSET` 。
- Default value: specified [FHS ](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard ) directory or the same path as the Xray file.
2021-05-26 19:05:53 +08:00
2023-04-01 08:20:39 -07:00
This environment variable specifies a folder location that should contain the `geoip.dat` and `geosite.dat` files. If no variable value is specified, the program will search for resource files in the following order:
2023-03-04 11:39:44 -05:00
```
./
/usr/local/share/xray
/usr/share/xray
```
2021-05-26 19:05:53 +08:00
2023-04-01 08:20:39 -07:00
## Configuration File Location
2021-05-26 19:05:53 +08:00
2023-04-01 08:20:39 -07:00
- Name: `xray.location.config` or `XRAY_LOCATION_CONFIG` 。
- Default value: Same path as the Xray file.
2021-05-26 19:05:53 +08:00
2023-04-01 08:20:39 -07:00
This environment variable specifies a folder location that should contain the `config.json` file.
2021-05-26 19:05:53 +08:00
2023-04-01 08:20:39 -07:00
## Multiple Configuration Directories
2021-05-26 19:05:53 +08:00
2023-04-01 08:20:39 -07:00
- Name: `xray.location.confdir` or `XRAY_LOCATION_CONFDIR` 。
- Default value: `""` 。
2021-05-26 19:05:53 +08:00
2023-04-01 08:20:39 -07:00
The `.json` files in this directory will be read in alphabetical order by filename and used as options for multiple configurations.