diff --git a/README.md b/README.md index 3aa24fe04f4f5e872276d41ba98f67e0c50cd8c1..8f453f9c946d0b4219678330f8eff50de4400056 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ | [8 初始化数据库后端](zh/8.md) | [@ImPerat0R\_](https://github.com/tssujt) | | [9 使用操作器](zh/9.md) | [@ImPerat0R\_](https://github.com/tssujt) | | [10 管理连接](zh/10.md) | [@ImPerat0R\_](https://github.com/tssujt) | -| [11 保护连接](zh/11.md) | | +| [11 保护连接](zh/11.md) | [@ImPerat0R\_](https://github.com/tssujt) | | [12 写日志](zh/12.md) | | | [13 用Celery扩大规模](zh/13.md) | | | [14 用Dask扩展](zh/14.md) | | diff --git a/zh/11.md b/zh/11.md index 160c0f55ba9d11c591577807c88b329858a26be7..6e4b72bdb81009a2840bbfef3199bd23d6076f27 100644 --- a/zh/11.md +++ b/zh/11.md @@ -1,26 +1,24 @@ # 保护连接 -默认情况下,Airflow将在元数据数据库中以纯文本格式保存连接的密码。 在安装过程中强烈建议使用`crypto`包。 `crypto`包确实要求您的操作系统安装了libffi-dev。 +默认情况下,Airflow在元数据数据库中是以纯文本格式保存连接的密码。在安装过程中强烈建议使用`crypto`包。`crypto`包要求您的操作系统安装了libffi-dev。 如果最初未安装`crypto`软件包,您仍可以通过以下步骤为连接启用加密: -1. 安装crypto包`pip install apache-airflow[crypto]` -2. 使用下面的代码片段生成fernet_key。 fernet_key必须是base64编码的32字节密钥。 +1. 安装crypto包`pip install apache-airflow[crypto]` +2. 使用下面的代码片段生成fernet_key。 fernet_key必须是base64编码的32字节密钥。 ``` - from cryptography.fernet import Fernet -fernet_key = Fernet . generate_key () -print ( fernet_key . decode ()) # your fernet_key, keep it in secured place! - +from cryptography.fernet import Fernet +fernet_key= Fernet.generate_key() +print(fernet_key.decode()) # 你的fernet_key,把它放在安全的地方 ``` -3.将`airflow.cfg` fernet_key值替换为步骤2中的值。或者,可以将fernet_key存储在OS环境变量中。 在这种情况下,您不需要更改`airflow.cfg` ,因为Airflow将使用环境变量而不是`airflow.cfg`中的值: +3.将`airflow.cfg`中的fernet_key值替换为步骤2中的值。或者,可以将fernet_key存储在OS环境变量中。在这种情况下,您不需要更改`airflow.cfg`,因为Airflow将使用环境变量而不是`airflow.cfg`中的值: ``` - # Note the double underscores -EXPORT AIRFLOW__CORE__FERNET_KEY = your_fernet_key - +# 注意双下划线 +export AIRFLOW__CORE__FERNET_KEY=your_fernet_key ``` -1. 重启Airflow网络服务器。 -2. 对于现有连接(在安装`airflow[crypto]`和创建Fernet密钥之前已定义的连接),您需要在连接管理UI中打开每个连接,重新键入密码并保存。 \ No newline at end of file +1. 重启Airflow网络服务器。 +2. 对于现有连接(在安装`airflow[crypto]`和创建Fernet密钥之前已定义的连接),您需要在连接管理UI中打开每个连接,重新键入密码并保存。