cmdbox 0.6.1.1__py3-none-any.whl → 0.6.2.1__py3-none-any.whl

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.

Potentially problematic release.


This version of cmdbox might be problematic. Click here for more details.

Files changed (75) hide show
  1. cmdbox/app/app.py +7 -0
  2. cmdbox/app/auth/signin.py +7 -3
  3. cmdbox/app/common.py +14 -2
  4. cmdbox/app/commons/loghandler.py +2 -2
  5. cmdbox/app/edge.py +3 -3
  6. cmdbox/app/feature.py +9 -0
  7. cmdbox/app/features/cli/agent_base.py +42 -42
  8. cmdbox/app/features/cli/audit_base.py +28 -28
  9. cmdbox/app/features/cli/cmdbox_audit_createdb.py +28 -28
  10. cmdbox/app/features/cli/cmdbox_audit_delete.py +26 -26
  11. cmdbox/app/features/cli/cmdbox_audit_search.py +42 -42
  12. cmdbox/app/features/cli/cmdbox_audit_write.py +22 -22
  13. cmdbox/app/features/cli/cmdbox_client_file_copy.py +36 -36
  14. cmdbox/app/features/cli/cmdbox_client_file_download.py +38 -38
  15. cmdbox/app/features/cli/cmdbox_client_file_list.py +34 -34
  16. cmdbox/app/features/cli/cmdbox_client_file_mkdir.py +32 -32
  17. cmdbox/app/features/cli/cmdbox_client_file_move.py +34 -34
  18. cmdbox/app/features/cli/cmdbox_client_file_remove.py +32 -32
  19. cmdbox/app/features/cli/cmdbox_client_file_rmdir.py +32 -32
  20. cmdbox/app/features/cli/cmdbox_client_file_upload.py +38 -38
  21. cmdbox/app/features/cli/cmdbox_client_server_info.py +26 -26
  22. cmdbox/app/features/cli/cmdbox_cmd_list.py +22 -21
  23. cmdbox/app/features/cli/cmdbox_cmd_load.py +24 -20
  24. cmdbox/app/features/cli/cmdbox_edge_config.py +40 -40
  25. cmdbox/app/features/cli/cmdbox_edge_start.py +4 -4
  26. cmdbox/app/features/cli/cmdbox_gui_start.py +2 -2
  27. cmdbox/app/features/cli/cmdbox_gui_stop.py +2 -2
  28. cmdbox/app/features/cli/cmdbox_mcp_proxy.py +17 -11
  29. cmdbox/app/features/cli/cmdbox_server_list.py +20 -20
  30. cmdbox/app/features/cli/cmdbox_server_start.py +26 -26
  31. cmdbox/app/features/cli/cmdbox_server_stop.py +26 -26
  32. cmdbox/app/features/cli/cmdbox_web_apikey_add.py +24 -24
  33. cmdbox/app/features/cli/cmdbox_web_apikey_del.py +24 -24
  34. cmdbox/app/features/cli/cmdbox_web_gencert.py +24 -24
  35. cmdbox/app/features/cli/cmdbox_web_genpass.py +20 -20
  36. cmdbox/app/features/cli/cmdbox_web_group_add.py +26 -26
  37. cmdbox/app/features/cli/cmdbox_web_group_del.py +22 -22
  38. cmdbox/app/features/cli/cmdbox_web_group_edit.py +26 -26
  39. cmdbox/app/features/cli/cmdbox_web_group_list.py +22 -22
  40. cmdbox/app/features/cli/cmdbox_web_start.py +65 -65
  41. cmdbox/app/features/cli/cmdbox_web_stop.py +10 -10
  42. cmdbox/app/features/cli/cmdbox_web_user_add.py +32 -32
  43. cmdbox/app/features/cli/cmdbox_web_user_del.py +22 -22
  44. cmdbox/app/features/cli/cmdbox_web_user_edit.py +32 -32
  45. cmdbox/app/features/cli/cmdbox_web_user_list.py +22 -22
  46. cmdbox/app/features/web/cmdbox_web_agent.py +0 -4
  47. cmdbox/app/features/web/cmdbox_web_exec_cmd.py +2 -2
  48. cmdbox/app/mcp.py +316 -120
  49. cmdbox/app/options.py +26 -23
  50. cmdbox/extensions/sample_project/sample/app/features/cli/sample_client_time.py +4 -4
  51. cmdbox/extensions/sample_project/sample/app/features/cli/sample_server_time.py +18 -18
  52. cmdbox/extensions/sample_project/sample/extensions/user_list.yml +4 -0
  53. cmdbox/extensions/user_list.yml +4 -0
  54. cmdbox/licenses/LICENSE_dnspython_2_7_0_ISC_License-ISCL.txt +35 -0
  55. cmdbox/licenses/LICENSE_email_validator_2_2_0_The_Unlicense-Unlicense.txt +27 -0
  56. cmdbox/licenses/files.txt +4 -2
  57. cmdbox/version.py +2 -2
  58. cmdbox/web/agent.html +2 -2
  59. cmdbox/web/assets/cmdbox/audit.js +14 -14
  60. cmdbox/web/assets/cmdbox/common.js +21 -7
  61. cmdbox/web/assets/cmdbox/list_cmd.js +5 -5
  62. cmdbox/web/assets/cmdbox/signin.js +17 -7
  63. cmdbox/web/assets/cmdbox/svgicon.js +3 -3
  64. cmdbox/web/assets/cmdbox/users.js +14 -5
  65. cmdbox/web/audit.html +6 -6
  66. cmdbox/web/signin.html +13 -10
  67. cmdbox/web/users.html +4 -4
  68. {cmdbox-0.6.1.1.dist-info → cmdbox-0.6.2.1.dist-info}/METADATA +27 -23
  69. {cmdbox-0.6.1.1.dist-info → cmdbox-0.6.2.1.dist-info}/RECORD +75 -73
  70. /cmdbox/licenses/{LICENSE_fastmcp_2_9_2_Apache_Software_License.txt → LICENSE_fastmcp_2_10_1_Apache_Software_License.txt} +0 -0
  71. /cmdbox/licenses/{LICENSE_mcp_1_9_4_MIT_License.txt → LICENSE_mcp_1_10_1_MIT_License.txt} +0 -0
  72. {cmdbox-0.6.1.1.dist-info → cmdbox-0.6.2.1.dist-info}/LICENSE +0 -0
  73. {cmdbox-0.6.1.1.dist-info → cmdbox-0.6.2.1.dist-info}/WHEEL +0 -0
  74. {cmdbox-0.6.1.1.dist-info → cmdbox-0.6.2.1.dist-info}/entry_points.txt +0 -0
  75. {cmdbox-0.6.1.1.dist-info → cmdbox-0.6.2.1.dist-info}/top_level.txt +0 -0
@@ -34,54 +34,54 @@ class WebUserEdit(feature.UnsupportEdgeFeature):
34
34
  """
35
35
  return dict(
36
36
  use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False,
37
- discription_ja="Webモードのユーザーを編集します。",
38
- discription_en="Edit users in Web mode.",
37
+ description_ja="Webモードのユーザーを編集します。",
38
+ description_en="Edit users in Web mode.",
39
39
  choice=[
40
40
  dict(opt="host", type=Options.T_STR, default=self.default_host, required=True, multi=False, hide=True, choice=None, web="mask",
41
- discription_ja="Redisサーバーのサービスホストを指定します。",
42
- discription_en="Specify the service host of the Redis server."),
41
+ description_ja="Redisサーバーのサービスホストを指定します。",
42
+ description_en="Specify the service host of the Redis server."),
43
43
  dict(opt="port", type=Options.T_INT, default=self.default_port, required=True, multi=False, hide=True, choice=None, web="mask",
44
- discription_ja="Redisサーバーのサービスポートを指定します。",
45
- discription_en="Specify the service port of the Redis server."),
44
+ description_ja="Redisサーバーのサービスポートを指定します。",
45
+ description_en="Specify the service port of the Redis server."),
46
46
  dict(opt="password", type=Options.T_STR, default=self.default_pass, required=True, multi=False, hide=True, choice=None, web="mask",
47
- discription_ja="Redisサーバーのアクセスパスワード(任意)を指定します。省略時は `password` を使用します。",
48
- discription_en="Specify the access password of the Redis server (optional). If omitted, `password` is used."),
47
+ description_ja="Redisサーバーのアクセスパスワード(任意)を指定します。省略時は `password` を使用します。",
48
+ description_en="Specify the access password of the Redis server (optional). If omitted, `password` is used."),
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
- discription_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
- discription_en="Specify the service name of the inference server. If omitted, `server` is used."),
50
+ description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
+ description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
52
  dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
- discription_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
- discription_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
53
+ description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
+ description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="user_id", type=Options.T_INT, default=None, required=True, multi=False, hide=False, choice=None,
56
- discription_ja="ユーザーIDを指定します。",
57
- discription_en="Specify the user ID."),
56
+ description_ja="ユーザーIDを指定します。",
57
+ description_en="Specify the user ID."),
58
58
  dict(opt="user_name", type=Options.T_STR, default=None, required=True, multi=False, hide=False, choice=None,
59
- discription_ja="ユーザー名を指定します。他のユーザーと重複しないようにしてください。",
60
- discription_en="Specify a user name. Do not duplicate other users."),
59
+ description_ja="ユーザー名を指定します。他のユーザーと重複しないようにしてください。",
60
+ description_en="Specify a user name. Do not duplicate other users."),
61
61
  dict(opt="user_pass", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
62
- discription_ja="ユーザーパスワードを指定します。",
63
- discription_en="Specify the user password."),
62
+ description_ja="ユーザーパスワードを指定します。",
63
+ description_en="Specify the user password."),
64
64
  dict(opt="user_pass_hash", type=Options.T_STR, default='sha1', required=False, multi=False, hide=False, choice=['oauth2', 'saml', 'plain', 'md5', 'sha1', 'sha256'],
65
- discription_ja="ユーザーパスワードのハッシュアルゴリズムを指定します。",
66
- discription_en="Specifies the hash algorithm for user passwords."),
65
+ description_ja="ユーザーパスワードのハッシュアルゴリズムを指定します。",
66
+ description_en="Specifies the hash algorithm for user passwords."),
67
67
  dict(opt="user_email", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
68
- discription_ja="ユーザーメールアドレスを指定します。 `user_pass_hash` が `oauth2` 又は `saml` の時は必須です。",
69
- discription_en="Specify the user email. Required when `user_pass_hash` is `oauth2` or `saml`."),
68
+ description_ja="ユーザーメールアドレスを指定します。 `user_pass_hash` が `oauth2` 又は `saml` の時は必須です。",
69
+ description_en="Specify the user email. Required when `user_pass_hash` is `oauth2` or `saml`."),
70
70
  dict(opt="user_group", type=Options.T_STR, default=None, required=True, multi=True, hide=False, choice=None,
71
- discription_ja="ユーザーが所属するグループを指定します。",
72
- discription_en="Specifies the groups to which the user belongs."),
71
+ description_ja="ユーザーが所属するグループを指定します。",
72
+ description_en="Specifies the groups to which the user belongs."),
73
73
  dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
74
- discription_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
75
- discription_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
74
+ description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
75
+ description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
76
76
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
77
- discription_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力をConsole logに出力します。",
78
- discription_en="Available only in GUI mode. Outputs standard output during command execution to Console log."),
77
+ description_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力をConsole logに出力します。",
78
+ description_en="Available only in GUI mode. Outputs standard output during command execution to Console log."),
79
79
  dict(opt="capture_stdout", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
80
- discription_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力をキャプチャーし、実行結果画面に表示します。",
81
- discription_en="Available only in GUI mode. Captures standard output during command execution and displays it on the execution result screen."),
80
+ description_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力をキャプチャーし、実行結果画面に表示します。",
81
+ description_en="Available only in GUI mode. Captures standard output during command execution and displays it on the execution result screen."),
82
82
  dict(opt="capture_maxsize", type=Options.T_INT, default=self.DEFAULT_CAPTURE_MAXSIZE, required=False, multi=False, hide=True, choice=None,
83
- discription_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力の最大キャプチャーサイズを指定します。",
84
- discription_en="Available only in GUI mode. Specifies the maximum capture size of standard output when executing commands."),
83
+ description_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力の最大キャプチャーサイズを指定します。",
84
+ description_en="Available only in GUI mode. Specifies the maximum capture size of standard output when executing commands."),
85
85
  ]
86
86
  )
87
87
 
@@ -34,39 +34,39 @@ class WebUserList(feature.OneshotResultEdgeFeature):
34
34
  """
35
35
  return dict(
36
36
  use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False,
37
- discription_ja="Webモードのユーザー一覧を取得します。",
38
- discription_en="Get a list of users in Web mode.",
37
+ description_ja="Webモードのユーザー一覧を取得します。",
38
+ description_en="Get a list of users in Web mode.",
39
39
  choice=[
40
40
  dict(opt="host", type=Options.T_STR, default=self.default_host, required=True, multi=False, hide=True, choice=None, web="mask",
41
- discription_ja="Redisサーバーのサービスホストを指定します。",
42
- discription_en="Specify the service host of the Redis server."),
41
+ description_ja="Redisサーバーのサービスホストを指定します。",
42
+ description_en="Specify the service host of the Redis server."),
43
43
  dict(opt="port", type=Options.T_INT, default=self.default_port, required=True, multi=False, hide=True, choice=None, web="mask",
44
- discription_ja="Redisサーバーのサービスポートを指定します。",
45
- discription_en="Specify the service port of the Redis server."),
44
+ description_ja="Redisサーバーのサービスポートを指定します。",
45
+ description_en="Specify the service port of the Redis server."),
46
46
  dict(opt="password", type=Options.T_STR, default=self.default_pass, required=True, multi=False, hide=True, choice=None, web="mask",
47
- discription_ja="Redisサーバーのアクセスパスワード(任意)を指定します。省略時は `password` を使用します。",
48
- discription_en="Specify the access password of the Redis server (optional). If omitted, `password` is used."),
47
+ description_ja="Redisサーバーのアクセスパスワード(任意)を指定します。省略時は `password` を使用します。",
48
+ description_en="Specify the access password of the Redis server (optional). If omitted, `password` is used."),
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
- discription_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
- discription_en="Specify the service name of the inference server. If omitted, `server` is used."),
50
+ description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
+ description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
52
  dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
- discription_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
- discription_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
53
+ description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
+ description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="user_name", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
56
- discription_ja="ユーザー名を指定して取得します。省略した時は全てのユーザーを取得します。",
57
- discription_en="Retrieved by specifying a user name. If omitted, all users are retrieved."),
56
+ description_ja="ユーザー名を指定して取得します。省略した時は全てのユーザーを取得します。",
57
+ description_en="Retrieved by specifying a user name. If omitted, all users are retrieved."),
58
58
  dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
59
- discription_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
60
- discription_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
59
+ description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
60
+ description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
61
61
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
62
- discription_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力をConsole logに出力します。",
63
- discription_en="Available only in GUI mode. Outputs standard output during command execution to Console log."),
62
+ description_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力をConsole logに出力します。",
63
+ description_en="Available only in GUI mode. Outputs standard output during command execution to Console log."),
64
64
  dict(opt="capture_stdout", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
65
- discription_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力をキャプチャーし、実行結果画面に表示します。",
66
- discription_en="Available only in GUI mode. Captures standard output during command execution and displays it on the execution result screen."),
65
+ description_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力をキャプチャーし、実行結果画面に表示します。",
66
+ description_en="Available only in GUI mode. Captures standard output during command execution and displays it on the execution result screen."),
67
67
  dict(opt="capture_maxsize", type=Options.T_INT, default=self.DEFAULT_CAPTURE_MAXSIZE, required=False, multi=False, hide=True, choice=None,
68
- discription_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力の最大キャプチャーサイズを指定します。",
69
- discription_en="Available only in GUI mode. Specifies the maximum capture size of standard output when executing commands."),
68
+ description_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力の最大キャプチャーサイズを指定します。",
69
+ description_en="Available only in GUI mode. Specifies the maximum capture size of standard output when executing commands."),
70
70
  ]
71
71
  )
72
72
 
@@ -1,14 +1,10 @@
1
1
  from cmdbox.app import common, feature
2
2
  from cmdbox.app.auth import signin
3
- from cmdbox.app.commons import convert
4
3
  from cmdbox.app.web import Web
5
4
  from fastapi import FastAPI, Depends, HTTPException, Request, Response, WebSocket
6
5
  from fastapi.responses import HTMLResponse, StreamingResponse
7
6
  from starlette.websockets import WebSocketDisconnect
8
- from pathlib import Path
9
- from starlette.applications import Starlette
10
7
  from starlette.datastructures import UploadFile
11
- from starlette.routing import Mount
12
8
  from typing import Dict, Any, Tuple, List, Union
13
9
  import locale
14
10
  import logging
@@ -182,7 +182,7 @@ class ExecCmd(cmdbox_web_load_cmd.LoadCmd):
182
182
  console = common.create_console(file=old_stdout)
183
183
 
184
184
  try:
185
- console.log(f'EXEC - {opt_list}\n'[:logsize])
185
+ common.console_log(console, f'EXEC - {opt_list}\n'[:logsize])
186
186
  status, ret_main, obj = cmdbox_app.main(args_list=[common.chopdq(o) for o in opt_list], file_dict=file_dict, webcall=True)
187
187
  if isinstance(obj, server.Server):
188
188
  cmdbox_app.sv = obj
@@ -213,7 +213,7 @@ class ExecCmd(cmdbox_web_load_cmd.LoadCmd):
213
213
  except Exception as e:
214
214
  web.logger.disabled = False # ログ出力を有効にする
215
215
  msg = f'exec_cmd error. {traceback.format_exc()}'
216
- console.log(f'EXEC - {msg}'[:logsize])
216
+ common.console_log(console, f'EXEC - {msg}'[:logsize])
217
217
  web.logger.warning(msg)
218
218
  output = [dict(warn=f'<pre>{html.escape(traceback.format_exc())}</pre>')]
219
219
  sys.stdout = old_stdout