configuration.lua 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. -- Copyright 2021 Florian Eckert <fe@dev.tdt.de>
  2. -- Licensed to the public under the Apache License 2.0.
  3. local m, s, o
  4. m = Map("dockerd",
  5. translate("Docker - Configuration"),
  6. translate("DockerMan is a simple docker manager client for LuCI"))
  7. s = m:section(NamedSection, "globals", "section", translate("Global settings"))
  8. o = s:option(Flag, "remote_endpoint",
  9. translate("Remote Endpoint"),
  10. translate("Connect to remote endpoint"))
  11. o.rmempty = false
  12. o = s:option(Value, "remote_host",
  13. translate("Remote Host"),
  14. translate("Host or IP Address for the connection to a remote docker instance"))
  15. o.datatype = "host"
  16. o.rmempty = false
  17. o.optional = false
  18. o.placeholder = "10.1.1.2"
  19. o:depends("remote_endpoint", 1)
  20. o = s:option(Value, "remote_port",
  21. translate("Remote Port"))
  22. o.placeholder = "2375"
  23. o.datatype = "port"
  24. o.rmempty = false
  25. o.optional = false
  26. o:depends("remote_endpoint", 1)
  27. if nixio.fs.access("/usr/bin/dockerd") then
  28. o = s:option(Value, "data_root",
  29. translate("Docker Root Dir"))
  30. o.placeholder = "/opt/docker/"
  31. o:depends("remote_endpoint", 0)
  32. o = s:option(Value, "bip",
  33. translate("Default bridge"),
  34. translate("Configure the default bridge network"))
  35. o.placeholder = "172.17.0.1/16"
  36. o.datatype = "ipaddr"
  37. o:depends("remote_endpoint", 0)
  38. o = s:option(DynamicList, "registry_mirrors",
  39. translate("Registry Mirrors"),
  40. translate("It replaces the daemon registry mirrors with a new set of registry mirrors"))
  41. o.placeholder = translate("Example: https://hub-mirror.c.163.com")
  42. o:depends("remote_endpoint", 0)
  43. o = s:option(ListValue, "log_level",
  44. translate("Log Level"),
  45. translate('Set the logging level'))
  46. o:value("debug", translate("Debug"))
  47. o:value("", translate("Info")) -- This is the default debug level from the deamon is optin is not set
  48. o:value("warn", translate("Warning"))
  49. o:value("error", translate("Error"))
  50. o:value("fatal", translate("Fatal"))
  51. o.rmempty = true
  52. o:depends("remote_endpoint", 0)
  53. o = s:option(DynamicList, "hosts",
  54. translate("Client connection"),
  55. translate('Specifies where the Docker daemon will listen for client connections (default: unix:///var/run/docker.sock)'))
  56. o.placeholder = translate("Example: tcp://0.0.0.0:2375")
  57. o.rmempty = true
  58. o:depends("remote_endpoint", 0)
  59. end
  60. return m