mirror of
https://github.com/beclab/Olares
synced 2026-05-24 09:18:23 +00:00
docs: add Set system environment variables in settings (#2004)
This commit is contained in:
commit
80947af962
14 changed files with 133 additions and 1 deletions
|
|
@ -296,6 +296,10 @@ const side = {
|
|||
text: "Customize app domains",
|
||||
link: "/manual/olares/settings/custom-app-domain",
|
||||
},
|
||||
{
|
||||
text: "Manage app variables",
|
||||
link: "/manual/olares/settings/manage-app-env",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -294,6 +294,10 @@ const side = {
|
|||
"text": "自定义应用域名",
|
||||
"link": "/zh/manual/olares/settings/custom-app-domain",
|
||||
},
|
||||
{
|
||||
text: "管理应用环境变量",
|
||||
link: "/zh/manual/olares/settings/manage-app-env",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -111,6 +111,17 @@ To install a custom application:
|
|||
|
||||
You can view all installed custom applications under the **My Olares** > **Upload** tab.
|
||||
|
||||
### Setting environment variables
|
||||
|
||||
During app installation, if an environment variable is required for the app but it either has no default value or its referenced system variable is unset, Market will display a settings pop-up:
|
||||
|
||||

|
||||
|
||||
* **Custom variables**: Enter the value directly in the installation pop-up.
|
||||
* **Referenced system variables**: You must first go to the **Settings > Developer > System Environment Variables** page to set the value for the corresponding variable.
|
||||
|
||||
After completing the environment variable setup, you can continue the installation.
|
||||
|
||||
## Update applications
|
||||
To update an application from Market:
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ The **Developer** page in Olares **Settings** is designed for developers and adv
|
|||
* **Repository Management**
|
||||
* **Image Management**
|
||||
* **Export System Logs**
|
||||
* **Set System Environment Variables**
|
||||
|
||||
## Repository management
|
||||
|
||||
|
|
@ -60,4 +61,28 @@ Logs record the operational status of various system components. When troublesho
|
|||
4. Right-click the generated log file and select **Download** to save it to your local machine.
|
||||
|
||||
{width=70%}
|
||||
Once downloaded, you can attach the log file to a GitHub feedback post and share it with the Olares team to help them locate the issue faster.
|
||||
Once downloaded, you can attach the log file to a GitHub feedback post and share it with the Olares team to help them locate the issue faster.
|
||||
|
||||
## Set system environment variables
|
||||
|
||||
Starting from Olares version 1.12.2, Olares supports system environment variables declared by applications. This allows users to configure common settings for applications at the system level, eliminating the need to modify each application individually. Typical categories are:
|
||||
|
||||
- User information, for example, `OLARES_USER_USERNAME`.
|
||||
- SMTP services, for example, `OLARES_USER_SMTP_PORT`.
|
||||
- Image/proxy settings, for example, `OLARES_SYSTEM_CDN_SERVICE`.
|
||||
- Third-party service API-KEYs, for example, `OLARES_USER_CUSTOM_OPENAI_APIKEY`, and `OLARES_USER_HUGGINGFACE_TOKEN`.
|
||||
|
||||
:::tip Note
|
||||
- You cannot add or delete system environment variables, nor can you modify their attributes.
|
||||
- When installing and activating Olares, the system automatically sets some environment variables based on your Olares ID to ensure optimal performance and connectivity.
|
||||
:::
|
||||
|
||||
To manually adjust system environment variables, follow these steps:
|
||||
|
||||

|
||||
|
||||
1. From the Olares desktop, navigate to **Settings > Developer > System Environment Variables**.
|
||||
2. Find the variable you want to modify in the list.
|
||||
3. Click the <i class="material-symbols-outlined">edit_square</i> icon and enter the variable's value in the pop-up dialog. Variables that are grayed out cannot be modified.
|
||||
4. Click **Confirm** to save your changes.
|
||||
|
||||
|
|
|
|||
28
docs/manual/olares/settings/manage-app-env.md
Normal file
28
docs/manual/olares/settings/manage-app-env.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
outline: [2, 3]
|
||||
description: Learn how to manage application environment variables in Olares
|
||||
---
|
||||
|
||||
# Manage application environment variables
|
||||
|
||||
Application environment variables are key parameters used to configure the runtime behavior and settings of an application container. They determine how the application runs, which services it connects to, and what user credentials it uses.
|
||||
|
||||
To view or modify an application's environment variables:
|
||||
|
||||
1. Navigate to **Settings** > **Application**,
|
||||
2. Select the target application.
|
||||
3. Enter the **Manage environment variables** page.
|
||||
|
||||

|
||||
|
||||
## Application environment variable types
|
||||
|
||||
| Environment Variable Type | Description | Edit Permissions |
|
||||
|:----------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------|
|
||||
| **Referenced system environment variables** | References system environment <br/>variables (e.g., **`OLARES_USER_USERNAME`**).<br/> When an application is declared to use <br/>system variables, you will see them here. | **Read-only**. You must navigate to **Settings > Developer > System Environment Variables** page to make modifications. |
|
||||
| **Application-specific variables** | Configuration variables that are specific to<br/> the application itself. | **Editable**. You can modify their values directly on this page without needing to edit YAML files in Control Hub. |
|
||||
|
||||
|
||||
## Learn more
|
||||
|
||||
[System environment variables](developer.md#set-system-environment-variables)
|
||||
BIN
docs/public/images/manual/olares/manage-app-env.jpeg
Normal file
BIN
docs/public/images/manual/olares/manage-app-env.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 714 KiB |
BIN
docs/public/images/manual/olares/manage-app-env.png
Normal file
BIN
docs/public/images/manual/olares/manage-app-env.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 281 KiB |
BIN
docs/public/images/manual/olares/set-app-env-var.jpeg
Normal file
BIN
docs/public/images/manual/olares/set-app-env-var.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
BIN
docs/public/images/manual/olares/set-app-env-var.png
Normal file
BIN
docs/public/images/manual/olares/set-app-env-var.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 MiB |
BIN
docs/public/images/manual/olares/sys-env-var.png
Normal file
BIN
docs/public/images/manual/olares/sys-env-var.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
BIN
docs/public/images/zh/manual/olares/sys-env-var-cn.png
Normal file
BIN
docs/public/images/zh/manual/olares/sys-env-var-cn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
|
|
@ -101,6 +101,17 @@ Olares **应用市场**提供多种方式发现和浏览应用:
|
|||
|
||||
你可以在**上传**页签查看并管理所有本地自定义应用。
|
||||
|
||||
### 环境变量设置
|
||||
|
||||
在应用安装过程中,如果某个环境变量是应用运行必需的,且该变量无默认值或引用的系统变量尚未设置,应用市场会弹出设置提醒窗口:
|
||||

|
||||
|
||||
* **自定义变量**:您可以直接在安装弹窗中输入值。
|
||||
* **引用的系统变量**:您需要先前往 **设置 > 开发者 > 系统环境变量** 页面设置相应变量值。
|
||||
|
||||
完成设置后可点击继续安装。
|
||||
|
||||
|
||||
## 更新应用
|
||||
从应用市场下载的应用可按以下步骤获取更新:
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ description: 了解如何利用开发者页面管理仓库、查看系统镜像
|
|||
* **仓库管理**
|
||||
* **镜像管理**
|
||||
* **日志导出**
|
||||
* **系统环境变量管理**
|
||||
|
||||
## 仓库管理
|
||||
|
||||
|
|
@ -57,3 +58,28 @@ description: 了解如何利用开发者页面管理仓库、查看系统镜像
|
|||
|
||||
{width=70%}
|
||||
下载后,可在 GitHub 反馈帖中附加日志文件,与 Olares 团队共享以加速问题定位。
|
||||
|
||||
## 设置系统环境变量
|
||||
|
||||
从 Olares 1.12.2 版本开始,Olares 支持应用程序声明使用系统环境变量。这允许用户为应用配置通用设置,而无需单独修改每个应用。典型系统环境变量类别包括:
|
||||
|
||||
- 用户信息,例如 `OLARES_USER_USERNAME`。
|
||||
- SMTP 服务,例如 `OLARES_USER_SMTP_PORT`。
|
||||
- 镜像/代理设置,例如 `OLARES_SYSTEM_CDN_SERVICE`。
|
||||
- 第三方服务 API-KEY,例如 `OLARES_USER_CUSTOM_OPENAI_APIKEY` 和 `OLARES_USER_HUGGINGFACE_TOKEN`。
|
||||
|
||||
:::tip 说明
|
||||
- 系统环境变量不支持新增或删除,也无法修改其属性。
|
||||
- 安装和激活 Olares 时,系统会根据您的 Olares ID 自动设置部分环境变量,以确保最优的性能和连接体验。
|
||||
:::
|
||||
|
||||
要手动调整系统环境变量,请按以下步骤操作:
|
||||
|
||||
1. 从 Olares 桌面进入**设置 > 开发者 > 系统环境变量**。
|
||||
|
||||
2. 在列表中找到你要修改的变量。
|
||||
|
||||
3. 点击<i class="material-symbols-outlined">edit_square</i>图标,在弹出对话框中输入变量值。置灰的变量不可修改。
|
||||
|
||||
4. 点击**确认**保存更改。
|
||||

|
||||
23
docs/zh/manual/olares/settings/manage-app-env.md
Normal file
23
docs/zh/manual/olares/settings/manage-app-env.md
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
outline: [2, 3]
|
||||
description: 了解如何在 Olares 中管理应用环境变量
|
||||
---
|
||||
|
||||
# 管理应用环境变量
|
||||
|
||||
应用环境变量是为应用容器配置运行时行为和设置的关键参数,决定了应用程序如何运行、连接到哪些服务,以及使用哪些用户凭证等。
|
||||
|
||||
你可以在**设置** > **应用** 下选取具体应用,并进入**管理环境变量**页面查看或修改环境变量。
|
||||

|
||||
|
||||
## 应用环境变量类型
|
||||
|
||||
| 环境变量类型 | 说明 | 操作权限 |
|
||||
|:--------------|:---------------------------------------------------------------------|:------------------------------------------|
|
||||
| **引用的系统环境变量** | 引用自系统级别的全局环境变量(如<br/> **`OLARES_USER_USERNAME`**)。当应用声明<br/>使用系统变量时,你将在此处看到它们。 | **只读**。你必须前往 **设置 > 开发者 > 系统环境变量**页面进行修改。 |
|
||||
| **应用私有环境变量** | 应用自身的配置变量。 | **可编辑**。用户可以直接在此处修改,无需通过控制面板编辑 YAML 文件。 |
|
||||
|
||||
|
||||
## 了解更多
|
||||
|
||||
- [系统环境变量](developer.md#设置系统环境变量)
|
||||
Loading…
Reference in a new issue