diff --git a/pyproject.toml b/pyproject.toml index c2bf10e..6daf9db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ voxvera = ["templates/**", "src/**", "resources/**", "locales/**", "resources/bi [project] name = "voxvera" -version = "0.2.4" +version = "0.2.5" description = "VoxVera CLI utilities" readme = "README.md" authors = [{name = "VoxVera"}] diff --git a/voxvera/__init__.py b/voxvera/__init__.py index d08df38..8040ad3 100644 --- a/voxvera/__init__.py +++ b/voxvera/__init__.py @@ -1,7 +1,7 @@ import sys from pathlib import Path -__version__ = "0.2.4" +__version__ = "0.2.5" # Add the vendor directory to sys.path as a fallback. if getattr(sys, 'frozen', False): diff --git a/voxvera/cli.py b/voxvera/cli.py index ceb775d..5bb5645 100644 --- a/voxvera/cli.py +++ b/voxvera/cli.py @@ -1084,14 +1084,15 @@ def batch_import_configs(): def get_servers() -> list[str]: - host_dir = ROOT / "host" - if not host_dir.exists(): - return [] - servers = [] - for d in host_dir.iterdir(): - if d.is_dir() and (d / "config.json").exists(): - servers.append(d.name) - return sorted(servers) + # Check both bundled ROOT/host and local CWD/host + search_paths = [ROOT / "host", Path.cwd() / "host"] + servers = set() + for host_dir in search_paths: + if host_dir.exists(): + for d in host_dir.iterdir(): + if d.is_dir() and (d / "config.json").exists(): + servers.append(d.name) if hasattr(servers, 'append') else servers.add(d.name) + return sorted(list(servers)) def is_server_running(folder_name: str) -> bool: @@ -1259,6 +1260,7 @@ def manage_servers(): running = is_server_running(selected) action_choices = [ Choice("toggle", t("cli.manage_action_toggle_stop") if running else t("cli.manage_action_toggle_start")), + Choice("edit", t("cli.manage_action_edit")), Choice("export", t("cli.manage_action_export")), Choice("delete", t("cli.manage_action_delete")), Choice(None, t("cli.manage_action_back")) @@ -1278,6 +1280,18 @@ def manage_servers(): serve(str(config_path)) except SystemExit: pass + elif action == "edit": + config_path = ROOT / "host" / selected / "config.json" + try: + interactive_update(str(config_path)) + # Re-build assets after update + build_assets(str(config_path)) + console.print(f"[green]✔ {selected} updated and rebuilt successfully.[/green]") + except (KeyboardInterrupt, Exception) as e: + if not isinstance(e, KeyboardInterrupt): + console.print(f"[red]Error updating site: {e}[/red]") + else: + console.print("\n[yellow]Update cancelled.[/yellow]") elif action == "export": export_site(selected) elif action == "delete": diff --git a/voxvera/locales/ar.json b/voxvera/locales/ar.json index 5e20532..611a0c6 100644 --- a/voxvera/locales/ar.json +++ b/voxvera/locales/ar.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] تمهيد Tor: {progress}% ...", "no_urls_qr_skip": "لم يتم تكوين أي روابط بعد. سيتم إنشاء أكواد QR بعد 'voxvera serve'", "input_file_not_found": "ملف الإدخال {path} غير موجود.", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "استخدم متصفح Tor", diff --git a/voxvera/locales/de.json b/voxvera/locales/de.json index cff33d7..444dc23 100644 --- a/voxvera/locales/de.json +++ b/voxvera/locales/de.json @@ -72,7 +72,8 @@ "bootstrapping_progress": "[{name}] Tor-Bootstrapping: {progress}% ...", "no_urls_qr_skip": "Noch keine URLs konfiguriert. QR-Codes werden nach 'voxvera serve' generiert", "input_file_not_found": "Eingabedatei {path} existiert nicht.", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "Tor-Browser verwenden", diff --git a/voxvera/locales/en.json b/voxvera/locales/en.json index f14ca9f..46442ba 100644 --- a/voxvera/locales/en.json +++ b/voxvera/locales/en.json @@ -65,6 +65,7 @@ "manage_action_menu": "Manage {name}:", "manage_action_toggle_stop": "Stop", "manage_action_toggle_start": "Start", + "manage_action_edit": "Edit", "manage_action_export": "Export to Zip", "manage_action_delete": "Delete", "manage_action_back": "Back", diff --git a/voxvera/locales/es.json b/voxvera/locales/es.json index ed97fc7..8c4495e 100644 --- a/voxvera/locales/es.json +++ b/voxvera/locales/es.json @@ -72,7 +72,8 @@ "bootstrapping_progress": "[{name}] Arranque de Tor: {progress}% ...", "no_urls_qr_skip": "No hay URLs configuradas todavía. Los códigos QR se generarán después de 'voxvera serve'", "input_file_not_found": "El archivo de entrada {path} no existe.", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "Use el Navegador Tor", diff --git a/voxvera/locales/fa.json b/voxvera/locales/fa.json index 65eb63b..03f6203 100644 --- a/voxvera/locales/fa.json +++ b/voxvera/locales/fa.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] راه‌اندازی Tor: {progress}% ...", "no_urls_qr_skip": "هنوز آدرسی پیکربندی نشده است. کدهای QR پس از 'voxvera serve' ایجاد می‌شوند", "input_file_not_found": "فایل ورودی {path} وجود ندارد.", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "از مرورگر Tor استفاده کنید", diff --git a/voxvera/locales/fr.json b/voxvera/locales/fr.json index c9695f6..5fdf80a 100644 --- a/voxvera/locales/fr.json +++ b/voxvera/locales/fr.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] Amorçage de Tor : {progress}% ...", "no_urls_qr_skip": "Aucune URL configurée pour le moment. Les codes QR seront générés après 'voxvera serve'", "input_file_not_found": "Le fichier d'entrée {path} n'existe pas.", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "Utilisez le navigateur Tor", diff --git a/voxvera/locales/he.json b/voxvera/locales/he.json index b2fc893..e1df78c 100644 --- a/voxvera/locales/he.json +++ b/voxvera/locales/he.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] איתחול Tor: {progress}% ...", "no_urls_qr_skip": "עדיין לא הוגדרו כתובות URL. קודי QR ייווצרו לאחר 'voxvera serve'", "input_file_not_found": "קובץ הקלט {path} אינו קיים.", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "השתמש בדפדפן Tor", diff --git a/voxvera/locales/hi.json b/voxvera/locales/hi.json index 363a8c8..078b541 100644 --- a/voxvera/locales/hi.json +++ b/voxvera/locales/hi.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] Tor बूटस्ट्रैपिंग: {progress}% ...", "no_urls_qr_skip": "अभी तक कोई URL कॉन्फ़िगर नहीं किया गया है। QR कोड 'voxvera serve' के बाद जेनरेट किए जाएंगे", "input_file_not_found": "इनपुट फ़ाइल {path} मौजूद नहीं है।", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "Tor Browser का उपयोग करें", diff --git a/voxvera/locales/ja.json b/voxvera/locales/ja.json index 7e03846..ecf0e73 100644 --- a/voxvera/locales/ja.json +++ b/voxvera/locales/ja.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] Tor 起動中: {progress}% ...", "no_urls_qr_skip": "URLがまだ設定されていません。QRコードは 'voxvera serve' の後に生成されます", "input_file_not_found": "入力ファイル {path} が存在しません。", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "Tor Browserを使用してください", diff --git a/voxvera/locales/pt.json b/voxvera/locales/pt.json index 658e8d1..d8fee36 100644 --- a/voxvera/locales/pt.json +++ b/voxvera/locales/pt.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] Inicialização do Tor: {progress}% ...", "no_urls_qr_skip": "Nenhuma URL configurada ainda. Os códigos QR serão gerados após 'voxvera serve'", "input_file_not_found": "Arquivo de entrada {path} não existe.", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "Use o Tor Browser", diff --git a/voxvera/locales/ru.json b/voxvera/locales/ru.json index 5493a10..45d7c1b 100644 --- a/voxvera/locales/ru.json +++ b/voxvera/locales/ru.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] Загрузка Tor: {progress}% ...", "no_urls_qr_skip": "URL еще не настроены. QR-коды будут созданы после 'voxvera serve'", "input_file_not_found": "Входной файл {path} не существует.", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "Используйте Tor Browser", diff --git a/voxvera/locales/sw.json b/voxvera/locales/sw.json index 4173a33..de71fa9 100644 --- a/voxvera/locales/sw.json +++ b/voxvera/locales/sw.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] Tor Inapakia: {progress}% ...", "no_urls_qr_skip": "Hakuna URL zilizowekwa bado. QR codes zitaundwa baada ya 'voxvera serve'", "input_file_not_found": "Faili ya kuingiza {path} haipo.", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "Tumia Kivinjari cha Tor", diff --git a/voxvera/locales/tr.json b/voxvera/locales/tr.json index 19f312a..19c5306 100644 --- a/voxvera/locales/tr.json +++ b/voxvera/locales/tr.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] Tor Başlatılıyor: %{progress} ...", "no_urls_qr_skip": "Henüz URL yapılandırılmadı. QR kodları 'voxvera serve' komutundan sonra oluşturulacak", "input_file_not_found": "{path} giriş dosyası mevcut değil.", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "Tor Tarayıcı Kullanın", diff --git a/voxvera/locales/zh.json b/voxvera/locales/zh.json index 1f77dbe..643d55a 100644 --- a/voxvera/locales/zh.json +++ b/voxvera/locales/zh.json @@ -73,7 +73,8 @@ "bootstrapping_progress": "[{name}] Tor 引导中: {progress}% ...", "no_urls_qr_skip": "尚未配置 URL。QR 码将在 'voxvera serve' 后生成", "input_file_not_found": "输入文件 {path} 不存在。", - "attachment_path_label": "Attachment file path (optional - will be served from Tor site)" + "attachment_path_label": "Attachment file path (optional - will be served from Tor site)", + "manage_action_edit": "Edit" }, "web": { "tear_off_tor_browser": "使用 Tor 浏览器",