From 1de4e0fa5ec9fda2d1db97e0cf19de59039fc2dc Mon Sep 17 00:00:00 2001 From: crschnick Date: Mon, 30 Sep 2024 16:22:33 +0000 Subject: [PATCH] Add open docs action --- .../app/core/check/AppJavaOptionsCheck.java | 6 ++++++ .../java/io/xpipe/app/issue/ErrorAction.java | 20 +++++++++++++++++++ .../java/io/xpipe/app/util/Hyperlinks.java | 1 + lang/app/strings/translations_da.properties | 2 ++ lang/app/strings/translations_de.properties | 2 ++ lang/app/strings/translations_en.properties | 4 +++- lang/app/strings/translations_es.properties | 2 ++ lang/app/strings/translations_fr.properties | 2 ++ lang/app/strings/translations_it.properties | 2 ++ lang/app/strings/translations_ja.properties | 2 ++ lang/app/strings/translations_nl.properties | 2 ++ lang/app/strings/translations_pt.properties | 2 ++ lang/app/strings/translations_ru.properties | 2 ++ lang/app/strings/translations_tr.properties | 2 ++ lang/app/strings/translations_zh.properties | 2 ++ 15 files changed, 52 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/core/check/AppJavaOptionsCheck.java b/app/src/main/java/io/xpipe/app/core/check/AppJavaOptionsCheck.java index f552515bd..e351e3c5c 100644 --- a/app/src/main/java/io/xpipe/app/core/check/AppJavaOptionsCheck.java +++ b/app/src/main/java/io/xpipe/app/core/check/AppJavaOptionsCheck.java @@ -1,10 +1,15 @@ package io.xpipe.app.core.check; +import io.xpipe.app.core.AppCache; import io.xpipe.app.issue.ErrorEvent; public class AppJavaOptionsCheck { public static void check() { + if (AppCache.get("javaOptionsWarningShown", Boolean.class,() -> false)) { + return; + } + var env = System.getenv("_JAVA_OPTIONS"); if (env == null) { return; @@ -18,5 +23,6 @@ public class AppJavaOptionsCheck { .noDefaultActions() .expected() .handle(); + AppCache.update("javaOptionsWarningShown", true); } } diff --git a/app/src/main/java/io/xpipe/app/issue/ErrorAction.java b/app/src/main/java/io/xpipe/app/issue/ErrorAction.java index b93ead379..b10c89f9d 100644 --- a/app/src/main/java/io/xpipe/app/issue/ErrorAction.java +++ b/app/src/main/java/io/xpipe/app/issue/ErrorAction.java @@ -5,6 +5,26 @@ import io.xpipe.app.util.Hyperlinks; public interface ErrorAction { + static ErrorAction openDocumentation(String link) { + return new ErrorAction() { + @Override + public String getName() { + return AppI18n.get("openDocumentation"); + } + + @Override + public String getDescription() { + return AppI18n.get("openDocumentationDescription"); + } + + @Override + public boolean handle(ErrorEvent event) { + Hyperlinks.open(link); + return false; + } + }; + } + static ErrorAction reportOnGithub() { return new ErrorAction() { @Override diff --git a/app/src/main/java/io/xpipe/app/util/Hyperlinks.java b/app/src/main/java/io/xpipe/app/util/Hyperlinks.java index 2ef014c49..5bacad2c5 100644 --- a/app/src/main/java/io/xpipe/app/util/Hyperlinks.java +++ b/app/src/main/java/io/xpipe/app/util/Hyperlinks.java @@ -5,6 +5,7 @@ import io.xpipe.app.issue.ErrorEvent; public class Hyperlinks { public static final String DOUBLE_PROMPT = "https://docs.xpipe.io/two-step-connections"; + public static final String AGENT_SETUP = "https://docs.xpipe.io/ssh-agent-socket"; public static final String GITHUB = "https://github.com/xpipe-io/xpipe"; public static final String GITHUB_PTB = "https://github.com/xpipe-io/xpipe"; public static final String PRIVACY = "https://docs.xpipe.io/privacy-policy"; diff --git a/lang/app/strings/translations_da.properties b/lang/app/strings/translations_da.properties index 552cbaf12..ff57075d5 100644 --- a/lang/app/strings/translations_da.properties +++ b/lang/app/strings/translations_da.properties @@ -528,3 +528,5 @@ fileWriteSudoHeader=Den fil, du forsøger at skrive, kræver root-rettigheder. V fileWriteSudoContent=Dette vil automatisk hæve sig til root med enten de angivne legitimationsoplysninger eller via en prompt. dontAllowTerminalRestart=Tillad ikke genstart af terminal dontAllowTerminalRestartDescription=Som standard kan terminalsessioner genstartes, når de er afsluttet inde fra terminalen. For at tillade dette accepterer XPipe disse eksterne anmodninger fra terminalen om at starte sessionen igen\n\nXPipe har ingen kontrol over terminalen, og hvor dette opkald kommer fra, så ondsindede lokale programmer kan også bruge denne funktion til at starte forbindelser gennem XPipe. Ved at deaktivere denne funktion forhindres dette scenarie. +openDocumentation=Åben dokumentation +openDocumentationDescription=Besøg XPipes dokumentationsside for dette problem diff --git a/lang/app/strings/translations_de.properties b/lang/app/strings/translations_de.properties index 152f2c054..30988e65d 100644 --- a/lang/app/strings/translations_de.properties +++ b/lang/app/strings/translations_de.properties @@ -522,3 +522,5 @@ fileWriteSudoHeader=Die Datei, die du zu schreiben versuchst, erfordert Root-Rec fileWriteSudoContent=Dadurch wird automatisch ein Root-Zugang eingerichtet, entweder mit den angegebenen Anmeldedaten oder über eine Eingabeaufforderung. dontAllowTerminalRestart=Terminal-Neustart nicht zulassen dontAllowTerminalRestartDescription=Standardmäßig können Terminalsitzungen neu gestartet werden, nachdem sie vom Terminal aus beendet wurden. Um dies zu ermöglichen, akzeptiert XPipe diese externen Anfragen vom Terminal, um die Sitzung erneut zu starten\n\nXPipe hat keine Kontrolle über das Terminal und darüber, woher dieser Aufruf kommt. Daher können böswillige lokale Anwendungen diese Funktion ebenfalls nutzen, um Verbindungen über XPipe zu starten. Die Deaktivierung dieser Funktion verhindert dieses Szenario. +openDocumentation=Offene Dokumentation +openDocumentationDescription=Besuche die XPipe-Dokumentationsseite zu diesem Thema diff --git a/lang/app/strings/translations_en.properties b/lang/app/strings/translations_en.properties index 4beb44067..d5c8ea7c5 100644 --- a/lang/app/strings/translations_en.properties +++ b/lang/app/strings/translations_en.properties @@ -527,4 +527,6 @@ fileWriteSudoTitle=Sudo file write fileWriteSudoHeader=The file you are trying to write requires root privileges. Do you want to write this file with sudo? fileWriteSudoContent=This will automatically elevate to root with either the provided credentials or via a prompt. dontAllowTerminalRestart=Don't allow terminal restart -dontAllowTerminalRestartDescription=By default, terminal sessions can be restarted after they ended from within the terminal. To allow this, XPipe will accept these external requests from the terminal to launch the session again\n\nXPipe doesn't have any control over the terminal and where this call comes from, so malicious local applications can use this functionality as well to launch connections through XPipe. Disabling this functionality prevents this scenario. \ No newline at end of file +dontAllowTerminalRestartDescription=By default, terminal sessions can be restarted after they ended from within the terminal. To allow this, XPipe will accept these external requests from the terminal to launch the session again\n\nXPipe doesn't have any control over the terminal and where this call comes from, so malicious local applications can use this functionality as well to launch connections through XPipe. Disabling this functionality prevents this scenario. +openDocumentation=Open documentation +openDocumentationDescription=Visit the XPipe docs page for this issue diff --git a/lang/app/strings/translations_es.properties b/lang/app/strings/translations_es.properties index 38c8424b9..7907f7f70 100644 --- a/lang/app/strings/translations_es.properties +++ b/lang/app/strings/translations_es.properties @@ -509,3 +509,5 @@ fileWriteSudoHeader=El archivo que intentas escribir requiere privilegios de roo fileWriteSudoContent=Esto elevará automáticamente a root con las credenciales proporcionadas o a través de un prompt. dontAllowTerminalRestart=No permitir el reinicio del terminal dontAllowTerminalRestartDescription=Por defecto, las sesiones de terminal pueden reiniciarse una vez finalizadas desde dentro del terminal. Para permitirlo, XPipe aceptará estas peticiones externas del terminal para iniciar de nuevo la sesión\n\nXPipe no tiene ningún control sobre el terminal y de dónde procede esta llamada, por lo que las aplicaciones locales maliciosas también pueden utilizar esta funcionalidad para lanzar conexiones a través de XPipe. Deshabilitar esta funcionalidad evita este escenario. +openDocumentation=Documentación abierta +openDocumentationDescription=Visita la página de documentación de XPipe sobre este tema diff --git a/lang/app/strings/translations_fr.properties b/lang/app/strings/translations_fr.properties index 3334757b1..f0ce8c972 100644 --- a/lang/app/strings/translations_fr.properties +++ b/lang/app/strings/translations_fr.properties @@ -509,3 +509,5 @@ fileWriteSudoHeader=Le fichier que tu essaies d'écrire nécessite les privilèg fileWriteSudoContent=Cette opération permet d'accéder automatiquement à la fonction de super-utilisateur à l'aide des informations d'identification fournies ou d'un message d'invite. dontAllowTerminalRestart=Ne pas autoriser le redémarrage du terminal dontAllowTerminalRestartDescription=Par défaut, les sessions de terminal peuvent être relancées après s'être terminées depuis le terminal. Pour permettre cela, XPipe acceptera ces demandes externes du terminal pour relancer la session\n\nXPipe n'a aucun contrôle sur le terminal et sur la provenance de cet appel, de sorte que des applications locales malveillantes peuvent également utiliser cette fonctionnalité pour lancer des connexions par l'intermédiaire de XPipe. La désactivation de cette fonctionnalité permet d'éviter ce scénario. +openDocumentation=Documentation ouverte +openDocumentationDescription=Visite la page de documentation de XPipe pour ce problème diff --git a/lang/app/strings/translations_it.properties b/lang/app/strings/translations_it.properties index 351a0abdd..bc2307ae6 100644 --- a/lang/app/strings/translations_it.properties +++ b/lang/app/strings/translations_it.properties @@ -509,3 +509,5 @@ fileWriteSudoHeader=Il file che stai cercando di scrivere richiede i privilegi d fileWriteSudoContent=In questo modo si eleva automaticamente a root con le credenziali fornite o tramite un prompt. dontAllowTerminalRestart=Non consentire il riavvio del terminale dontAllowTerminalRestartDescription=Per impostazione predefinita, le sessioni del terminale possono essere riavviate dopo la loro conclusione dall'interno del terminale stesso. Per consentire ciò, XPipe accetterà le seguenti richieste esterne dal terminale per avviare nuovamente la sessione\n\nXPipe non ha alcun controllo sul terminale e sulla provenienza di questa chiamata, quindi anche le applicazioni locali malintenzionate possono utilizzare questa funzionalità per avviare connessioni attraverso XPipe. Disabilitando questa funzionalità si evita questo scenario. +openDocumentation=Documentazione aperta +openDocumentationDescription=Visita la pagina dei documenti di XPipe per questo problema diff --git a/lang/app/strings/translations_ja.properties b/lang/app/strings/translations_ja.properties index 697f2edd6..44ea90fcb 100644 --- a/lang/app/strings/translations_ja.properties +++ b/lang/app/strings/translations_ja.properties @@ -509,3 +509,5 @@ fileWriteSudoHeader=書き込もうとしているファイルにはroot権限 fileWriteSudoContent=これは、提供された認証情報またはプロンプト経由で自動的にrootに昇格する。 dontAllowTerminalRestart=端末の再起動を許可しない dontAllowTerminalRestartDescription=デフォルトでは、ターミナル・セッションはターミナル内から終了後に再開することができる。これを可能にするため、XPipeはターミナルからセッションを再び起動するための以下の外部リクエストを受け付ける。\n\nXPipeはターミナルとこの呼び出しの発信元を制御できないため、悪意のあるローカルアプリケーションはこの機能を使用してXPipe経由で接続を開始することができる。この機能を無効にすることで、このシナリオを防ぐことができる。 +openDocumentation=ドキュメントを開く +openDocumentationDescription=この問題のXPipeドキュメントページを見る diff --git a/lang/app/strings/translations_nl.properties b/lang/app/strings/translations_nl.properties index 8ac322a33..73c3cb6df 100644 --- a/lang/app/strings/translations_nl.properties +++ b/lang/app/strings/translations_nl.properties @@ -509,3 +509,5 @@ fileWriteSudoHeader=Het bestand dat je probeert te schrijven vereist rootrechten fileWriteSudoContent=Dit zal automatisch verheffen naar root met de verstrekte inloggegevens of via een prompt. dontAllowTerminalRestart=Terminal opnieuw opstarten niet toestaan dontAllowTerminalRestartDescription=Standaard kunnen terminalsessies opnieuw worden gestart nadat ze vanuit de terminal zijn beëindigd. Om dit mogelijk te maken, accepteert XPipe deze externe verzoeken van de terminal om de sessie opnieuw te starten\n\nXPipe heeft geen controle over de terminal en waar deze oproep vandaan komt, dus kwaadwillende lokale applicaties kunnen deze functionaliteit ook gebruiken om verbindingen via XPipe te starten. Het uitschakelen van deze functionaliteit voorkomt dit scenario. +openDocumentation=Open documentatie +openDocumentationDescription=Bezoek de XPipe docs pagina voor dit probleem diff --git a/lang/app/strings/translations_pt.properties b/lang/app/strings/translations_pt.properties index a3d6d4502..62fac86e2 100644 --- a/lang/app/strings/translations_pt.properties +++ b/lang/app/strings/translations_pt.properties @@ -509,3 +509,5 @@ fileWriteSudoHeader=O ficheiro que estás a tentar escrever requer privilégios fileWriteSudoContent=Isto irá elevar automaticamente para a raiz com as credenciais fornecidas ou através de um prompt. dontAllowTerminalRestart=Não permitir o reinício do terminal dontAllowTerminalRestartDescription=Por defeito, as sessões de terminal podem ser reiniciadas depois de terminarem a partir do terminal. Para permitir isso, o XPipe aceitará essas solicitações externas do terminal para iniciar a sessão novamente\n\nO XPipe não tem qualquer controlo sobre o terminal e sobre a origem desta chamada, pelo que as aplicações locais maliciosas também podem utilizar esta funcionalidade para iniciar ligações através do XPipe. Desativar esta funcionalidade evita este cenário. +openDocumentation=Abre a documentação +openDocumentationDescription=Visita a página de documentação do XPipe para esta questão diff --git a/lang/app/strings/translations_ru.properties b/lang/app/strings/translations_ru.properties index 2befdb227..f91a20fe4 100644 --- a/lang/app/strings/translations_ru.properties +++ b/lang/app/strings/translations_ru.properties @@ -509,3 +509,5 @@ fileWriteSudoHeader=Файл, который ты пытаешься запис fileWriteSudoContent=Это автоматически повысит статус до root либо с помощью предоставленных учетных данных, либо через приглашение. dontAllowTerminalRestart=Не разрешайте перезагрузку терминала dontAllowTerminalRestartDescription=По умолчанию терминальные сессии могут быть перезапущены после их завершения изнутри терминала. Чтобы разрешить это, XPipe будет принимать такие внешние запросы от терминала, чтобы снова запустить сессию\n\nXPipe не имеет никакого контроля над терминалом и тем, откуда поступает этот вызов, поэтому вредоносные локальные приложения могут использовать эту функциональность и для запуска соединений через XPipe. Отключение этой функциональности предотвращает подобный сценарий. +openDocumentation=Открытая документация +openDocumentationDescription=Посетите страницу документации XPipe по этому вопросу diff --git a/lang/app/strings/translations_tr.properties b/lang/app/strings/translations_tr.properties index 037ad1a22..494f83bdf 100644 --- a/lang/app/strings/translations_tr.properties +++ b/lang/app/strings/translations_tr.properties @@ -510,3 +510,5 @@ fileWriteSudoHeader=Yazmaya çalıştığınız dosya root ayrıcalıkları gere fileWriteSudoContent=Bu, sağlanan kimlik bilgileriyle veya bir komut istemi aracılığıyla otomatik olarak kök dizine yükseltme yapacaktır. dontAllowTerminalRestart=Terminalin yeniden başlatılmasına izin verme dontAllowTerminalRestartDescription=Varsayılan olarak, terminal oturumları terminal içinden sonlandırıldıktan sonra yeniden başlatılabilir. Buna izin vermek için XPipe, oturumu tekrar başlatmak üzere terminalden gelen şu harici istekleri kabul edecektir\n\nXPipe terminal ve bu çağrının nereden geldiği üzerinde herhangi bir kontrole sahip değildir, bu nedenle kötü niyetli yerel uygulamalar XPipe üzerinden bağlantı başlatmak için bu işlevi de kullanabilir. Bu işlevselliğin devre dışı bırakılması bu senaryoyu önler. +openDocumentation=Açık dokümantasyon +openDocumentationDescription=Bu sorun için XPipe dokümanlar sayfasını ziyaret edin diff --git a/lang/app/strings/translations_zh.properties b/lang/app/strings/translations_zh.properties index 5e298e551..cdb731b99 100644 --- a/lang/app/strings/translations_zh.properties +++ b/lang/app/strings/translations_zh.properties @@ -509,3 +509,5 @@ fileWriteSudoHeader=您要写入的文件需要 root 权限。你想用 sudo 来 fileWriteSudoContent=这将使用提供的凭据或通过提示自动提升为根用户。 dontAllowTerminalRestart=不允许终端重启 dontAllowTerminalRestartDescription=默认情况下,终端会话可以在终端内部结束后重新启动。为了做到这一点,XPipe 将接受来自终端的这些外部请求,以再次启动会话\n\nXPipe无法控制终端以及该调用的来源,因此恶意本地应用程序也可以使用该功能通过XPipe启动连接。禁用该功能可防止出现这种情况。 +openDocumentation=开放文档 +openDocumentationDescription=访问 XPipe 文档页面了解这一问题