hiddifypanel 10.80.7__py3-none-any.whl → 10.80.9__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.
Files changed (28) hide show
  1. hiddifypanel/VERSION +1 -1
  2. hiddifypanel/VERSION.py +1 -1
  3. hiddifypanel/base.py +19 -20
  4. hiddifypanel/panel/admin/QuickSetup.py +1 -1
  5. hiddifypanel/panel/admin/SettingAdmin.py +1 -1
  6. hiddifypanel/panel/hiddify.py +7 -6
  7. hiddifypanel/panel/init_db.py +6 -0
  8. hiddifypanel/translations/en/LC_MESSAGES/messages.mo +0 -0
  9. hiddifypanel/translations/en/LC_MESSAGES/messages.po +9 -6
  10. hiddifypanel/translations/fa/LC_MESSAGES/messages.po +6 -3
  11. hiddifypanel/translations/my/LC_MESSAGES/messages.mo +0 -0
  12. hiddifypanel/translations/my/LC_MESSAGES/messages.po +2790 -0
  13. hiddifypanel/translations/pt/LC_MESSAGES/messages.po +3 -0
  14. hiddifypanel/translations/ru/LC_MESSAGES/messages.mo +0 -0
  15. hiddifypanel/translations/ru/LC_MESSAGES/messages.po +6 -3
  16. hiddifypanel/translations/zh/LC_MESSAGES/messages.mo +0 -0
  17. hiddifypanel/translations/zh/LC_MESSAGES/messages.po +3 -0
  18. hiddifypanel/translations.i18n/en.json +7 -6
  19. hiddifypanel/translations.i18n/fa.json +4 -3
  20. hiddifypanel/translations.i18n/my.json +20 -20
  21. hiddifypanel/translations.i18n/pt.json +1 -0
  22. hiddifypanel/translations.i18n/ru.json +4 -3
  23. hiddifypanel/translations.i18n/zh.json +1 -0
  24. {hiddifypanel-10.80.7.dist-info → hiddifypanel-10.80.9.dist-info}/METADATA +1 -1
  25. {hiddifypanel-10.80.7.dist-info → hiddifypanel-10.80.9.dist-info}/RECORD +28 -26
  26. {hiddifypanel-10.80.7.dist-info → hiddifypanel-10.80.9.dist-info}/LICENSE.md +0 -0
  27. {hiddifypanel-10.80.7.dist-info → hiddifypanel-10.80.9.dist-info}/WHEEL +0 -0
  28. {hiddifypanel-10.80.7.dist-info → hiddifypanel-10.80.9.dist-info}/entry_points.txt +0 -0
hiddifypanel/VERSION CHANGED
@@ -1 +1 @@
1
- 10.80.7
1
+ 10.80.9
hiddifypanel/VERSION.py CHANGED
@@ -2,5 +2,5 @@ import importlib.metadata
2
2
  from datetime import datetime
3
3
 
4
4
  __version__ = importlib.metadata.version(__package__ or __name__)
5
- __release_time__= datetime.strptime('2024-12-16T01:49:47','%Y-%m-%dT%H:%M:%S')
5
+ __release_time__= datetime.strptime('2024-12-18T09:28:28','%Y-%m-%dT%H:%M:%S')
6
6
  is_released_version=True
hiddifypanel/base.py CHANGED
@@ -14,10 +14,10 @@ from loguru import logger
14
14
 
15
15
  from dynaconf import FlaskDynaconf
16
16
 
17
- def create_app(*args, cli=False, **config):
18
-
17
+ def create_app(*args, app_mode="web", **config):
18
+
19
19
  app = APIFlask(__name__, static_url_path="/<proxy_path>/static/", instance_relative_config=True, version='2.2.0', title="Hiddify API",
20
- openapi_blueprint_url_prefix="/<proxy_path>/api", docs_ui='elements', json_errors=False, enable_openapi=not cli)
20
+ openapi_blueprint_url_prefix="/<proxy_path>/api", docs_ui='elements', json_errors=False, enable_openapi=app_mode=="web")
21
21
  # app = Flask(__name__, static_url_path="/<proxy_path>/static/", instance_relative_config=True)
22
22
  # app.asgi_app = WsgiToAsgi(app)
23
23
 
@@ -28,20 +28,19 @@ def create_app(*args, cli=False, **config):
28
28
  v = True if v.lower() == "true" else (False if v.lower() == "false" else v)
29
29
  app.config[c] = v
30
30
  dyn=FlaskDynaconf(app,settings_files=[os.environ.get("HIDDIFY_CFG_PATH", 'app.cfg')])
31
-
32
- if cli:
33
- app.config['EXTENSIONS']=[
34
- # "hiddifypanel.cache:init_app",
35
- "hiddifypanel.database:init_app",
36
- "hiddifypanel.panel.hlogger:init_cli",
37
- "hiddifypanel.panel.cli:init_app",
38
- "hiddifypanel.celery:init_app",
39
- ]
31
+
32
+ extensions=[
33
+ # "hiddifypanel.cache:init_app",
34
+ "hiddifypanel.database:init_app",
35
+ "hiddifypanel.panel.hlogger:init_cli",
36
+ ]
37
+
38
+ if app_mode=="celery":
39
+ extensions.append("hiddifypanel.celery:init_app")
40
+ elif app_mode=="cli":
41
+ extensions.append("hiddifypanel.panel.cli:init_app")
40
42
  else:
41
- app.config['EXTENSIONS']=[
42
- # "hiddifypanel.cache:init_app",
43
- "hiddifypanel.database:init_app",
44
- "hiddifypanel.panel.hlogger:init_app",
43
+ extensions.extend([
45
44
  "hiddifypanel.base_setup:init_app",
46
45
  "hiddifypanel.panel.common:init_app",
47
46
  "hiddifypanel.panel.common_bp:init_app",
@@ -50,9 +49,9 @@ def create_app(*args, cli=False, **config):
50
49
  "hiddifypanel.panel.commercial:init_app",
51
50
  "hiddifypanel.panel.node:init_app",
52
51
  "hiddifypanel.celery:init_app",
53
- ]
52
+ ])
54
53
 
55
-
54
+ app.config['EXTENSIONS']=extensions
56
55
 
57
56
  app.config.update(config) # Override with passed config
58
57
 
@@ -67,7 +66,7 @@ def create_app_wsgi(*args, **kwargs):
67
66
  # https://github.com/pallets/flask/issues/4170
68
67
  cli = ("hiddifypanel" in sys.argv[0] ) or (sys.argv[1] in ["update-usage", "all-configs", "admin_links", "admin_path"])
69
68
 
70
- app = create_app(cli=cli)
69
+ app = create_app(app_mode="cli" if cli else "web")
71
70
  return app
72
71
 
73
72
 
@@ -78,5 +77,5 @@ def create_celery_app():
78
77
  # # to be passed to create_app
79
78
  # # https://github.com/pallets/flask/issues/4170
80
79
  # print(kwargs)
81
- app = create_app(cli=True)
80
+ app = create_app(app_mode="celery")
82
81
  return app.extensions["celery"]
@@ -67,7 +67,7 @@ def get_lang_form(empty=False):
67
67
  class LangForm(FlaskForm):
68
68
  step = wtf.HiddenField(default="1")
69
69
  admin_lang = wtf.SelectField(
70
- _("config.admin_lang.label"), choices=[("en", _("lang.en")), ("fa", _("lang.fa")), ("pt", _("lang.pt")), ("zh", _("lang.zh")), ("ru", _("lang.ru"))],
70
+ _("config.admin_lang.label"), choices=[("en", _("lang.en")), ("fa", _("lang.fa")), ("pt", _("lang.pt")), ("zh", _("lang.zh")), ("ru", _("lang.ru")), ("my", _("lang.my"))],
71
71
  description=_("config.admin_lang.description"),
72
72
  default=hconfig(ConfigEnum.admin_lang))
73
73
  # lang=wtf.SelectField(_("config.lang.label"),choices=[("en",_("lang.en")),("fa",_("lang.fa"))],description=_("config.lang.description"),default=hconfig(ConfigEnum.lang))
@@ -216,7 +216,7 @@ def get_config_form():
216
216
  elif c.key == ConfigEnum.lang or c.key == ConfigEnum.admin_lang:
217
217
  field = wtf.SelectField(
218
218
  _(f"config.{c.key}.label"),
219
- choices=[("en", _("lang.en")), ("fa", Markup(_("lang.fa"))), ("zh", _("lang.zh")), ("pt", _("lang.pt")), ("ru", _("lang.ru"))],
219
+ choices=[("en", _("lang.en")), ("fa", Markup(_("lang.fa"))), ("zh", _("lang.zh")), ("pt", _("lang.pt")), ("ru", _("lang.ru")), ("my", _("lang.my"))],
220
220
  description=_(f"config.{c.key}.description"),
221
221
  default=hconfig(c.key))
222
222
  elif c.key == ConfigEnum.country:
@@ -344,18 +344,18 @@ def get_backup_child_unique_id(backupdata: dict) -> str:
344
344
  def all_configs_for_cli():
345
345
  valid_users = [u.to_dict(dump_id=True) for u in User.query.filter((User.usage_limit > User.current_usage)).all() if u.is_active]
346
346
  host_child_ids = [c.id for c in Child.query.filter(Child.mode == ChildMode.virtual).all()]
347
+ domains = Domain.query.filter(Domain.child_id.in_(host_child_ids),~Domain.domain.contains("*")).all()
347
348
  configs = {
348
349
  "users": valid_users,
349
- "domains": [u.to_dict(dump_ports=True, dump_child_id=True) for u in Domain.query.filter(Domain.child_id.in_(host_child_ids)).all() if "*" not in u.domain],
350
+ "domains": [u.to_dict(dump_ports=True, dump_child_id=True) for u in domains],
350
351
  # "hconfigs": get_hconfigs(json=True),
351
352
  "chconfigs": get_hconfigs_childs(host_child_ids, json=True)
352
353
  }
353
354
 
354
- def_user = None if len(User.query.all()) > 1 else User.query.filter(User.name == 'default').first()
355
- domains = Domain.query.all()
356
- sslip_domains = [d.domain for d in domains if "sslip.io" in d.domain]
355
+ def_user = User.query.filter(User.name == 'default').first() if User.query.count() == 1 else None
356
+
357
357
 
358
- configs['chconfigs'][0]['first_setup'] = def_user is not None and len(sslip_domains) > 0
358
+ configs['chconfigs'][0]['first_setup'] = def_user is not None and Domain.query.filter(Domain.domain.contains("sslip.io")).limit(1).count() > 0
359
359
  server_ip = hutils.network.get_ip_str(4)
360
360
  owner = AdminUser.get_super_admin()
361
361
  configs['api_key'] = owner.uuid
@@ -364,9 +364,10 @@ def all_configs_for_cli():
364
364
  configs['panel_links'] = []
365
365
  configs['panel_links'].append(get_account_panel_link(owner, server_ip, is_https=False))
366
366
  configs['panel_links'].append(get_account_panel_link(owner, server_ip))
367
+
367
368
  domains = Domain.get_domains()
368
-
369
369
  for d in domains:
370
370
  configs['panel_links'].append(get_account_panel_link(owner, d.domain))
371
+
371
372
 
372
373
  return configs
@@ -17,6 +17,12 @@ from loguru import logger
17
17
  MAX_DB_VERSION = 100
18
18
 
19
19
 
20
+ def _v98(child_id):
21
+ add_config_if_not_exist(ConfigEnum.path_xhttp,hutils.random.get_random_string(7, 15))
22
+ add_config_if_not_exist(ConfigEnum.xhttp_enable, False)
23
+ db.session.bulk_save_objects(get_proxy_rows_v1())
24
+
25
+
20
26
  def _v97(child_id):
21
27
  keys = hutils.crypto.generate_ssh_host_keys()
22
28
  # set_hconfig(ConfigEnum.ssh_host_dsa_pk, keys['dsa']['pk'])
@@ -10,13 +10,13 @@ msgstr ""
10
10
  " Settings"
11
11
 
12
12
  msgid "%(count)s records were successfully disabled."
13
- msgstr "%(count)s records were successfully disabled."
13
+ msgstr "%(count)s Records were successfully disabled."
14
14
 
15
15
  msgid "%(count)s records were successfully enabled."
16
- msgstr "%(count)s records were successfully enabled."
16
+ msgstr "%(count)s Records were successfully enabled."
17
17
 
18
18
  msgid "%(expire_days)s days"
19
- msgstr "%(expire_days)s days"
19
+ msgstr "%(expire_days)s Days"
20
20
 
21
21
  msgid "%(placeholder)s"
22
22
  msgstr "%(placeholder)s"
@@ -1707,10 +1707,10 @@ msgid "config.path_ws.label"
1707
1707
  msgstr "ℹ️ Path of Websocket Requests"
1708
1708
 
1709
1709
  msgid "config.path_xhttp.description"
1710
- msgstr "This option defines the Path for Split HTTP"
1710
+ msgstr "This option defines the Path for XHTTP"
1711
1711
 
1712
1712
  msgid "config.path_xhttp.label"
1713
- msgstr "ℹ️ Path for Split HTTP"
1713
+ msgstr "ℹ️ Path for XHTTP"
1714
1714
 
1715
1715
  msgid "config.proxies.description"
1716
1716
  msgstr "Define specific proxy settings"
@@ -2383,7 +2383,7 @@ msgstr ""
2383
2383
  "⚠️ <strong>Not Supported in SignBox based Clients. Only <a href=\"https://app.hiddify.com\" target=\"_blank\">Hiddify</a> App, and XRay base Clients are supported.</strong>"
2384
2384
 
2385
2385
  msgid "config.xhttp_enable.label"
2386
- msgstr "🈁 Split HTTP"
2386
+ msgstr "🈁 XHTTP"
2387
2387
 
2388
2388
  msgid "config.xtls_enable.description"
2389
2389
  msgstr "Enables XTLS Protocol"
@@ -2490,6 +2490,9 @@ msgstr "🇺🇸 English"
2490
2490
  msgid "lang.fa"
2491
2491
  msgstr "🇮🇷 Persian - فارسی"
2492
2492
 
2493
+ msgid "lang.my"
2494
+ msgstr "lang.my"
2495
+
2493
2496
  msgid "lang.pt"
2494
2497
  msgstr "🇵🇹 Portuguese - Português "
2495
2498
 
@@ -1692,10 +1692,10 @@ msgid "config.path_ws.label"
1692
1692
  msgstr "ℹ️ مسیر درخواست های Websocket"
1693
1693
 
1694
1694
  msgid "config.path_xhttp.description"
1695
- msgstr "این گزینه مسیر را برای Split HTTP تعریف می کند"
1695
+ msgstr "این گزینه مسیر را برای XHTTP تعریف می کند"
1696
1696
 
1697
1697
  msgid "config.path_xhttp.label"
1698
- msgstr "ℹ️ مسیر برای Split HTTP"
1698
+ msgstr "ℹ️ مسیر برای XHTTP"
1699
1699
 
1700
1700
  msgid "config.proxies.description"
1701
1701
  msgstr "تنظیمات اختصاصی را مشخص کنید"
@@ -2370,7 +2370,7 @@ msgstr ""
2370
2370
  "⚠️<strong>&nbsp;این پروتکل در برنامه های با هسته SingBox پشتیبانی نمیشود. فقط در برنامه <a href=\"https://app.hiddify.com\" target=\"_blank\">Hiddify</a> و برنامه های با هسته XRay پشتیبانی میشود</strong>"
2371
2371
 
2372
2372
  msgid "config.xhttp_enable.label"
2373
- msgstr "🈁 Split HTTP"
2373
+ msgstr "🈁 XHTTP"
2374
2374
 
2375
2375
  msgid "config.xtls_enable.description"
2376
2376
  msgstr "پروتکل XTLS را فعال می کند"
@@ -2476,6 +2476,9 @@ msgstr " 🇺🇸 انگلیسی - English "
2476
2476
  msgid "lang.fa"
2477
2477
  msgstr "🇮🇷 فارسی"
2478
2478
 
2479
+ msgid "lang.my"
2480
+ msgstr ""
2481
+
2479
2482
  msgid "lang.pt"
2480
2483
  msgstr "🇵🇹 پرتغالی - Português "
2481
2484