mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 17:10:27 +00:00
Fixes
This commit is contained in:
parent
363cb80f88
commit
5dacb65e1a
7 changed files with 101 additions and 23 deletions
|
@ -115,7 +115,10 @@ public class StoreEntryWrapper {
|
||||||
expanded.setValue(entry.isExpanded());
|
expanded.setValue(entry.isExpanded());
|
||||||
persistentState.setValue(entry.getStorePersistentState());
|
persistentState.setValue(entry.getStorePersistentState());
|
||||||
// Use map copy to recognize update
|
// Use map copy to recognize update
|
||||||
|
// This is a synchronized map, so we synchronize the access
|
||||||
|
synchronized (entry.getStoreCache()) {
|
||||||
cache.setValue(new HashMap<>(entry.getStoreCache()));
|
cache.setValue(new HashMap<>(entry.getStoreCache()));
|
||||||
|
}
|
||||||
color.setValue(entry.getColor());
|
color.setValue(entry.getColor());
|
||||||
|
|
||||||
busy.setValue(entry.isInRefresh());
|
busy.setValue(entry.isInRefresh());
|
||||||
|
|
|
@ -90,6 +90,10 @@ public class AppI18n {
|
||||||
private static String getCallerModuleName() {
|
private static String getCallerModuleName() {
|
||||||
var callers = CallingClass.INSTANCE.getCallingClasses();
|
var callers = CallingClass.INSTANCE.getCallingClasses();
|
||||||
for (Class<?> caller : callers) {
|
for (Class<?> caller : callers) {
|
||||||
|
if (caller.isSynthetic()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (caller.equals(CallingClass.class)
|
if (caller.equals(CallingClass.class)
|
||||||
|| caller.equals(ModuleHelper.class)
|
|| caller.equals(ModuleHelper.class)
|
||||||
|| caller.equals(ModalOverlayComp.class)
|
|| caller.equals(ModalOverlayComp.class)
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
package io.xpipe.app.storage;
|
package io.xpipe.app.storage;
|
||||||
|
|
||||||
import io.xpipe.app.ext.DataStoreProvider;
|
|
||||||
import io.xpipe.app.ext.DataStoreProviders;
|
|
||||||
import io.xpipe.app.issue.ErrorEvent;
|
|
||||||
import io.xpipe.app.util.FixedHierarchyStore;
|
|
||||||
import io.xpipe.core.store.*;
|
|
||||||
import io.xpipe.core.util.JacksonMapper;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
import io.xpipe.app.ext.DataStoreProvider;
|
||||||
|
import io.xpipe.app.ext.DataStoreProviders;
|
||||||
|
import io.xpipe.app.issue.ErrorEvent;
|
||||||
|
import io.xpipe.app.util.FixedHierarchyStore;
|
||||||
|
import io.xpipe.core.store.*;
|
||||||
|
import io.xpipe.core.util.JacksonMapper;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.NonFinal;
|
import lombok.experimental.NonFinal;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
@ -26,7 +25,7 @@ import java.util.stream.Collectors;
|
||||||
@Value
|
@Value
|
||||||
public class DataStoreEntry extends StorageElement {
|
public class DataStoreEntry extends StorageElement {
|
||||||
|
|
||||||
Map<String, Object> storeCache = new LinkedHashMap<>();
|
Map<String, Object> storeCache = Collections.synchronizedMap(new HashMap<>());
|
||||||
|
|
||||||
@NonFinal
|
@NonFinal
|
||||||
Validity validity;
|
Validity validity;
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package io.xpipe.app.util;
|
package io.xpipe.app.util;
|
||||||
|
|
||||||
import io.xpipe.app.issue.ErrorEvent;
|
|
||||||
import io.xpipe.core.process.CommandBuilder;
|
|
||||||
import io.xpipe.core.process.ShellControl;
|
|
||||||
|
|
||||||
import com.sun.jna.platform.win32.Advapi32Util;
|
import com.sun.jna.platform.win32.Advapi32Util;
|
||||||
import com.sun.jna.platform.win32.WinReg;
|
import com.sun.jna.platform.win32.WinReg;
|
||||||
|
import io.xpipe.app.issue.ErrorEvent;
|
||||||
|
import io.xpipe.core.process.CommandBuilder;
|
||||||
|
import io.xpipe.core.process.ShellControl;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@ -47,6 +46,33 @@ public class WindowsRegistry {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean remoteKeyExists(ShellControl shellControl, int hkey, String key) throws Exception {
|
||||||
|
var command = CommandBuilder.of()
|
||||||
|
.add("reg", "query")
|
||||||
|
.addQuoted((hkey == HKEY_LOCAL_MACHINE ? "HKEY_LOCAL_MACHINE" : "HKEY_CURRENT_USER") + "\\" + key)
|
||||||
|
.add("/ve");
|
||||||
|
try (var c = shellControl.command(command).start()) {
|
||||||
|
return c.discardAndCheckExit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Optional<String> findRemoteValuesRecursive(ShellControl shellControl, int hkey, String key, String valueName) throws Exception {
|
||||||
|
var command = CommandBuilder.of()
|
||||||
|
.add("reg", "query")
|
||||||
|
.addQuoted((hkey == HKEY_LOCAL_MACHINE ? "HKEY_LOCAL_MACHINE" : "HKEY_CURRENT_USER") + "\\" + key)
|
||||||
|
.add("/v")
|
||||||
|
.addQuoted(valueName)
|
||||||
|
.add("/s");
|
||||||
|
try (var c = shellControl.command(command).start()) {
|
||||||
|
var output = c.readStdoutDiscardErr();
|
||||||
|
if (c.getExitCode() != 0) {
|
||||||
|
return Optional.empty();
|
||||||
|
} else {
|
||||||
|
return Optional.of(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Optional<String> readRemoteString(ShellControl shellControl, int hkey, String key, String valueName)
|
public static Optional<String> readRemoteString(ShellControl shellControl, int hkey, String key, String valueName)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
var command = CommandBuilder.of()
|
var command = CommandBuilder.of()
|
||||||
|
|
|
@ -303,4 +303,8 @@ rdpTunnel.displayName=RDP connection over SSH
|
||||||
rdpTunnel.displayDescription=Connect via RDP over a tunneled SSH connection
|
rdpTunnel.displayDescription=Connect via RDP over a tunneled SSH connection
|
||||||
rdpEnableDesktopIntegration=Enable desktop integration
|
rdpEnableDesktopIntegration=Enable desktop integration
|
||||||
rdpEnableDesktopIntegrationDescription=Run remote applications assuming that the RDP allow list permits that
|
rdpEnableDesktopIntegrationDescription=Run remote applications assuming that the RDP allow list permits that
|
||||||
|
rdpSetupAdminTitle=RDP setup required
|
||||||
|
rdpSetupAllowTitle=RDP remote application
|
||||||
|
rdpSetupAllowHeader=Starting remote applications directly is currently not allowed on this system. Do you want to enable it?
|
||||||
|
rdpSetupAllowContent=This will allow you to run your remote applications directly from XPipe by disabling the allow list for RDP remote applications.
|
||||||
|
|
||||||
|
|
36
lang/proc/texts/rdpFileAllowListCheck_en.md
Normal file
36
lang/proc/texts/rdpFileAllowListCheck_en.md
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# RDP remote applications
|
||||||
|
|
||||||
|
You can use RDP connections in XPipe to quickly launch remote applications and scripts without opening a full desktop. However, due to the nature of RDP, you have to edit the remote application allow list on your server for this to work.
|
||||||
|
|
||||||
|
## RDP allow lists
|
||||||
|
|
||||||
|
An RDP server uses the concept of allow lists to handle application launches. This essentially means that unless the allow list is disabled or specific applications have been explicitly added the allow list, launching any remote applications directly will fail.
|
||||||
|
|
||||||
|
You can find the allow list settings in the registry of your server at `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList`.
|
||||||
|
|
||||||
|
### Allowing all applications
|
||||||
|
|
||||||
|
You can disable the allow list to allow all remote applications to be started directly from XPipe. For this, you can run the following command on your server in PowerShell: `Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList' -Name "fDisabledAllowList" -Value 1`.
|
||||||
|
|
||||||
|
### Adding allowed applications
|
||||||
|
|
||||||
|
Alternatively, you can also add individual remote applications to the list. This will then allow you to launch the listed applications directly from XPipe.
|
||||||
|
|
||||||
|
Under the `Applications` key of `TSAppAllowList`, create a new key with some arbitrary name. The only requirement for the name is that it is unique within the children of the “Applications” key. This new key, must have these values in it: `Name`, `Path` and `CommandLineSetting`. You can do this in PowerShell with the following commands:
|
||||||
|
|
||||||
|
```
|
||||||
|
$appName="Notepad"
|
||||||
|
$appPath="C:\Windows\System32\notepad.exe"
|
||||||
|
|
||||||
|
$regKey="HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications"
|
||||||
|
New-item -Path "$regKey\$appName"
|
||||||
|
New-ItemProperty -Path "$regKey\$appName" -Name "Name" -Value "$appName" -Force
|
||||||
|
New-ItemProperty -Path "$regKey\$appName" -Name "Path" -Value "$appPath" -Force
|
||||||
|
New-ItemProperty -Path "$regKey\$appName" -Name "CommandLineSetting" -Value "1" -PropertyType DWord -Force
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to allow XPipe to also run scripts and open terminal sessions, you have to add `C:\Windows\System32\cmd.exe` to the allow list as well.
|
||||||
|
|
||||||
|
## Security considerations
|
||||||
|
|
||||||
|
This does not make your server insecure in any way, as you can always run the same applications manually when launching an RDP connection. Allow lists are more intended to prevent clients from instantly running any application without user input. At the end of the day, it is up to you whether you trust XPipe to do this. You can launch this connection just fine out of the box, this is only useful if you want to use any of the advanced desktop integration features in XPipe.
|
|
@ -1,32 +1,38 @@
|
||||||
## RDP desktop integration
|
# RDP desktop integration
|
||||||
|
|
||||||
You can use this RDP connection in XPipe to quickly launch applications and scripts. However, due to the nature of RDP, you have to edit the remote application allow list on your server for this to work. Furthermore, this option enables drive sharing to execute your scripts on your remote server.
|
You can use this RDP connection in XPipe to quickly launch applications and scripts. However, due to the nature of RDP, you have to edit the remote application allow list on your server for this to work. Furthermore, this option enables drive sharing to execute your scripts on your remote server.
|
||||||
|
|
||||||
You can also choose not to do this and just use XPipe to launch your RDP client without using any advanced desktop integration features.
|
You can also choose not to do this and just use XPipe to launch your RDP client without using any advanced desktop integration features.
|
||||||
|
|
||||||
### RDP allow lists
|
## RDP allow lists
|
||||||
|
|
||||||
An RDP server uses the concept of allow lists to handle application launches. This essentially means that unless the allow list is disabled or specific applications have been explicitly added the allow list, launching any remote applications directly will fail.
|
An RDP server uses the concept of allow lists to handle application launches. This essentially means that unless the allow list is disabled or specific applications have been explicitly added the allow list, launching any remote applications directly will fail.
|
||||||
|
|
||||||
You can find the allow list settings in the registry of your server at `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList`.
|
You can find the allow list settings in the registry of your server at `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList`.
|
||||||
|
|
||||||
#### Disabling the allow list
|
### Allowing all applications
|
||||||
|
|
||||||
You can disable the allow list concept to allow all remote applications to be started directly from XPipe. For this, you can run the following command on your server: `Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList' -Name "fDisabledAllowList" -Value 1`.
|
You can disable the allow list to allow all remote applications to be started directly from XPipe. For this, you can run the following command on your server in PowerShell: `Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList' -Name "fDisabledAllowList" -Value 1`.
|
||||||
|
|
||||||
#### Adding allowed applications
|
### Adding allowed applications
|
||||||
|
|
||||||
Alternatively, you can also add individual remote applications to the list. This will then allow you to launch the listed applications directly from XPipe.
|
Alternatively, you can also add individual remote applications to the list. This will then allow you to launch the listed applications directly from XPipe.
|
||||||
|
|
||||||
Under the `Applications` key of `TSAppAllowList`, create a new key with some arbitrary name. The only requirement for the name is that it is unique within the children of the “Applications” key. This new key, must have two string values in it: `Name` and `Path`. `Name` is the name by which we will refer to the application later when configuring the client, and `Path` is the path to the application on the server. You can do this in PowerShell with the following commands:
|
Under the `Applications` key of `TSAppAllowList`, create a new key with some arbitrary name. The only requirement for the name is that it is unique within the children of the “Applications” key. This new key, must have these values in it: `Name`, `Path` and `CommandLineSetting`. You can do this in PowerShell with the following commands:
|
||||||
|
|
||||||
```
|
```
|
||||||
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications\<MyApplication>' -Name "Name" -Value "<MyApplication>" -Force
|
$appName="Notepad"
|
||||||
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications\<MyApplication>' -Name "Path" -Value "<absolute path of executable>" -Force
|
$appPath="C:\Windows\System32\notepad.exe"
|
||||||
|
|
||||||
|
$regKey="HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications"
|
||||||
|
New-item -Path "$regKey\$appName"
|
||||||
|
New-ItemProperty -Path "$regKey\$appName" -Name "Name" -Value "$appName" -Force
|
||||||
|
New-ItemProperty -Path "$regKey\$appName" -Name "Path" -Value "$appPath" -Force
|
||||||
|
New-ItemProperty -Path "$regKey\$appName" -Name "CommandLineSetting" -Value "1" -PropertyType DWord -Force
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to allow XPipe to also run scripts and open terminal sessions, you have to add `cmd.exe` to the allow list as well.
|
If you want to allow XPipe to also run scripts and open terminal sessions, you have to add `C:\Windows\System32\cmd.exe` to the allow list as well.
|
||||||
|
|
||||||
### Security considerations
|
## Security considerations
|
||||||
|
|
||||||
This does not make your server insecure in any way, as you can always run the same applications manually when launching an RDP connection. Allow lists are more intended to prevent clients from instantly running any application without user input. At the end of the day, it is up to you whether you trust XPipe to do this. You can launch this connection just fine out of the box, this is only useful if you want to use any of the advanced desktop integration features in XPipe.
|
This does not make your server insecure in any way, as you can always run the same applications manually when launching an RDP connection. Allow lists are more intended to prevent clients from instantly running any application without user input. At the end of the day, it is up to you whether you trust XPipe to do this. You can launch this connection just fine out of the box, this is only useful if you want to use any of the advanced desktop integration features in XPipe.
|
||||||
|
|
Loading…
Reference in a new issue