lager-cli 0.32.3__tar.gz → 0.32.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. {lager_cli-0.32.3/lager_cli.egg-info → lager_cli-0.32.4}/PKG-INFO +1 -1
  2. {lager_cli-0.32.3 → lager_cli-0.32.4}/__init__.py +1 -1
  3. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/uninstall.py +8 -3
  4. {lager_cli-0.32.3 → lager_cli-0.32.4}/deployment/scripts/setup_and_deploy_box.sh +19 -15
  5. {lager_cli-0.32.3 → lager_cli-0.32.4}/gateway_auth.py +60 -12
  6. {lager_cli-0.32.3 → lager_cli-0.32.4/lager_cli.egg-info}/PKG-INFO +1 -1
  7. {lager_cli-0.32.3 → lager_cli-0.32.4}/LICENSE +0 -0
  8. {lager_cli-0.32.3 → lager_cli-0.32.4}/MANIFEST.in +0 -0
  9. {lager_cli-0.32.3 → lager_cli-0.32.4}/README.md +0 -0
  10. {lager_cli-0.32.3 → lager_cli-0.32.4}/__main__.py +0 -0
  11. {lager_cli-0.32.3 → lager_cli-0.32.4}/address_utils.py +0 -0
  12. {lager_cli-0.32.3 → lager_cli-0.32.4}/battery/__init__.py +0 -0
  13. {lager_cli-0.32.3 → lager_cli-0.32.4}/battery/battery_tui.py +0 -0
  14. {lager_cli-0.32.3 → lager_cli-0.32.4}/battery/websocket_client.py +0 -0
  15. {lager_cli-0.32.3 → lager_cli-0.32.4}/box_storage.py +0 -0
  16. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/__init__.py +0 -0
  17. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/__init__.py +0 -0
  18. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/_host_ops.py +0 -0
  19. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/_mount_prep.py +0 -0
  20. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/_pip_validation.py +0 -0
  21. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/_shim_verbs.py +0 -0
  22. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/_ssh.py +0 -0
  23. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/box_group.py +0 -0
  24. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/boxes.py +0 -0
  25. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/config.py +0 -0
  26. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/diagnose.py +0 -0
  27. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/dut.py +0 -0
  28. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/hello.py +0 -0
  29. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/instruments.py +0 -0
  30. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/labjack_pins.py +0 -0
  31. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/lock.py +0 -0
  32. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/net_tui.py +0 -0
  33. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/nets.py +0 -0
  34. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/ssh.py +0 -0
  35. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/box/ssh_setup.py +0 -0
  36. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/communication/__init__.py +0 -0
  37. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/communication/ble.py +0 -0
  38. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/communication/blufi.py +0 -0
  39. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/communication/i2c.py +0 -0
  40. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/communication/router.py +0 -0
  41. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/communication/spi.py +0 -0
  42. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/communication/uart.py +0 -0
  43. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/communication/usb.py +0 -0
  44. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/communication/websocket_client.py +0 -0
  45. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/communication/wifi.py +0 -0
  46. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/__init__.py +0 -0
  47. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/arm.py +0 -0
  48. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/debug/__init__.py +0 -0
  49. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/debug/commands.py +0 -0
  50. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/debug/gdb.py +0 -0
  51. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/debug/net_cache.py +0 -0
  52. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/debug/service_client.py +0 -0
  53. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/debug/service_helper.py +0 -0
  54. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/debug/tunnel.py +0 -0
  55. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/devenv.py +0 -0
  56. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/development/python.py +0 -0
  57. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/measurement/__init__.py +0 -0
  58. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/measurement/adc.py +0 -0
  59. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/measurement/dac.py +0 -0
  60. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/measurement/energy.py +0 -0
  61. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/measurement/gpi.py +0 -0
  62. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/measurement/gpo.py +0 -0
  63. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/measurement/logic.py +0 -0
  64. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/measurement/scope.py +0 -0
  65. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/measurement/thermocouple.py +0 -0
  66. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/measurement/watt.py +0 -0
  67. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/power/__init__.py +0 -0
  68. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/power/battery.py +0 -0
  69. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/power/battery_model_csv.py +0 -0
  70. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/power/eload.py +0 -0
  71. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/power/solar.py +0 -0
  72. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/power/supply.py +0 -0
  73. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/__init__.py +0 -0
  74. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/binaries.py +0 -0
  75. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/defaults.py +0 -0
  76. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/exec_.py +0 -0
  77. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/install.py +0 -0
  78. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/install_wheel.py +0 -0
  79. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/login.py +0 -0
  80. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/logs.py +0 -0
  81. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/update.py +0 -0
  82. {lager_cli-0.32.3 → lager_cli-0.32.4}/commands/utility/webcam.py +0 -0
  83. {lager_cli-0.32.3 → lager_cli-0.32.4}/config.py +0 -0
  84. {lager_cli-0.32.3 → lager_cli-0.32.4}/context/__init__.py +0 -0
  85. {lager_cli-0.32.3 → lager_cli-0.32.4}/context/ci_detection.py +0 -0
  86. {lager_cli-0.32.3 → lager_cli-0.32.4}/context/constants.py +0 -0
  87. {lager_cli-0.32.3 → lager_cli-0.32.4}/context/core.py +0 -0
  88. {lager_cli-0.32.3 → lager_cli-0.32.4}/context/error_handlers.py +0 -0
  89. {lager_cli-0.32.3 → lager_cli-0.32.4}/context/session.py +0 -0
  90. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/__init__.py +0 -0
  91. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/group_usage.py +0 -0
  92. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/matchers.py +0 -0
  93. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/net_group.py +0 -0
  94. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/net_helpers.py +0 -0
  95. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/net_storage.py +0 -0
  96. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/param_types.py +0 -0
  97. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/ssh_utils.py +0 -0
  98. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/utils.py +0 -0
  99. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/version_skew.py +0 -0
  100. {lager_cli-0.32.3 → lager_cli-0.32.4}/core/ws_diagnose.py +0 -0
  101. {lager_cli-0.32.3 → lager_cli-0.32.4}/deployment/__init__.py +0 -0
  102. {lager_cli-0.32.3 → lager_cli-0.32.4}/deployment/scripts/__init__.py +0 -0
  103. {lager_cli-0.32.3 → lager_cli-0.32.4}/deployment/scripts/configure_docker_dns.py +0 -0
  104. {lager_cli-0.32.3 → lager_cli-0.32.4}/deployment/scripts/configure_docker_dns.sh +0 -0
  105. {lager_cli-0.32.3 → lager_cli-0.32.4}/deployment/scripts/convert_to_sparse_checkout.sh +0 -0
  106. {lager_cli-0.32.3 → lager_cli-0.32.4}/deployment/scripts/setup_ssh_key.sh +0 -0
  107. {lager_cli-0.32.3 → lager_cli-0.32.4}/deployment/security/__init__.py +0 -0
  108. {lager_cli-0.32.3 → lager_cli-0.32.4}/deployment/security/secure_box_firewall.sh +0 -0
  109. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/__init__.py +0 -0
  110. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/common/__init__.py +0 -0
  111. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/common/construct_utils.py +0 -0
  112. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/common/exceptions.py +0 -0
  113. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/common/py3compat.py +0 -0
  114. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/common/utils.py +0 -0
  115. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/construct/__init__.py +0 -0
  116. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/construct/adapters.py +0 -0
  117. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/construct/core.py +0 -0
  118. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/construct/debug.py +0 -0
  119. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/construct/macros.py +0 -0
  120. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/__init__.py +0 -0
  121. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/abbrevtable.py +0 -0
  122. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/aranges.py +0 -0
  123. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/callframe.py +0 -0
  124. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/compileunit.py +0 -0
  125. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/constants.py +0 -0
  126. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/descriptions.py +0 -0
  127. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/die.py +0 -0
  128. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/dwarf_expr.py +0 -0
  129. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/dwarfinfo.py +0 -0
  130. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/enums.py +0 -0
  131. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/lineprogram.py +0 -0
  132. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/locationlists.py +0 -0
  133. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/namelut.py +0 -0
  134. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/ranges.py +0 -0
  135. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/dwarf/structs.py +0 -0
  136. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/ehabi/__init__.py +0 -0
  137. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/ehabi/constants.py +0 -0
  138. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/ehabi/decoder.py +0 -0
  139. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/ehabi/ehabiinfo.py +0 -0
  140. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/ehabi/structs.py +0 -0
  141. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/__init__.py +0 -0
  142. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/constants.py +0 -0
  143. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/descriptions.py +0 -0
  144. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/dynamic.py +0 -0
  145. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/elffile.py +0 -0
  146. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/enums.py +0 -0
  147. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/gnuversions.py +0 -0
  148. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/hash.py +0 -0
  149. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/notes.py +0 -0
  150. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/relocation.py +0 -0
  151. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/sections.py +0 -0
  152. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/segments.py +0 -0
  153. {lager_cli-0.32.3 → lager_cli-0.32.4}/elftools/elf/structs.py +0 -0
  154. {lager_cli-0.32.3 → lager_cli-0.32.4}/errors.py +0 -0
  155. {lager_cli-0.32.3 → lager_cli-0.32.4}/exceptions.py +0 -0
  156. {lager_cli-0.32.3 → lager_cli-0.32.4}/impl/__init__.py +0 -0
  157. {lager_cli-0.32.3 → lager_cli-0.32.4}/impl/box_config.py +0 -0
  158. {lager_cli-0.32.3 → lager_cli-0.32.4}/impl/measurement/__init__.py +0 -0
  159. {lager_cli-0.32.3 → lager_cli-0.32.4}/impl/measurement/scope.py +0 -0
  160. {lager_cli-0.32.3 → lager_cli-0.32.4}/impl/measurement/scope_stream.py +0 -0
  161. {lager_cli-0.32.3 → lager_cli-0.32.4}/impl/power/__init__.py +0 -0
  162. {lager_cli-0.32.3 → lager_cli-0.32.4}/impl/power/enable_disable.py +0 -0
  163. {lager_cli-0.32.3 → lager_cli-0.32.4}/lager_cli.egg-info/SOURCES.txt +0 -0
  164. {lager_cli-0.32.3 → lager_cli-0.32.4}/lager_cli.egg-info/dependency_links.txt +0 -0
  165. {lager_cli-0.32.3 → lager_cli-0.32.4}/lager_cli.egg-info/entry_points.txt +0 -0
  166. {lager_cli-0.32.3 → lager_cli-0.32.4}/lager_cli.egg-info/requires.txt +0 -0
  167. {lager_cli-0.32.3 → lager_cli-0.32.4}/lager_cli.egg-info/top_level.txt +0 -0
  168. {lager_cli-0.32.3 → lager_cli-0.32.4}/main.py +0 -0
  169. {lager_cli-0.32.3 → lager_cli-0.32.4}/pyproject.toml +0 -0
  170. {lager_cli-0.32.3 → lager_cli-0.32.4}/safe_unpickle.py +0 -0
  171. {lager_cli-0.32.3 → lager_cli-0.32.4}/setup.cfg +0 -0
  172. {lager_cli-0.32.3 → lager_cli-0.32.4}/setup.py +0 -0
  173. {lager_cli-0.32.3 → lager_cli-0.32.4}/simple_hdlc.py +0 -0
  174. {lager_cli-0.32.3 → lager_cli-0.32.4}/sort_utils.py +0 -0
  175. {lager_cli-0.32.3 → lager_cli-0.32.4}/status.py +0 -0
  176. {lager_cli-0.32.3 → lager_cli-0.32.4}/supply/__init__.py +0 -0
  177. {lager_cli-0.32.3 → lager_cli-0.32.4}/supply/supply_tui.py +0 -0
  178. {lager_cli-0.32.3 → lager_cli-0.32.4}/supply/websocket_client.py +0 -0
  179. {lager_cli-0.32.3 → lager_cli-0.32.4}/terminal/__init__.py +0 -0
  180. {lager_cli-0.32.3 → lager_cli-0.32.4}/terminal/core/__init__.py +0 -0
  181. {lager_cli-0.32.3 → lager_cli-0.32.4}/terminal/core/executor.py +0 -0
  182. {lager_cli-0.32.3 → lager_cli-0.32.4}/terminal/main.py +0 -0
  183. {lager_cli-0.32.3 → lager_cli-0.32.4}/terminal/ui/__init__.py +0 -0
  184. {lager_cli-0.32.3 → lager_cli-0.32.4}/terminal/ui/completer.py +0 -0
  185. {lager_cli-0.32.3 → lager_cli-0.32.4}/terminal/ui/display.py +0 -0
  186. {lager_cli-0.32.3 → lager_cli-0.32.4}/terminal/ui/logo.py +0 -0
  187. {lager_cli-0.32.3 → lager_cli-0.32.4}/terminal/ui/repl.py +0 -0
  188. {lager_cli-0.32.3 → lager_cli-0.32.4}/terminal/ui/themes.py +0 -0
  189. {lager_cli-0.32.3 → lager_cli-0.32.4}/tests/test_box_lager_imports.py +0 -0
  190. {lager_cli-0.32.3 → lager_cli-0.32.4}/tests/test_box_storage.py +0 -0
  191. {lager_cli-0.32.3 → lager_cli-0.32.4}/tests/test_gateway_auth.py +0 -0
  192. {lager_cli-0.32.3 → lager_cli-0.32.4}/tests/test_io_imports.py +0 -0
  193. {lager_cli-0.32.3 → lager_cli-0.32.4}/tests/test_update_gate.py +0 -0
  194. {lager_cli-0.32.3 → lager_cli-0.32.4}/update_check.py +0 -0
  195. {lager_cli-0.32.3 → lager_cli-0.32.4}/vendor/PyCRC/CRC16.py +0 -0
  196. {lager_cli-0.32.3 → lager_cli-0.32.4}/vendor/PyCRC/CRC16DNP.py +0 -0
  197. {lager_cli-0.32.3 → lager_cli-0.32.4}/vendor/PyCRC/CRC16Kermit.py +0 -0
  198. {lager_cli-0.32.3 → lager_cli-0.32.4}/vendor/PyCRC/CRC16SICK.py +0 -0
  199. {lager_cli-0.32.3 → lager_cli-0.32.4}/vendor/PyCRC/CRC32.py +0 -0
  200. {lager_cli-0.32.3 → lager_cli-0.32.4}/vendor/PyCRC/CRCCCITT.py +0 -0
  201. {lager_cli-0.32.3 → lager_cli-0.32.4}/vendor/PyCRC/__init__.py +0 -0
  202. {lager_cli-0.32.3 → lager_cli-0.32.4}/vendor/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: lager-cli
3
- Version: 0.32.3
3
+ Version: 0.32.4
4
4
  Summary: Lager CLI - Box and Docker connectivity
5
5
  Home-page: https://github.com/lagerdata/lager
6
6
  Author: Lager Data
@@ -7,4 +7,4 @@ Lager CLI
7
7
  A Command Line Interface for Lager Data
8
8
  """
9
9
 
10
- __version__ = '0.32.3'
10
+ __version__ = '0.32.4'
@@ -603,7 +603,7 @@ def uninstall(ctx, box, ip, user, keep_config, keep_docker_images, remove_all, y
603
603
  click.echo(" - Docker containers (lager, pigpio)")
604
604
  click.echo(" - Docker network (lagernet)")
605
605
  if not keep_docker_images:
606
- click.echo(" - Docker images (ALL unused images on the box, not only lager's)")
606
+ click.echo(" - Docker images (the lager image and dangling layers only)")
607
607
  click.echo(" - ~/box directory")
608
608
  if not keep_config:
609
609
  click.echo(" - /etc/lager directory (saved nets)")
@@ -707,10 +707,15 @@ def uninstall(ctx, box, ip, user, keep_config, keep_docker_images, remove_all, y
707
707
  run_ssh("docker network rm lagernet 2>/dev/null", "Removing lagernet network", allow_fail=True)
708
708
  click.echo()
709
709
 
710
- # Remove Docker images (unless --keep-docker-images)
710
+ # Remove Docker images (unless --keep-docker-images). Scoped to the
711
+ # lager image plus dangling layers: 'prune -af' would also delete
712
+ # images belonging to any OTHER stopped container on the box (a
713
+ # management agent, a user's own services) — infrastructure this
714
+ # command cannot restore.
711
715
  click.secho("[Step 2/5] Cleaning Docker...", fg='cyan')
712
716
  if not keep_docker_images:
713
- run_ssh("docker image prune -af 2>/dev/null", "Removing Docker images", allow_fail=True)
717
+ run_ssh("docker rmi -f lager 2>/dev/null", "Removing lager image", allow_fail=True)
718
+ run_ssh("docker image prune -f 2>/dev/null", "Removing dangling images", allow_fail=True)
714
719
  run_ssh("docker builder prune -af 2>/dev/null", "Clearing Docker build cache", allow_fail=True)
715
720
  else:
716
721
  click.echo(" Skipping Docker image removal (--keep-docker-images)")
@@ -1339,33 +1339,37 @@ print_info "Ensuring Docker service is enabled (for auto-start on boot)..."
1339
1339
  ssh $SSH_OPTS "${BOX_USER}@${BOX_IP}" "sudo systemctl enable docker >/dev/null 2>&1 || true"
1340
1340
  print_success "Docker service enabled"
1341
1341
 
1342
- print_info "Stopping and removing all existing containers..."
1343
- # Update restart policy first to prevent auto-restart, then force remove all containers
1342
+ print_info "Stopping and removing lager containers..."
1343
+ # Scoped to the containers this deployment owns (lager, pigpio, and the
1344
+ # legacy controller). A box may run third-party containers alongside lager
1345
+ # — a management agent, a user's own services — and removing containers we
1346
+ # did not create takes down infrastructure this script cannot restore.
1347
+ # Update restart policy first to prevent auto-restart, then force remove.
1344
1348
  ssh $SSH_OPTS "${BOX_USER}@${BOX_IP}" "
1345
- # Disable auto-restart on all containers first
1346
- docker update --restart=no \$(docker ps -aq) 2>/dev/null || true
1347
- # Stop all running containers
1348
- docker stop \$(docker ps -q) 2>/dev/null || true
1349
- # Remove all containers (running and stopped)
1350
- docker rm -f \$(docker ps -aq) 2>/dev/null || true
1351
- # Prune any leftover containers
1352
- docker container prune -f 2>/dev/null || true
1349
+ for c in lager pigpio controller; do
1350
+ docker update --restart=no \$c 2>/dev/null || true
1351
+ docker stop \$c 2>/dev/null || true
1352
+ docker rm -f \$c 2>/dev/null || true
1353
+ done
1353
1354
  # Wait a moment for Docker to clean up
1354
1355
  sleep 2
1355
1356
  " 2>/dev/null || true
1356
- print_success "All containers cleaned up"
1357
+ print_success "Lager containers cleaned up"
1357
1358
 
1358
- print_info "Cleaning up Docker images and build cache to free disk space..."
1359
+ print_info "Cleaning up Docker build cache and dangling images..."
1359
1360
  echo ""
1361
+ # Dangling-only (no -a): 'prune -af' would also delete images belonging to
1362
+ # third-party containers stopped at this moment, which cannot be re-pulled
1363
+ # by this script.
1360
1364
  ssh $SSH_OPTS "${BOX_USER}@${BOX_IP}" "
1361
- echo 'Removing unused Docker images...'
1362
- docker image prune -af 2>/dev/null || true
1365
+ echo 'Removing dangling Docker images...'
1366
+ docker image prune -f 2>/dev/null || true
1363
1367
  echo 'Removing Docker build cache...'
1364
1368
  docker builder prune -af 2>/dev/null || true
1365
1369
  echo 'Cleanup complete'
1366
1370
  " 2>/dev/null || true
1367
1371
  echo ""
1368
- print_success "Docker images and build cache cleaned up"
1372
+ print_success "Docker build cache and dangling images cleaned up"
1369
1373
 
1370
1374
  print_info "Checking available disk space..."
1371
1375
  ssh $SSH_OPTS "${BOX_USER}@${BOX_IP}" "df -h / | tail -n 1 | awk '{print \"Available: \" \$4 \" (\" \$5 \" used)\"}'" 2>/dev/null || true
@@ -99,6 +99,27 @@ def _token_expires_at(access_token):
99
99
  return 0.0
100
100
 
101
101
 
102
+ def _refresh_margin(access_token):
103
+ """Refresh-ahead margin, capped at a quarter of the token's lifetime.
104
+
105
+ A fixed margin at least as large as the token lifetime would classify
106
+ every freshly issued token as already stale, turning each request into
107
+ a refresh round-trip — a refresh storm against servers issuing
108
+ short-lived tokens, with each refresh rotating the refresh-token
109
+ family and multiplying the chances of losing the session.
110
+ """
111
+ try:
112
+ payload_b64 = access_token.split('.')[1]
113
+ payload_b64 += '=' * (-len(payload_b64) % 4)
114
+ payload = json.loads(base64.urlsafe_b64decode(payload_b64))
115
+ lifetime = float(payload['exp']) - float(payload['iat'])
116
+ except (IndexError, KeyError, ValueError, TypeError):
117
+ return EXPIRY_MARGIN_SECONDS
118
+ if lifetime <= 0:
119
+ return EXPIRY_MARGIN_SECONDS
120
+ return min(EXPIRY_MARGIN_SECONDS, max(lifetime / 4.0, 1.0))
121
+
122
+
102
123
  def save_login(url, access_token, cookies):
103
124
  """Store a session: the bearer token plus whatever cookies the auth
104
125
  server set at login (typically an httpOnly refresh token)."""
@@ -121,20 +142,35 @@ def clear_login(url=None):
121
142
 
122
143
 
123
144
  def _refresh_access_token(url, entry):
124
- """Ask the auth server for a fresh access token, or return None."""
145
+ """Ask the auth server for a fresh access token, or return None.
146
+
147
+ Retries once, but ONLY when the request never reached the server
148
+ (connection error): the server rotates the refresh token on every
149
+ successful refresh, so replaying the request after an ambiguous
150
+ failure (e.g. a read timeout) could trip the server's replay
151
+ detection and burn the whole session.
152
+ """
125
153
  cookies = entry.get('cookies') or {}
126
154
  if not cookies:
127
155
  return None
128
- try:
129
- resp = requests.post(
130
- f'{url}/api/auth/refresh',
131
- cookies=cookies,
132
- timeout=AUTH_SERVER_TIMEOUT,
133
- )
134
- if resp.status_code != 200:
156
+ resp = None
157
+ for _ in range(2):
158
+ try:
159
+ resp = requests.post(
160
+ f'{url}/api/auth/refresh',
161
+ cookies=cookies,
162
+ timeout=AUTH_SERVER_TIMEOUT,
163
+ )
164
+ break
165
+ except requests.ConnectionError:
166
+ continue
167
+ except requests.RequestException:
135
168
  return None
169
+ if resp is None or resp.status_code != 200:
170
+ return None
171
+ try:
136
172
  access_token = resp.json().get('accessToken')
137
- except (requests.RequestException, ValueError):
173
+ except ValueError:
138
174
  return None
139
175
  if not access_token:
140
176
  return None
@@ -145,14 +181,26 @@ def _refresh_access_token(url, entry):
145
181
 
146
182
 
147
183
  def access_token_for(url):
148
- """Stored access token for an auth server, refreshed if near expiry."""
184
+ """Stored access token for an auth server, refreshed if near expiry.
185
+
186
+ A failed refresh is not immediately fatal: if the stored token has not
187
+ actually expired, return it anyway and let the gateway judge it — a
188
+ transient auth-server error should not fail a command whose token is
189
+ still valid.
190
+ """
149
191
  entry = _load_store().get('authServers', {}).get(url)
150
192
  if not entry:
151
193
  return None
152
194
  access_token = entry.get('accessToken')
153
- if access_token and _token_expires_at(access_token) > time.time() + EXPIRY_MARGIN_SECONDS:
195
+ now = time.time()
196
+ if access_token and _token_expires_at(access_token) > now + _refresh_margin(access_token):
197
+ return access_token
198
+ refreshed = _refresh_access_token(url, entry)
199
+ if refreshed:
200
+ return refreshed
201
+ if access_token and _token_expires_at(access_token) > now:
154
202
  return access_token
155
- return _refresh_access_token(url, entry)
203
+ return None
156
204
 
157
205
 
158
206
  def auth_headers_for_box(box_ip):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: lager-cli
3
- Version: 0.32.3
3
+ Version: 0.32.4
4
4
  Summary: Lager CLI - Box and Docker connectivity
5
5
  Home-page: https://github.com/lagerdata/lager
6
6
  Author: Lager Data
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes