Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): supports cli argument and environment variables to set config #269

Merged
merged 4 commits into from
Jun 23, 2021

Conversation

NewFuture
Copy link
Owner

@NewFuture NewFuture commented Jun 14, 2021

配置可通过 命令行参数或者环境变量 #220 传递

优先级

命令行参数 > 配置文件 > 环境变量

参数

命令行 : --key
环境变量(DDNS 前缀): ${DDNS_KEY} (或者全小写)

详情

ddns [-h] [-v] [-c CONFIG] [--dns {alidns,cloudflare,dnscom,dnspod,dnspod_com,he,huaweidns,callback}] [--id ID] [--token TOKEN] [--ipv4 [IPV4 [IPV4 ...]]] [--ipv6 [IPV6 [IPV6 ...]]] [--index4 INDEX4] [--index6 INDEX6]
              [--ttl TTL] [--proxy [PROXY [PROXY ...]]] [--debug [DEBUG]] [--cache [CACHE]]

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -c CONFIG, --config CONFIG
                        run with config file [配置文件路径]
  --dns {alidns,cloudflare,dnscom,dnspod,dnspod_com,he,huaweidns,callback}
                        DNS Provider [DNS服务提供商]
  --id ID               api ID [授权账户]
  --token TOKEN         api token or Secret key [授权访问凭证或密钥]
  --ipv4 [IPV4 [IPV4 ...]]
                        ipv4 domain list [IPV4域名列表]
  --ipv6 [IPV6 [IPV6 ...]]
                        ipv6 domain list [IPV6域名列表]
  --index4 INDEX4       the way to get ipv4 [IPV4 获取方式]
  --index6 INDEX6       the way to get ipv6 [IPV6获取方式]
  --ttl TTL             ttl for DNS [DNS 解析 TTL 时间]
  --proxy [PROXY [PROXY ...]]
                        https proxy [设置http 代理,多代理逐个尝试直到成功]
  --debug [DEBUG]       debug mode [是否开启调试,默认否]
  --cache [CACHE]       eusing cache [是否缓存记录,默认是]

@NewFuture NewFuture changed the title feat(config): cli argument supports to set config feat(config): supports cli argument and environment variables to set config Jun 14, 2021
@NewFuture NewFuture merged commit 35ee01f into master Jun 23, 2021
@NewFuture NewFuture deleted the feat-cli-config branch June 23, 2021 02:36
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.

1 participant