远程管理pi.hole实例。

pyholecli的Python项目详细描述


说明

从任何地方控制圆孔安装。

  • 管理黑名单和白名单域名。
  • 为内部服务创建和删除自定义域。
  • 结束查询日志。
  • 远程查看计时表以获取实时统计数据。

安装

pip install pyholecli

设置

创建一个ssh密钥并作为根用户安装到pi hole安装中。 此密钥将用于远程连接到实例。

可以使用标准方法声明pyholecli要使用的ssh密钥。

ssh代理

eval`ssh-agent`
ssh-add ~/.ssh/keys/pi_hole

ssh_配置

# ~/.ssh/config
Host pi.hole
    User root
    IdentityFile ~/.ssh/keys/pi_hole

作为参数传递

pyholecli -i ~/.ssh/keys/pi_hole status

示例

获取有关特定命令的帮助。

pyholecli --help <command>

获取pi hole服务的状态。

pyholecli status
  [✓] DNS service is running
  [✓] Pi-hole blocking is Enabled

添加要由pi.hole解析的自定义主机名。

pyholecli hostname -h testing.local -i 192.168.1.100

删除多个自定义主机名。

pyholecli remove-hostnames -h redis.localhost -h psql.localhost

功能性

Usage: pyholecli [--core-opts] <subcommand> [--subcommand-opts] ...

Core options:

  --complete                        Print tab-completion candidates for given parse remainder.
  --hide=STRING                     Set default value of run()'s 'hide' kwarg.
  --prompt-for-login-password       Request an upfront SSH-auth password prompt.
  --prompt-for-passphrase           Request an upfront SSH key passphrase prompt.
  --prompt-for-sudo-password        Prompt user at start of session for the sudo.password config value.
  --write-pyc                       Enable creation of .pyc files.
  -d, --debug                       Enable debug output.
  -D INT, --list-depth=INT          When listing tasks, only show the first INT levels.
  -e, --echo                        Echo executed commands before running.
  -f STRING, --config=STRING        Runtime configuration file to use.
  -F STRING, --list-format=STRING   Change the display format used when listing tasks. Should be one of: flat (default), nested, json.
  -h [STRING], --help[=STRING]      Show core or per-task help and exit.
  -H STRING, --hosts=STRING         Comma-separated host name(s) to execute tasks against.
  -i, --identity                    Path to runtime SSH identity (key) file. May be given multiple times.
  -l [STRING], --list[=STRING]      List available tasks, optionally limited to a namespace.
  -p, --pty                         Use a pty when executing shell commands.
  -S STRING, --ssh-config=STRING    Path to runtime SSH config file.
  -V, --version                     Show version and exit.
  -w, --warn-only                   Warn, instead of failing, when shell commands fail.

Subcommands:

  blacklist                   Blacklist a given domain.
  blacklisted-domains         Get all of the custom blacklisted domains.
  chronometer                 Continually print the stats using the chronometer.
  disable                     Disable the pi.hole blacklist.
  enable                      Enable the pi.hole blacklist.
  hostname                    Add a custom hostname which the pi.hole will resolve to the given IP address.
  hostnames                   Print the custom hostnames defined by the pi.hole instance.
  query                       Query the pi.hole instance for a given FQDN.
  remove-blacklisted-domain   Remove a given custom blacklisted domain.
  remove-hostname             Remove a custom hostname.
  remove-whitelisted-domain   Remove a given whitelisted domain.
  remove-wildcard-blacklist   Remove a given wildcard blacklist.
  status                      Query the status of the pi.hole instance.
  tail                        Tail the pi.hole resolver log file.
  whitelist                   Whitelist a given domain.
  whitelisted-domains         Get all of the custom whitelisted domains.
  wildcard-blacklist          Blacklist a given domain and its subdomains.
  wildcard-blacklists         Print the wildcard blacklist.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
javajexcel包装文本问题   EclipseJavaEnum缩进超过左括号。如何让它看起来更正常?   java有办法包含Tomcat 6 catalina。out和localhost。在网络应用的日志文件中记录内容?   java如何永久性地阻止JavaFX代码在eclipse中被突出显示为错误?   如何在java中优化两个for循环(for循环中的for循环)   java如何在我的windows机器上从jar文件创建mac osx的可执行文件   使用记忆化/动态规划的Java组合学   Java中的游荡对象垃圾收集   java为什么我在JSP和JDBC和MySQL中遇到连接失败错误   java轮询Pod的就绪状态   如何创建电子邮件并将其发送到Java中的特定地址?   java如何修复Dagger 2错误“。。。无法提供[…]”?   java Android单选按钮看起来太轻   Android Studio:开发在应用程序之间共享的通用java库