cmdbox 0.2.8__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.
- cmdbox-0.2.8/LICENSE +21 -0
- cmdbox-0.2.8/MANIFEST.in +21 -0
- cmdbox-0.2.8/PKG-INFO +269 -0
- cmdbox-0.2.8/README.md +245 -0
- cmdbox-0.2.8/cmdbox/__init__.py +3 -0
- cmdbox-0.2.8/cmdbox/__main__.py +4 -0
- cmdbox-0.2.8/cmdbox/app/__init__.py +0 -0
- cmdbox-0.2.8/cmdbox/app/app.py +153 -0
- cmdbox-0.2.8/cmdbox/app/client.py +383 -0
- cmdbox-0.2.8/cmdbox/app/common.py +477 -0
- cmdbox-0.2.8/cmdbox/app/commons/convert.py +249 -0
- cmdbox-0.2.8/cmdbox/app/commons/loghandler.py +102 -0
- cmdbox-0.2.8/cmdbox/app/commons/module.py +110 -0
- cmdbox-0.2.8/cmdbox/app/commons/redis_client.py +301 -0
- cmdbox-0.2.8/cmdbox/app/feature.py +223 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_client_file_copy.py +207 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_client_file_download.py +207 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_client_file_list.py +193 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_client_file_mkdir.py +191 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_client_file_move.py +199 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_client_file_remove.py +190 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_client_file_rmdir.py +190 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_client_file_upload.py +212 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_client_server_info.py +166 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_gui_start.py +150 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_gui_stop.py +47 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_server_list.py +88 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_server_start.py +103 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_server_stop.py +138 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_apikey_add.py +103 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_apikey_del.py +103 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_gencert.py +158 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_group_add.py +106 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_group_del.py +99 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_group_edit.py +106 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_group_list.py +99 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_start.py +158 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_stop.py +69 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_user_add.py +116 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_user_del.py +99 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_user_edit.py +116 -0
- cmdbox-0.2.8/cmdbox/app/features/cli/cmdbox_web_user_list.py +99 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_assets.py +45 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_bbforce_cmd.py +41 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_copyright.py +22 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_del_cmd.py +26 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_del_pipe.py +27 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_do_signin.py +124 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_do_signout.py +21 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_exec_cmd.py +199 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_exec_pipe.py +191 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_filer download.py +43 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_filer.py +53 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_filer_upload.py +64 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_get_cmd_choices.py +24 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_get_cmds.py +26 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_get_modes.py +24 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_get_server_opt.py +25 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_gui.py +158 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_gui_callback.py +45 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_list_cmd.py +47 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_list_pipe.py +57 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_load_cmd.py +47 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_load_pipe.py +43 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_raw_cmd.py +49 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_raw_pipe.py +80 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_save_cmd.py +52 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_save_pipe.py +44 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_signin.py +67 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_users.py +217 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_usesignout.py +20 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_versions_cmdbox.py +22 -0
- cmdbox-0.2.8/cmdbox/app/features/web/cmdbox_web_versions_used.py +32 -0
- cmdbox-0.2.8/cmdbox/app/filer.py +351 -0
- cmdbox-0.2.8/cmdbox/app/options.py +380 -0
- cmdbox-0.2.8/cmdbox/app/server.py +212 -0
- cmdbox-0.2.8/cmdbox/app/web.py +1014 -0
- cmdbox-0.2.8/cmdbox/config.yml +3 -0
- cmdbox-0.2.8/cmdbox/extensions/features.yml +12 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/.vscode/launch.json +38 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/requirements.txt +2 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/__init__.py +3 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/__main__.py +4 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/app/app.py +10 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/app/features/cli/sample_client_time.py +63 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/app/features/cli/sample_server_time.py +126 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/extensions/features.yml +23 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/extensions/user_list.yml +87 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/logconf_sample.yml +30 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/version.py +20 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/web/assets/sample/favicon.ico +0 -0
- cmdbox-0.2.8/cmdbox/extensions/sample_project/sample/web/assets/sample/icon.png +0 -0
- cmdbox-0.2.8/cmdbox/extensions/user_list.yml +87 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.Jinja2.3.1.4(BSD License).txt +28 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.MarkupSafe.3.0.2(BSD License).txt +28 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.PyYAML.6.0.2(MIT License).txt +20 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.Pygments.2.18.0(BSD License).txt +25 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.Sphinx.8.1.3(BSD License).txt +31 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.alabaster.1.0.0(BSD License).txt +34 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.annotated-types.0.7.0(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.anyio.4.6.2.post1(MIT License).txt +20 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.argcomplete.3.5.1(Apache Software License).txt +177 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.babel.2.16.0(BSD License).txt +27 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.backports.tarfile.1.2.0(MIT License).txt +17 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.certifi.2024.8.30(Mozilla Public License 2.0 (MPL 2.0)).txt +20 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.cffi.1.17.1(MIT License).txt +26 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.charset-normalizer.3.4.0(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.click.8.1.7(BSD License).txt +28 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.colorama.0.4.6(BSD License).txt +27 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.cryptography.43.0.3(Apache Software License; BSD License).txt +3 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.docutils.0.21.2(BSD License; GNU General Public License (GPL); Public Domain; Python Software Foundation License).txt +159 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.fastapi.0.115.5(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.gevent.24.11.1(MIT License).txt +25 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.greenlet.3.1.1(MIT License).txt +30 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.h11.0.14.0(MIT License).txt +22 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.httptools.0.6.4(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.idna.3.10(BSD License).txt +31 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.imagesize.1.4.1(MIT License).txt +19 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.importlib_metadata.8.5.0(Apache Software License).txt +202 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.itsdangerous.2.2.0(BSD License).txt +28 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.jaraco.classes.3.4.0(MIT License).txt +17 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.jaraco.context.6.0.1(MIT License).txt +17 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.jaraco.functools.4.1.0(MIT License).txt +17 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.keyring.25.5.0(MIT License).txt +17 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.markdown-it-py.3.0.0(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.mdurl.0.1.2(MIT License).txt +46 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.more-itertools.10.5.0(MIT License).txt +19 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.nh3.0.2.18(MIT).txt +1 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.numpy.2.1.3(BSD License).txt +950 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.packaging.24.2(Apache Software License; BSD License).txt +3 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.pillow.11.0.0(CMU License (MIT-CMU)).txt +1226 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.pip.24.0(MIT License).txt +20 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.pkginfo.1.10.0(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.prettytable.3.12.0(BSD License).txt +30 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.pycparser.2.22(BSD License).txt +27 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.pydantic.2.10.2(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.pydantic_core.2.27.1(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.python-dotenv.1.0.1(BSD License).txt +27 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.python-multipart.0.0.17(Apache Software License).txt +14 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.pywin32-ctypes.0.2.3(BSD-3-Clause).txt +28 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.readme_renderer.44.0(Apache Software License).txt +174 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.redis.5.2.0(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.requests-toolbelt.1.0.0(Apache Software License).txt +13 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.requests.2.32.3(Apache Software License).txt +175 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.rfc3986.2.0.0(Apache Software License).txt +13 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.rich.13.9.4(MIT License).txt +19 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.setuptools.65.5.0(MIT License).txt +19 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.six.1.16.0(MIT License).txt +18 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sniffio.1.3.1(Apache Software License; MIT License).txt +3 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.snowballstemmer.2.2.0(BSD License).txt +29 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinx-intl.2.3.0(BSD License).txt +25 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinx-rtd-theme.3.0.2(MIT License).txt +20 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinx-sitemap.2.6.0(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinx_fontawesome.0.0.6(GNU General Public License v2 (GPLv2)).txt +339 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinxcontrib-applehelp.2.0.0(BSD License).txt +1 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinxcontrib-devhelp.2.0.0(BSD License).txt +1 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinxcontrib-htmlhelp.2.1.0(BSD License).txt +1 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinxcontrib-jquery.4.1(BSD License).txt +1 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinxcontrib-jsmath.1.0.1(BSD License).txt +29 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinxcontrib-qthelp.2.0.0(BSD License).txt +1 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.sphinxcontrib-serializinghtml.2.0.0(BSD License).txt +1 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.starlette.0.41.3(BSD License).txt +27 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.tabulate.0.9.0(MIT License).txt +20 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.tomli.2.1.0(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.twine.5.1.1(Apache Software License).txt +174 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.typing_extensions.4.12.2(Python Software Foundation License).txt +279 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.urllib3.2.2.3(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.uvicorn.0.32.1(BSD License).txt +27 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.watchfiles.1.0.0(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.wcwidth.0.2.13(MIT License).txt +27 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.websockets.14.1(BSD License).txt +24 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.wheel.0.45.1(MIT License).txt +21 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.zipp.3.21.0(MIT License).txt +17 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.zope.event.5.0(Zope Public License).txt +44 -0
- cmdbox-0.2.8/cmdbox/licenses/LICENSE.zope.interface.7.1.1(Zope Public License).txt +44 -0
- cmdbox-0.2.8/cmdbox/licenses/files.txt +83 -0
- cmdbox-0.2.8/cmdbox/logconf_client.yml +30 -0
- cmdbox-0.2.8/cmdbox/logconf_gui.yml +30 -0
- cmdbox-0.2.8/cmdbox/logconf_server.yml +30 -0
- cmdbox-0.2.8/cmdbox/logconf_web.yml +30 -0
- cmdbox-0.2.8/cmdbox/version.py +27 -0
- cmdbox-0.2.8/cmdbox/web/assets/bootstrap/bootstrap.bundle.min.5.3.0.js +7 -0
- cmdbox-0.2.8/cmdbox/web/assets/bootstrap/bootstrap.min.5.3.0.css +6 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/common.js +787 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/favicon.ico +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/filer_modal.js +155 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/icon.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/list_cmd.js +488 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/list_pipe.js +191 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/main.js +113 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/open_capture.js +17 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/open_output_json.js +17 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/signin.js +85 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/users.js +519 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/view_raw.js +49 -0
- cmdbox-0.2.8/cmdbox/web/assets/cmdbox/view_result.js +146 -0
- cmdbox-0.2.8/cmdbox/web/assets/encodingjs/LICENSE.txt +21 -0
- cmdbox-0.2.8/cmdbox/web/assets/encodingjs/encoding.js +6082 -0
- cmdbox-0.2.8/cmdbox/web/assets/encodingjs/encoding.min.js +7 -0
- cmdbox-0.2.8/cmdbox/web/assets/filer/filer.js +785 -0
- cmdbox-0.2.8/cmdbox/web/assets/filer/main.css +20 -0
- cmdbox-0.2.8/cmdbox/web/assets/filer/main.js +14 -0
- cmdbox-0.2.8/cmdbox/web/assets/highlight/default.css +117 -0
- cmdbox-0.2.8/cmdbox/web/assets/highlight/highlight.min.js +3861 -0
- cmdbox-0.2.8/cmdbox/web/assets/highlight/styles/tokyo-night-dark.min.css +8 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery/jquery.min.3.2.0.js +4 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-linedtextarea/README.md +23 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-linedtextarea/jquery-linedtextarea-license.txt +25 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-linedtextarea/jquery-linedtextarea.css +68 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-linedtextarea/jquery-linedtextarea.html +46 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-linedtextarea/jquery-linedtextarea.js +149 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-resizable/jquery-resizable.min.js +1 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/AUTHORS.txt +372 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/LICENSE.txt +43 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/images/ui-icons_444444_256x240.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/images/ui-icons_555555_256x240.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/images/ui-icons_777620_256x240.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/images/ui-icons_777777_256x240.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/images/ui-icons_cc0000_256x240.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/jquery-ui.min.css +7 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/jquery-ui.min.js +6 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/jquery-ui.structure.min.css +5 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/jquery-ui.theme.min.css +5 -0
- cmdbox-0.2.8/cmdbox/web/assets/jquery-ui/package.json +74 -0
- cmdbox-0.2.8/cmdbox/web/assets/lightbox2/css/lightbox.min.css +1 -0
- cmdbox-0.2.8/cmdbox/web/assets/lightbox2/images/close.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/lightbox2/images/loading.gif +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/lightbox2/images/next.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/lightbox2/images/prev.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/lightbox2/js/lightbox.min.js +15 -0
- cmdbox-0.2.8/cmdbox/web/assets/split-pane/split-pane.css +121 -0
- cmdbox-0.2.8/cmdbox/web/assets/split-pane/split-pane.js +366 -0
- cmdbox-0.2.8/cmdbox/web/assets/tree-menu/css/tree-menu.css +53 -0
- cmdbox-0.2.8/cmdbox/web/assets/tree-menu/image/file.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/tree-menu/image/folder-close.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/tree-menu/image/folder-open.png +0 -0
- cmdbox-0.2.8/cmdbox/web/assets/tree-menu/js/tree-menu.js +27 -0
- cmdbox-0.2.8/cmdbox/web/assets_license_list.txt +10 -0
- cmdbox-0.2.8/cmdbox/web/filer.html +211 -0
- cmdbox-0.2.8/cmdbox/web/gui.html +455 -0
- cmdbox-0.2.8/cmdbox/web/signin.html +99 -0
- cmdbox-0.2.8/cmdbox/web/users.html +225 -0
- cmdbox-0.2.8/cmdbox.egg-info/PKG-INFO +269 -0
- cmdbox-0.2.8/cmdbox.egg-info/SOURCES.txt +249 -0
- cmdbox-0.2.8/cmdbox.egg-info/dependency_links.txt +1 -0
- cmdbox-0.2.8/cmdbox.egg-info/entry_points.txt +3 -0
- cmdbox-0.2.8/cmdbox.egg-info/requires.txt +14 -0
- cmdbox-0.2.8/cmdbox.egg-info/top_level.txt +1 -0
- cmdbox-0.2.8/setup.cfg +4 -0
- cmdbox-0.2.8/setup.py +98 -0
cmdbox-0.2.8/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-2024 hamacom2004jp All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
cmdbox-0.2.8/MANIFEST.in
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Files to include
|
|
2
|
+
include cmdbox/*.yml
|
|
3
|
+
include cmdbox/extensions/**
|
|
4
|
+
include cmdbox/docker/**
|
|
5
|
+
include cmdbox/licenses/**
|
|
6
|
+
include cmdbox/tools/**
|
|
7
|
+
include cmdbox/web/**
|
|
8
|
+
|
|
9
|
+
# Files to exclude
|
|
10
|
+
global-exclude *.pyc
|
|
11
|
+
global-exclude *.swp
|
|
12
|
+
global-exclude .DS_Store
|
|
13
|
+
global-exclude cmdbox/extensions/data/*.json
|
|
14
|
+
global-exclude cmdbox/extensions/data/*/*.jpg
|
|
15
|
+
global-exclude cmdbox/extensions/data/*/*.svg
|
|
16
|
+
|
|
17
|
+
# Include specific directories
|
|
18
|
+
recursive-include cmdbox extensions/**/.*
|
|
19
|
+
|
|
20
|
+
# Exclude specific directories
|
|
21
|
+
recursive-exclude * build
|
cmdbox-0.2.8/PKG-INFO
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: cmdbox
|
|
3
|
+
Version: 0.2.8
|
|
4
|
+
Summary: cmdbox: It is a command line application with a plugin mechanism.
|
|
5
|
+
Home-page: https://github.com/hamacom2004jp/cmdbox
|
|
6
|
+
Author: hamacom2004jp
|
|
7
|
+
Author-email: hamacom2004jp@gmail.com
|
|
8
|
+
Maintainer: hamacom2004jp
|
|
9
|
+
Maintainer-email: hamacom2004jp@gmail.com
|
|
10
|
+
License: MIT
|
|
11
|
+
Download-URL: https://github.com/hamacom2004jp/cmdbox
|
|
12
|
+
Description: # cmdbox
|
|
13
|
+
|
|
14
|
+
- It is a command line application with a plugin mechanism.
|
|
15
|
+
- Documentation is [here](https://hamacom2004jp.github.io/cmdbox/).
|
|
16
|
+
- With cmdbox, you can easily implement commands with complex options.
|
|
17
|
+
- The implemented commands can be called from the CLI / RESTAPI / Web screen.
|
|
18
|
+
- The implemented commands can be executed on a remote server via redis.
|
|
19
|
+
|
|
20
|
+
# Install
|
|
21
|
+
|
|
22
|
+
- Install cmdbox with the following command.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install cmdbox
|
|
26
|
+
cmdbox -v
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- Also install the docker version of the redis server.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
docker run -p 6379:6379 --name redis -it ubuntu/redis:latest
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
# Tutorial
|
|
36
|
+
|
|
37
|
+
- Open the ```.sample/sample_project``` folder in the current directory with VSCode.
|
|
38
|
+
|
|
39
|
+

|
|
40
|
+
|
|
41
|
+
- Install dependent libraries.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python -m venv .venv
|
|
45
|
+
. .venv/bin/activate
|
|
46
|
+
pip install -r requirements.txt
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- Run the project.
|
|
50
|
+
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
- The localhost web screen will open.
|
|
54
|
+
|
|
55
|
+

|
|
56
|
+
|
|
57
|
+
- Enter ```user01 / user01``` for the initial ID and PW to sign in.
|
|
58
|
+
- Using this web screen, you can easily execute the commands implemented in cmdbox.
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
- Let's look at the command to get a list of files as an example.
|
|
63
|
+
- Press the plus button under Commands to open the Add dialog.
|
|
64
|
+
- Then enter the following.
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
- Press the ```Save``` button once and then press the ```Execute``` button.
|
|
69
|
+
- The results of the command execution are displayed.
|
|
70
|
+
|
|
71
|
+

|
|
72
|
+
|
|
73
|
+
- Open the saved ```client_time``` and press the ```Raw``` button.
|
|
74
|
+
- You will see how to execute the same command on the command line; the RESTAPI URL is also displayed.
|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## How to implement a new command using cmdbox
|
|
80
|
+
|
|
81
|
+
- Under the ```sample/app/features/cli``` folder, you will find an implementation of the ```client_time``` mentioned earlier.
|
|
82
|
+
- The implementation is as follows. (Slightly abbreviated display)
|
|
83
|
+
- Create the following code and save it in the ```sample/app/features/cli``` folder.
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
from cmdbox.app import common, feature
|
|
87
|
+
from typing import Dict, Any, Tuple, Union, List
|
|
88
|
+
import argparse
|
|
89
|
+
import datetime
|
|
90
|
+
import logging
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class ClientTime(feature.Feature):
|
|
94
|
+
def get_mode(self) -> Union[str, List[str]]:
|
|
95
|
+
return "client"
|
|
96
|
+
|
|
97
|
+
def get_cmd(self):
|
|
98
|
+
return 'time'
|
|
99
|
+
|
|
100
|
+
def get_option(self):
|
|
101
|
+
return dict(
|
|
102
|
+
type="str", default=None, required=False, multi=False, hide=False, use_redis=self.USE_REDIS_FALSE,
|
|
103
|
+
discription_ja="クライアント側の現在時刻を表示します。",
|
|
104
|
+
discription_en="Displays the current time at the client side.",
|
|
105
|
+
choice=[
|
|
106
|
+
dict(opt="timedelta", type="int", default=9, required=False, multi=False, hide=False, choice=None,
|
|
107
|
+
discription_ja="時差の時間数を指定します。",
|
|
108
|
+
discription_en="Specify the number of hours of time difference."),
|
|
109
|
+
])
|
|
110
|
+
|
|
111
|
+
def apprun(self, logger:logging.Logger, args:argparse.Namespace, tm:float, pf:List[Dict[str, float]]=[]) -> Tuple[int, Dict[str, Any], Any]:
|
|
112
|
+
tz = datetime.timezone(datetime.timedelta(hours=args.timedelta))
|
|
113
|
+
dt = datetime.datetime.now(tz)
|
|
114
|
+
ret = dict(success=dict(data=dt.strftime('%Y-%m-%d %H:%M:%S')))
|
|
115
|
+
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
116
|
+
if 'success' not in ret:
|
|
117
|
+
return 1, ret, None
|
|
118
|
+
return 0, ret, None
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
- Open the file ```sample/extensions/features.yml```. The file should look something like this.
|
|
122
|
+
- This file specifies where new commands are to be read.
|
|
123
|
+
- For example, if you want to add a package to read, add a new ```package``` and ```prefix``` to ```features.cli```.
|
|
124
|
+
- Note that ```features.web``` can be used to add a new web screen.
|
|
125
|
+
- If you only want to call commands added in ```features.cli``` via RESTAPI, no additional implementation is needed in ```features.web```.
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
```yml
|
|
129
|
+
features:
|
|
130
|
+
cli:
|
|
131
|
+
- package: sample.app.features.cli
|
|
132
|
+
prefix: sample_
|
|
133
|
+
web:
|
|
134
|
+
- package: sample.app.features.web
|
|
135
|
+
prefix: sample_web_
|
|
136
|
+
args:
|
|
137
|
+
cli:
|
|
138
|
+
- rule:
|
|
139
|
+
mode: web
|
|
140
|
+
default:
|
|
141
|
+
coercion:
|
|
142
|
+
assets:
|
|
143
|
+
- f"{Path(self.ver.__file__).parent / 'web' / 'assets'}"
|
|
144
|
+
doc_root: f"{Path(self.ver.__file__).parent / 'web'}"
|
|
145
|
+
- rule:
|
|
146
|
+
mode: gui
|
|
147
|
+
default:
|
|
148
|
+
coercion:
|
|
149
|
+
assets:
|
|
150
|
+
- f"{Path(self.ver.__file__).parent / 'web' / 'assets'}"
|
|
151
|
+
doc_root: f"{Path(self.ver.__file__).parent / 'web'}"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
- The following files should also be known when using commands on the web screen or RESTAPI.
|
|
155
|
+
- Open the file ```sample/extensions/user_list.yml```. The file should look something like this.
|
|
156
|
+
- This file manages the users and groups that are allowed Web access and their rules.
|
|
157
|
+
- The rule of the previous command is ```allow``` for users in the ```user``` group in ```cmdrule.rules```.
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
```yml
|
|
161
|
+
users:
|
|
162
|
+
- uid: 1
|
|
163
|
+
name: admin
|
|
164
|
+
password: XXXXXXXXXXX
|
|
165
|
+
hash: plain
|
|
166
|
+
groups: [admin]
|
|
167
|
+
email: admin@aaa.bbb.jp
|
|
168
|
+
- uid: 101
|
|
169
|
+
name: user01
|
|
170
|
+
password: XXXXXXXXXXX
|
|
171
|
+
hash: md5
|
|
172
|
+
groups: [user]
|
|
173
|
+
email: user01@aaa.bbb.jp
|
|
174
|
+
- uid: 102
|
|
175
|
+
name: user02
|
|
176
|
+
password: XXXXXXXXXXX
|
|
177
|
+
hash: sha1
|
|
178
|
+
groups: [readonly]
|
|
179
|
+
email: user02@aaa.bbb.jp
|
|
180
|
+
- uid: 103
|
|
181
|
+
name: user03
|
|
182
|
+
password: XXXXXXXXXXX
|
|
183
|
+
hash: sha256
|
|
184
|
+
groups: [editor]
|
|
185
|
+
email: user03@aaa.bbb.jp
|
|
186
|
+
groups:
|
|
187
|
+
- gid: 1
|
|
188
|
+
name: admin
|
|
189
|
+
- gid: 101
|
|
190
|
+
name: user
|
|
191
|
+
- gid: 102
|
|
192
|
+
name: readonly
|
|
193
|
+
parent: user
|
|
194
|
+
- gid: 103
|
|
195
|
+
name: editor
|
|
196
|
+
parent: user
|
|
197
|
+
cmdrule:
|
|
198
|
+
policy: deny # allow, deny
|
|
199
|
+
rules:
|
|
200
|
+
- groups: [admin]
|
|
201
|
+
rule: allow
|
|
202
|
+
- groups: [user]
|
|
203
|
+
mode: client
|
|
204
|
+
cmds: [file_download, file_list, server_info]
|
|
205
|
+
rule: allow
|
|
206
|
+
- groups: [user]
|
|
207
|
+
mode: server
|
|
208
|
+
cmds: [list]
|
|
209
|
+
rule: allow
|
|
210
|
+
- groups: [editor]
|
|
211
|
+
mode: client
|
|
212
|
+
cmds: [file_copy, file_mkdir, file_move, file_remove, file_rmdir, file_upload]
|
|
213
|
+
rule: allow
|
|
214
|
+
pathrule:
|
|
215
|
+
policy: deny # allow, deny
|
|
216
|
+
rules:
|
|
217
|
+
- groups: [admin]
|
|
218
|
+
paths: [/]
|
|
219
|
+
rule: allow
|
|
220
|
+
- groups: [user]
|
|
221
|
+
paths: [/signin, /assets, /bbforce_cmd, /copyright, /dosignin, /dosignout,
|
|
222
|
+
/exec_cmd, /exec_pipe, /filer, /gui, /get_server_opt, /usesignout, /versions_cmdbox, /versions_used]
|
|
223
|
+
rule: allow
|
|
224
|
+
- groups: [readonly]
|
|
225
|
+
paths: [/gui/del_cmd, /gui/del_pipe, /gui/save_cmd, /gui/save_pipe]
|
|
226
|
+
rule: deny
|
|
227
|
+
- groups: [editor]
|
|
228
|
+
paths: [/gui/del_cmd, /gui/del_pipe, /gui/save_cmd, /gui/save_pipe]
|
|
229
|
+
rule: allow
|
|
230
|
+
oauth2:
|
|
231
|
+
providers:
|
|
232
|
+
google:
|
|
233
|
+
enabled: false
|
|
234
|
+
client_id: XXXXXXXXXXX
|
|
235
|
+
client_secret: XXXXXXXXXXX
|
|
236
|
+
redirect_uri: https://localhost:8443/oauth2/google/callback
|
|
237
|
+
scope: ['email']
|
|
238
|
+
note:
|
|
239
|
+
- https://developers.google.com/identity/protocols/oauth2/web-server?hl=ja#httprest
|
|
240
|
+
github:
|
|
241
|
+
enabled: false
|
|
242
|
+
client_id: XXXXXXXXXXX
|
|
243
|
+
client_secret: XXXXXXXXXXX
|
|
244
|
+
redirect_uri: https://localhost:8443/oauth2/github/callback
|
|
245
|
+
scope: ['user:email']
|
|
246
|
+
note:
|
|
247
|
+
- https://docs.github.com/ja/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#scopes
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
- See the documentation for references to each file.
|
|
251
|
+
- Documentation is [here](https://hamacom2004jp.github.io/cmdbox/).
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
# Lisence
|
|
255
|
+
|
|
256
|
+
This project is licensed under the MIT License, see the LICENSE file for details
|
|
257
|
+
|
|
258
|
+
Keywords: cli restapi redis fastapi
|
|
259
|
+
Platform: UNKNOWN
|
|
260
|
+
Classifier: Development Status :: 4 - Beta
|
|
261
|
+
Classifier: Intended Audience :: Developers
|
|
262
|
+
Classifier: Intended Audience :: Information Technology
|
|
263
|
+
Classifier: Intended Audience :: System Administrators
|
|
264
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
265
|
+
Classifier: Natural Language :: Japanese
|
|
266
|
+
Classifier: Programming Language :: Python
|
|
267
|
+
Classifier: Topic :: Utilities
|
|
268
|
+
Requires-Python: >=3.8
|
|
269
|
+
Description-Content-Type: text/markdown
|
cmdbox-0.2.8/README.md
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
# cmdbox
|
|
2
|
+
|
|
3
|
+
- It is a command line application with a plugin mechanism.
|
|
4
|
+
- Documentation is [here](https://hamacom2004jp.github.io/cmdbox/).
|
|
5
|
+
- With cmdbox, you can easily implement commands with complex options.
|
|
6
|
+
- The implemented commands can be called from the CLI / RESTAPI / Web screen.
|
|
7
|
+
- The implemented commands can be executed on a remote server via redis.
|
|
8
|
+
|
|
9
|
+
# Install
|
|
10
|
+
|
|
11
|
+
- Install cmdbox with the following command.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install cmdbox
|
|
15
|
+
cmdbox -v
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- Also install the docker version of the redis server.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
docker run -p 6379:6379 --name redis -it ubuntu/redis:latest
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
# Tutorial
|
|
25
|
+
|
|
26
|
+
- Open the ```.sample/sample_project``` folder in the current directory with VSCode.
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
- Install dependent libraries.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python -m venv .venv
|
|
34
|
+
. .venv/bin/activate
|
|
35
|
+
pip install -r requirements.txt
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- Run the project.
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
- The localhost web screen will open.
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
- Enter ```user01 / user01``` for the initial ID and PW to sign in.
|
|
47
|
+
- Using this web screen, you can easily execute the commands implemented in cmdbox.
|
|
48
|
+
|
|
49
|
+

|
|
50
|
+
|
|
51
|
+
- Let's look at the command to get a list of files as an example.
|
|
52
|
+
- Press the plus button under Commands to open the Add dialog.
|
|
53
|
+
- Then enter the following.
|
|
54
|
+
|
|
55
|
+

|
|
56
|
+
|
|
57
|
+
- Press the ```Save``` button once and then press the ```Execute``` button.
|
|
58
|
+
- The results of the command execution are displayed.
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
- Open the saved ```client_time``` and press the ```Raw``` button.
|
|
63
|
+
- You will see how to execute the same command on the command line; the RESTAPI URL is also displayed.
|
|
64
|
+
|
|
65
|
+

|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## How to implement a new command using cmdbox
|
|
69
|
+
|
|
70
|
+
- Under the ```sample/app/features/cli``` folder, you will find an implementation of the ```client_time``` mentioned earlier.
|
|
71
|
+
- The implementation is as follows. (Slightly abbreviated display)
|
|
72
|
+
- Create the following code and save it in the ```sample/app/features/cli``` folder.
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from cmdbox.app import common, feature
|
|
76
|
+
from typing import Dict, Any, Tuple, Union, List
|
|
77
|
+
import argparse
|
|
78
|
+
import datetime
|
|
79
|
+
import logging
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class ClientTime(feature.Feature):
|
|
83
|
+
def get_mode(self) -> Union[str, List[str]]:
|
|
84
|
+
return "client"
|
|
85
|
+
|
|
86
|
+
def get_cmd(self):
|
|
87
|
+
return 'time'
|
|
88
|
+
|
|
89
|
+
def get_option(self):
|
|
90
|
+
return dict(
|
|
91
|
+
type="str", default=None, required=False, multi=False, hide=False, use_redis=self.USE_REDIS_FALSE,
|
|
92
|
+
discription_ja="クライアント側の現在時刻を表示します。",
|
|
93
|
+
discription_en="Displays the current time at the client side.",
|
|
94
|
+
choice=[
|
|
95
|
+
dict(opt="timedelta", type="int", default=9, required=False, multi=False, hide=False, choice=None,
|
|
96
|
+
discription_ja="時差の時間数を指定します。",
|
|
97
|
+
discription_en="Specify the number of hours of time difference."),
|
|
98
|
+
])
|
|
99
|
+
|
|
100
|
+
def apprun(self, logger:logging.Logger, args:argparse.Namespace, tm:float, pf:List[Dict[str, float]]=[]) -> Tuple[int, Dict[str, Any], Any]:
|
|
101
|
+
tz = datetime.timezone(datetime.timedelta(hours=args.timedelta))
|
|
102
|
+
dt = datetime.datetime.now(tz)
|
|
103
|
+
ret = dict(success=dict(data=dt.strftime('%Y-%m-%d %H:%M:%S')))
|
|
104
|
+
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
105
|
+
if 'success' not in ret:
|
|
106
|
+
return 1, ret, None
|
|
107
|
+
return 0, ret, None
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
- Open the file ```sample/extensions/features.yml```. The file should look something like this.
|
|
111
|
+
- This file specifies where new commands are to be read.
|
|
112
|
+
- For example, if you want to add a package to read, add a new ```package``` and ```prefix``` to ```features.cli```.
|
|
113
|
+
- Note that ```features.web``` can be used to add a new web screen.
|
|
114
|
+
- If you only want to call commands added in ```features.cli``` via RESTAPI, no additional implementation is needed in ```features.web```.
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
```yml
|
|
118
|
+
features:
|
|
119
|
+
cli:
|
|
120
|
+
- package: sample.app.features.cli
|
|
121
|
+
prefix: sample_
|
|
122
|
+
web:
|
|
123
|
+
- package: sample.app.features.web
|
|
124
|
+
prefix: sample_web_
|
|
125
|
+
args:
|
|
126
|
+
cli:
|
|
127
|
+
- rule:
|
|
128
|
+
mode: web
|
|
129
|
+
default:
|
|
130
|
+
coercion:
|
|
131
|
+
assets:
|
|
132
|
+
- f"{Path(self.ver.__file__).parent / 'web' / 'assets'}"
|
|
133
|
+
doc_root: f"{Path(self.ver.__file__).parent / 'web'}"
|
|
134
|
+
- rule:
|
|
135
|
+
mode: gui
|
|
136
|
+
default:
|
|
137
|
+
coercion:
|
|
138
|
+
assets:
|
|
139
|
+
- f"{Path(self.ver.__file__).parent / 'web' / 'assets'}"
|
|
140
|
+
doc_root: f"{Path(self.ver.__file__).parent / 'web'}"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
- The following files should also be known when using commands on the web screen or RESTAPI.
|
|
144
|
+
- Open the file ```sample/extensions/user_list.yml```. The file should look something like this.
|
|
145
|
+
- This file manages the users and groups that are allowed Web access and their rules.
|
|
146
|
+
- The rule of the previous command is ```allow``` for users in the ```user``` group in ```cmdrule.rules```.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
```yml
|
|
150
|
+
users:
|
|
151
|
+
- uid: 1
|
|
152
|
+
name: admin
|
|
153
|
+
password: XXXXXXXXXXX
|
|
154
|
+
hash: plain
|
|
155
|
+
groups: [admin]
|
|
156
|
+
email: admin@aaa.bbb.jp
|
|
157
|
+
- uid: 101
|
|
158
|
+
name: user01
|
|
159
|
+
password: XXXXXXXXXXX
|
|
160
|
+
hash: md5
|
|
161
|
+
groups: [user]
|
|
162
|
+
email: user01@aaa.bbb.jp
|
|
163
|
+
- uid: 102
|
|
164
|
+
name: user02
|
|
165
|
+
password: XXXXXXXXXXX
|
|
166
|
+
hash: sha1
|
|
167
|
+
groups: [readonly]
|
|
168
|
+
email: user02@aaa.bbb.jp
|
|
169
|
+
- uid: 103
|
|
170
|
+
name: user03
|
|
171
|
+
password: XXXXXXXXXXX
|
|
172
|
+
hash: sha256
|
|
173
|
+
groups: [editor]
|
|
174
|
+
email: user03@aaa.bbb.jp
|
|
175
|
+
groups:
|
|
176
|
+
- gid: 1
|
|
177
|
+
name: admin
|
|
178
|
+
- gid: 101
|
|
179
|
+
name: user
|
|
180
|
+
- gid: 102
|
|
181
|
+
name: readonly
|
|
182
|
+
parent: user
|
|
183
|
+
- gid: 103
|
|
184
|
+
name: editor
|
|
185
|
+
parent: user
|
|
186
|
+
cmdrule:
|
|
187
|
+
policy: deny # allow, deny
|
|
188
|
+
rules:
|
|
189
|
+
- groups: [admin]
|
|
190
|
+
rule: allow
|
|
191
|
+
- groups: [user]
|
|
192
|
+
mode: client
|
|
193
|
+
cmds: [file_download, file_list, server_info]
|
|
194
|
+
rule: allow
|
|
195
|
+
- groups: [user]
|
|
196
|
+
mode: server
|
|
197
|
+
cmds: [list]
|
|
198
|
+
rule: allow
|
|
199
|
+
- groups: [editor]
|
|
200
|
+
mode: client
|
|
201
|
+
cmds: [file_copy, file_mkdir, file_move, file_remove, file_rmdir, file_upload]
|
|
202
|
+
rule: allow
|
|
203
|
+
pathrule:
|
|
204
|
+
policy: deny # allow, deny
|
|
205
|
+
rules:
|
|
206
|
+
- groups: [admin]
|
|
207
|
+
paths: [/]
|
|
208
|
+
rule: allow
|
|
209
|
+
- groups: [user]
|
|
210
|
+
paths: [/signin, /assets, /bbforce_cmd, /copyright, /dosignin, /dosignout,
|
|
211
|
+
/exec_cmd, /exec_pipe, /filer, /gui, /get_server_opt, /usesignout, /versions_cmdbox, /versions_used]
|
|
212
|
+
rule: allow
|
|
213
|
+
- groups: [readonly]
|
|
214
|
+
paths: [/gui/del_cmd, /gui/del_pipe, /gui/save_cmd, /gui/save_pipe]
|
|
215
|
+
rule: deny
|
|
216
|
+
- groups: [editor]
|
|
217
|
+
paths: [/gui/del_cmd, /gui/del_pipe, /gui/save_cmd, /gui/save_pipe]
|
|
218
|
+
rule: allow
|
|
219
|
+
oauth2:
|
|
220
|
+
providers:
|
|
221
|
+
google:
|
|
222
|
+
enabled: false
|
|
223
|
+
client_id: XXXXXXXXXXX
|
|
224
|
+
client_secret: XXXXXXXXXXX
|
|
225
|
+
redirect_uri: https://localhost:8443/oauth2/google/callback
|
|
226
|
+
scope: ['email']
|
|
227
|
+
note:
|
|
228
|
+
- https://developers.google.com/identity/protocols/oauth2/web-server?hl=ja#httprest
|
|
229
|
+
github:
|
|
230
|
+
enabled: false
|
|
231
|
+
client_id: XXXXXXXXXXX
|
|
232
|
+
client_secret: XXXXXXXXXXX
|
|
233
|
+
redirect_uri: https://localhost:8443/oauth2/github/callback
|
|
234
|
+
scope: ['user:email']
|
|
235
|
+
note:
|
|
236
|
+
- https://docs.github.com/ja/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#scopes
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
- See the documentation for references to each file.
|
|
240
|
+
- Documentation is [here](https://hamacom2004jp.github.io/cmdbox/).
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
# Lisence
|
|
244
|
+
|
|
245
|
+
This project is licensed under the MIT License, see the LICENSE file for details
|
|
File without changes
|