diff --git a/app/src/main/java/io/xpipe/app/comp/base/AppMainWindowContentComp.java b/app/src/main/java/io/xpipe/app/comp/base/AppMainWindowContentComp.java index 3aed448a7..a28878967 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/AppMainWindowContentComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/AppMainWindowContentComp.java @@ -100,7 +100,7 @@ public class AppMainWindowContentComp extends SimpleComp { }); var loadingTextCounter = new SimpleIntegerProperty(); - GlobalTimer.scheduleUntil(Duration.ofMillis(300), false, () -> { + GlobalTimer.scheduleUntil(Duration.ofMillis(500), false, () -> { if (loaded.getValue() != null) { return true; } diff --git a/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java b/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java index 2f00f66b0..0ff354485 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java @@ -211,12 +211,10 @@ public class ModalOverlayComp extends SimpleComp { max.set(d); } }); - } - node.minWidthProperty().bind(max); - buttonBar.getChildren().add(node); - if (o instanceof ModalButton) { + node.minWidthProperty().bind(max); node.prefHeightProperty().bind(buttonBar.heightProperty()); } + buttonBar.getChildren().add(node); } content.getChildren().add(buttonBar); AppFontSizes.apply(buttonBar, sizes -> { diff --git a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java index 33bfe7446..914684246 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java @@ -129,7 +129,7 @@ public class AppMainWindow { } public static void loadingText(String key) { - loadingText.setValue(key != null && AppI18n.get() != null ? AppI18n.get(key) : "..."); + loadingText.setValue(key != null && AppI18n.get() != null ? AppI18n.get(key) : "?"); } public static synchronized void initContent() { diff --git a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java index 93194853b..2eac63aba 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java @@ -280,7 +280,7 @@ public final class AppPrefs { final ObjectProperty vaultAuthentication = new GlobalObjectProperty<>(); final ObjectProperty groupSecretStrategy = map(Mapping.builder() - .property(new GlobalObjectProperty<>(new DataStorageGroupStrategy.None())) + .property(new GlobalObjectProperty<>()) .key("groupSecretStrategy") .valueClass(DataStorageGroupStrategy.class) .requiresRestart(true) diff --git a/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java b/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java index 5c107bb5d..87421b4df 100644 --- a/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java @@ -74,7 +74,7 @@ public class VaultCategory extends AppPrefsCategory { authChoice.maxWidth(600); authChoice.disable(Bindings.createBooleanBinding(() -> { return uh.getUserCount() > 0 && prefs.vaultAuthentication.get() == VaultAuthentication.USER || - prefs.groupSecretStrategy.get().requiresUnlock() && prefs.vaultAuthentication.get() == VaultAuthentication.GROUP; + (prefs.groupSecretStrategy.get() != null && prefs.vaultAuthentication.get() == VaultAuthentication.GROUP); }, prefs.vaultAuthentication, prefs.groupSecretStrategy)); builder.addTitle("vault") diff --git a/app/src/main/java/io/xpipe/app/storage/DataStorageGroupStrategy.java b/app/src/main/java/io/xpipe/app/storage/DataStorageGroupStrategy.java index 14d6c6bb7..4c7e102ad 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStorageGroupStrategy.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStorageGroupStrategy.java @@ -24,6 +24,7 @@ import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import lombok.Builder; import lombok.Value; +import lombok.extern.jackson.Jacksonized; import java.io.IOException; import java.net.URI; @@ -41,38 +42,19 @@ public interface DataStorageGroupStrategy { static List> getClasses() { var l = new ArrayList>(); - l.add(None.class); l.add(File.class); l.add(Command.class); l.add(HttpRequest.class); return l; } - default boolean requiresUnlock() { - return true; - } - default void checkComplete() throws ValidationException {} byte[] queryEncryptionSecret() throws Exception; - @JsonTypeName("none") - @Value - public class None implements DataStorageGroupStrategy { - - @Override - public boolean requiresUnlock() { - return false; - } - - @Override - public byte[] queryEncryptionSecret() throws Exception { - throw new UnsupportedOperationException(); - } - } - @JsonTypeName("file") @Builder + @Jacksonized @Value public class File implements DataStorageGroupStrategy { @@ -122,6 +104,7 @@ public interface DataStorageGroupStrategy { @JsonTypeName("command") @Builder + @Jacksonized @Value public class Command implements DataStorageGroupStrategy { @@ -171,6 +154,7 @@ public interface DataStorageGroupStrategy { @JsonTypeName("httpRequest") @Builder + @Jacksonized @Value public class HttpRequest implements DataStorageGroupStrategy { diff --git a/app/src/main/java/io/xpipe/app/storage/StandardStorage.java b/app/src/main/java/io/xpipe/app/storage/StandardStorage.java index 7c6387d38..36d577de2 100644 --- a/app/src/main/java/io/xpipe/app/storage/StandardStorage.java +++ b/app/src/main/java/io/xpipe/app/storage/StandardStorage.java @@ -2,6 +2,7 @@ package io.xpipe.app.storage; import io.xpipe.app.core.AppProperties; import io.xpipe.app.core.mode.AppOperationMode; +import io.xpipe.app.core.window.AppMainWindow; import io.xpipe.app.ext.DataStorageExtensionProvider; import io.xpipe.app.ext.LocalStore; import io.xpipe.app.issue.ErrorEventFactory; @@ -306,6 +307,8 @@ public class StandardStorage extends DataStorage { initVaultKey(); + AppMainWindow.loadingText("unlockingVault"); + try { dataStorageUserHandler.init(); } catch (IOException e) { diff --git a/lang/strings/translations_en.properties b/lang/strings/translations_en.properties index 860c486b9..56b35fdc4 100644 --- a/lang/strings/translations_en.properties +++ b/lang/strings/translations_en.properties @@ -617,6 +617,7 @@ loadingGit=Syncing with git repo loadingGpg=Starting GnuPG daemon for git loadingSettings=Loading settings loadingConnections=Loading connections +unlockingVault=Unlocking vault loadingUserInterface=Loading user interface ptbNotice=Notice for the public test build userDeletionTitle=User deletion @@ -1734,3 +1735,5 @@ commandSecretFieldDescription=The command or script that will return the secret httpRequestSecretField=Request URI vaultAuthentication=Vault authentication vaultAuthenticationDescription=How to authenticate / unlock the vault data. There are multiple different ways of encrypting and unlocking vault data, depending on who you want to share the vault data with. +groupAuthFailed=Secret authentication failed +userAuthFailed=Password authentication failed