From 67a7dcdc4b47c58ea8258c7796036d1426545e11 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 12 May 2017 15:59:34 +0200 Subject: [PATCH 01/14] fixes coverity CID 169314 --- main/ui/src/main/java/org/cryptomator/ui/model/AutoUnlocker.java | 1 + 1 file changed, 1 insertion(+) diff --git a/main/ui/src/main/java/org/cryptomator/ui/model/AutoUnlocker.java b/main/ui/src/main/java/org/cryptomator/ui/model/AutoUnlocker.java index 124d1f903..a4a18f109 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/model/AutoUnlocker.java +++ b/main/ui/src/main/java/org/cryptomator/ui/model/AutoUnlocker.java @@ -69,6 +69,7 @@ public class AutoUnlocker { char[] storedPw = keychainAccess.get().loadPassphrase(vault.getId()); if (storedPw == null) { LOG.warn("No passphrase stored in keychain for vault registered for auto unlocking: {}", vault.getPath()); + return; } try { vault.unlock(CharBuffer.wrap(storedPw)); From b53da45a15ee8dbf8a869af4aa43b2ad976c40eb Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 12 May 2017 16:02:55 +0200 Subject: [PATCH 02/14] fixes coverity CID 169315 --- .../java/org/cryptomator/common/settings/SettingsProvider.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/commons/src/main/java/org/cryptomator/common/settings/SettingsProvider.java b/main/commons/src/main/java/org/cryptomator/common/settings/SettingsProvider.java index 2974252db..dfb701489 100644 --- a/main/commons/src/main/java/org/cryptomator/common/settings/SettingsProvider.java +++ b/main/commons/src/main/java/org/cryptomator/common/settings/SettingsProvider.java @@ -97,6 +97,9 @@ public class SettingsProvider implements Provider { try (InputStream in = Files.newInputStream(settingsPath, StandardOpenOption.READ); // Reader reader = new InputStreamReader(in, StandardCharsets.UTF_8)) { settings = gson.fromJson(reader, Settings.class); + if (settings == null) { + throw new IOException("Unexpected EOF"); + } LOG.info("Settings loaded from " + settingsPath); } catch (IOException e) { LOG.info("Failed to load settings, creating new one."); From 10bff4c4fda6d0c7dcd3ac69435c41d5577e0046 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 12 May 2017 16:07:16 +0200 Subject: [PATCH 03/14] fixes coverity CID 167209 --- main/ui/src/main/java/org/cryptomator/ui/model/Vault.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java b/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java index f963c03f6..d615dac5a 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java +++ b/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java @@ -216,7 +216,7 @@ public class Vault { return vaultSettings; } - public String getWebDavUrl() { + public synchronized String getWebDavUrl() { return servlet.getServletRootUri().toString(); } From 05cc248417d0ffa9a2da8d75257574b56ecc01f5 Mon Sep 17 00:00:00 2001 From: Tobias Hagemann Date: Tue, 16 May 2017 13:22:54 +0200 Subject: [PATCH 04/14] fixes startup delay due to dns lookup --- .../org/cryptomator/launcher/InterProcessCommunicator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/launcher/src/main/java/org/cryptomator/launcher/InterProcessCommunicator.java b/main/launcher/src/main/java/org/cryptomator/launcher/InterProcessCommunicator.java index ed72e17be..71ea758e2 100644 --- a/main/launcher/src/main/java/org/cryptomator/launcher/InterProcessCommunicator.java +++ b/main/launcher/src/main/java/org/cryptomator/launcher/InterProcessCommunicator.java @@ -49,6 +49,7 @@ abstract class InterProcessCommunicator implements InterProcessCommunicationProt // visible for testing static InterProcessCommunicator start(Path portFilePath, InterProcessCommunicationProtocol endpoint) throws IOException { + System.setProperty("java.rmi.server.hostname", "localhost"); // try to connect to existing server: int port = readPort(portFilePath); LOG.debug("Connecting to running process on TCP port {}...", port); @@ -95,7 +96,7 @@ abstract class InterProcessCommunicator implements InterProcessCommunicationProt if (port == 0) { throw new ConnectException("Can not connect to port 0."); } - Registry registry = LocateRegistry.getRegistry(port); + Registry registry = LocateRegistry.getRegistry("localhost", port); this.remote = (IpcProtocolRemote) registry.lookup(RMI_NAME); } @@ -127,7 +128,7 @@ abstract class InterProcessCommunicator implements InterProcessCommunicationProt private final IpcProtocolRemoteImpl remote; private ServerCommunicator(InterProcessCommunicationProtocol delegate) throws IOException { - this.socket = new ServerSocket(0, Byte.MAX_VALUE, InetAddress.getLocalHost()); + this.socket = new ServerSocket(0, Byte.MAX_VALUE, InetAddress.getByName("localhost")); RMIClientSocketFactory csf = RMISocketFactory.getDefaultSocketFactory(); SingletonServerSocketFactory ssf = new SingletonServerSocketFactory(socket); this.registry = LocateRegistry.createRegistry(0, csf, ssf); From 2d68e27d3d53ff0c7a6ff4453c7b424a31873fd8 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Tue, 16 May 2017 17:13:03 +0200 Subject: [PATCH 05/14] moved from log4j to logback --- main/launcher/pom.xml | 12 +- .../logging/ConfigurableFileAppender.java | 132 ------------------ .../org/cryptomator/logging/DebugMode.java | 35 ++--- main/launcher/src/main/resources/log4j2.xml | 49 ------- main/launcher/src/test/resources/log4j2.xml | 33 ----- .../src/test/resources/logback-test.xml | 18 +++ main/pom.xml | 19 +-- main/uber-jar/pom.xml | 9 -- .../org/cryptomator/ui/l10n/Localization.java | 8 +- 9 files changed, 51 insertions(+), 264 deletions(-) delete mode 100644 main/launcher/src/main/java/org/cryptomator/logging/ConfigurableFileAppender.java delete mode 100644 main/launcher/src/main/resources/log4j2.xml delete mode 100644 main/launcher/src/test/resources/log4j2.xml create mode 100644 main/launcher/src/test/resources/logback-test.xml diff --git a/main/launcher/pom.xml b/main/launcher/pom.xml index 25ff891e7..0a57682d6 100644 --- a/main/launcher/pom.xml +++ b/main/launcher/pom.xml @@ -42,16 +42,12 @@ - org.apache.logging.log4j - log4j-core + ch.qos.logback + logback-core - org.apache.logging.log4j - log4j-slf4j-impl - - - org.apache.logging.log4j - log4j-jul + ch.qos.logback + logback-classic \ No newline at end of file diff --git a/main/launcher/src/main/java/org/cryptomator/logging/ConfigurableFileAppender.java b/main/launcher/src/main/java/org/cryptomator/logging/ConfigurableFileAppender.java deleted file mode 100644 index a453b1adf..000000000 --- a/main/launcher/src/main/java/org/cryptomator/logging/ConfigurableFileAppender.java +++ /dev/null @@ -1,132 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016 Sebastian Stenzel and others. - * This file is licensed under the terms of the MIT license. - * See the LICENSE.txt file for more info. - * - * Contributors: - * Sebastian Stenzel - initial API and implementation - *******************************************************************************/ -package org.cryptomator.logging; - -import java.io.IOException; -import java.io.Serializable; -import java.net.URISyntaxException; -import java.nio.file.FileSystems; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.regex.Pattern; - -import org.apache.commons.lang3.SystemUtils; -import org.apache.logging.log4j.core.Appender; -import org.apache.logging.log4j.core.Core; -import org.apache.logging.log4j.core.Filter; -import org.apache.logging.log4j.core.Layout; -import org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender; -import org.apache.logging.log4j.core.appender.FileManager; -import org.apache.logging.log4j.core.config.plugins.Plugin; -import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute; -import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory; -import org.apache.logging.log4j.core.config.plugins.validation.constraints.Required; -import org.apache.logging.log4j.util.Strings; - -/** - * A preconfigured FileAppender only relying on a configurable system property, e.g. -Dcryptomator.logPath=/var/log/cryptomator.log.
- * Other than the normal {@link org.apache.logging.log4j.core.appender.FileAppender} paths can be resolved relative to the users home directory. - */ -@Plugin(name = ConfigurableFileAppender.PLUGIN_NAME, category = Core.CATEGORY_NAME, elementType = Appender.ELEMENT_TYPE, printObject = true) -public class ConfigurableFileAppender extends AbstractOutputStreamAppender { - - static final String PLUGIN_NAME = "ConfigurableFile"; - private static final Pattern DRIVE_LETTER_WITH_PRECEEDING_SLASH = Pattern.compile("^/[A-Z]:", Pattern.CASE_INSENSITIVE); - - private ConfigurableFileAppender(String name, Layout layout, Filter filter, boolean ignoreExceptions, boolean immediateFlush, FileManager manager) { - super(name, layout, filter, ignoreExceptions, immediateFlush, manager); - LOGGER.info("Logging to " + manager.getFileName()); - } - - @PluginBuilderFactory - public static > B newBuilder() { - return new Builder().asBuilder(); - } - - /** - * Builds ConfigurableFileAppender instances. - * - * @param - * The type to build - */ - public static class Builder> extends AbstractOutputStreamAppender.Builder // - implements org.apache.logging.log4j.core.util.Builder { - - @Required(message = "No system property name containing the log file path provided.") - @PluginBuilderAttribute("pathPropertyName") - private String pathPropertyName; - - @PluginBuilderAttribute - private boolean append = true; - - @Override - public ConfigurableFileAppender build() { - final String pathProperty = System.getProperty(pathPropertyName); - if (Strings.isEmpty(pathProperty)) { - LOGGER.warn("No log file location provided in system property \"" + pathPropertyName + "\""); - return null; - } - - final Path filePath = parsePath(pathProperty); - if (filePath == null) { - LOGGER.warn("Invalid path \"" + pathProperty + "\""); - return null; - } - - if (!Files.exists(filePath.getParent())) { - try { - Files.createDirectories(filePath.getParent()); - } catch (IOException e) { - LOGGER.error("Could not create parent directories for log file located at " + filePath.toString(), e); - return null; - } - } - - FileManager manager = FileManager.getFileManager(filePath.toString(), append, false, isBufferedIo(), true, null, getOrCreateLayout(), getBufferSize(), getConfiguration()); - return new ConfigurableFileAppender(getName(), getLayout(), getFilter(), isIgnoreExceptions(), isImmediateFlush(), manager); - } - - public B withPathPropertyName(String pathPropertyName) { - this.pathPropertyName = pathPropertyName; - return asBuilder(); - } - - public B withAppend(boolean append) { - this.append = append; - return asBuilder(); - } - - } - - private static Path parsePath(String path) { - if (path.startsWith("~/")) { - // home-dir-relative Path: - final Path userHome = FileSystems.getDefault().getPath(SystemUtils.USER_HOME); - return userHome.resolve(path.substring(2)); - } else if (path.startsWith("/")) { - // absolute Path: - return FileSystems.getDefault().getPath(path); - } else { - // relative Path: - try { - String jarFileLocation = ConfigurableFileAppender.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath(); - if (SystemUtils.IS_OS_WINDOWS && DRIVE_LETTER_WITH_PRECEEDING_SLASH.matcher(jarFileLocation).find()) { - // on windows we need to remove a preceeding slash from "/C:/foo/bar": - jarFileLocation = jarFileLocation.substring(1); - } - final Path workingDir = FileSystems.getDefault().getPath(jarFileLocation).getParent(); - return workingDir.resolve(path); - } catch (URISyntaxException e) { - LOGGER.error("Unable to resolve working directory ", e); - return null; - } - } - } - -} diff --git a/main/launcher/src/main/java/org/cryptomator/logging/DebugMode.java b/main/launcher/src/main/java/org/cryptomator/logging/DebugMode.java index baa6c94f5..56179af08 100644 --- a/main/launcher/src/main/java/org/cryptomator/logging/DebugMode.java +++ b/main/launcher/src/main/java/org/cryptomator/logging/DebugMode.java @@ -6,29 +6,27 @@ package org.cryptomator.logging; import static java.util.Arrays.asList; -import static org.apache.logging.log4j.LogManager.ROOT_LOGGER_NAME; import java.util.Collection; import javax.inject.Inject; import javax.inject.Singleton; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.core.LoggerContext; -import org.apache.logging.log4j.core.config.Configuration; -import org.apache.logging.log4j.core.config.LoggerConfig; import org.cryptomator.common.settings.Settings; -import org.slf4j.Logger; +import org.slf4j.ILoggerFactory; import org.slf4j.LoggerFactory; +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.Logger; +import ch.qos.logback.classic.LoggerContext; + @Singleton public class DebugMode { - private static final Logger LOG = LoggerFactory.getLogger(DebugMode.class); + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(DebugMode.class); private static final Collection LOGGER_UPGRADES = asList( // - loggerUpgrade(ROOT_LOGGER_NAME, Level.INFO), // + loggerUpgrade(org.slf4j.Logger.ROOT_LOGGER_NAME, Level.INFO), // loggerUpgrade("org.cryptomator", Level.TRACE), // loggerUpgrade("org.eclipse.jetty.server.Server", Level.DEBUG) // ); @@ -48,10 +46,13 @@ public class DebugMode { } private void enable() { - LoggerContext context = (LoggerContext) LogManager.getContext(false); - Configuration config = context.getConfiguration(); - LOGGER_UPGRADES.forEach(loggerUpgrade -> loggerUpgrade.execute(config)); - context.updateLoggers(); + ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory(); + if (loggerFactory instanceof LoggerContext) { + LoggerContext context = (LoggerContext) loggerFactory; + LOGGER_UPGRADES.forEach(loggerUpgrade -> loggerUpgrade.execute(context)); + } else { + LOG.warn("SLF4J not bound to Logback."); + } } private static LoggerUpgrade loggerUpgrade(String loggerName, Level minLevel) { @@ -68,10 +69,10 @@ public class DebugMode { this.level = minLevel; } - public void execute(Configuration config) { - LoggerConfig loggerConfig = config.getLoggerConfig(loggerName); - if (loggerConfig.getLevel().isMoreSpecificThan(level)) { - loggerConfig.setLevel(level); + public void execute(LoggerContext context) { + Logger logger = context.getLogger(loggerName); + if (logger.getLevel().isGreaterOrEqual(level)) { + logger.setLevel(level); } } diff --git a/main/launcher/src/main/resources/log4j2.xml b/main/launcher/src/main/resources/log4j2.xml deleted file mode 100644 index 85afbab88..000000000 --- a/main/launcher/src/main/resources/log4j2.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/main/launcher/src/test/resources/log4j2.xml b/main/launcher/src/test/resources/log4j2.xml deleted file mode 100644 index e0ea8ca2b..000000000 --- a/main/launcher/src/test/resources/log4j2.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/main/launcher/src/test/resources/logback-test.xml b/main/launcher/src/test/resources/logback-test.xml new file mode 100644 index 000000000..6c38440e8 --- /dev/null +++ b/main/launcher/src/test/resources/logback-test.xml @@ -0,0 +1,18 @@ + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + diff --git a/main/pom.xml b/main/pom.xml index ced9826b1..c8cc23d83 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -31,8 +31,8 @@ 1.2.2 0.6.0 1.0.2 - 2.8.1 1.7.25 + 1.2.2 4.12 4.12.1 1.3 @@ -119,19 +119,14 @@ ${slf4j.version} - org.apache.logging.log4j - log4j-core - ${log4j.version} + ch.qos.logback + logback-core + ${logback.version} - org.apache.logging.log4j - log4j-slf4j-impl - ${log4j.version} - - - org.apache.logging.log4j - log4j-jul - ${log4j.version} + ch.qos.logback + logback-classic + ${logback.version} diff --git a/main/uber-jar/pom.xml b/main/uber-jar/pom.xml index a16e82cb2..ef23b7fc6 100644 --- a/main/uber-jar/pom.xml +++ b/main/uber-jar/pom.xml @@ -41,17 +41,8 @@ ${project.version} - - - - - com.github.edwgiz - maven-shade-plugin.log4j2-cachefile-transformer - ${log4j.version} - - diff --git a/main/ui/src/main/java/org/cryptomator/ui/l10n/Localization.java b/main/ui/src/main/java/org/cryptomator/ui/l10n/Localization.java index e5876a5ef..b4e0d6a78 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/l10n/Localization.java +++ b/main/ui/src/main/java/org/cryptomator/ui/l10n/Localization.java @@ -46,21 +46,21 @@ public class Localization extends ResourceBundle { String language = Locale.getDefault().getLanguage(); String region = Locale.getDefault().getCountry(); - LOG.info("Detected language \"{}\" and region \"{}\"", language, region); + LOG.debug("Detected language \"{}\" and region \"{}\"", language, region); ResourceBundle localizationBundle = null; if (StringUtils.isNotEmpty(language) && StringUtils.isNotEmpty(region)) { String file = String.format(LOCALIZATION_FILENAME_FMT, language + "_" + region); - LOG.info("Attempting to load localization from: {}", file); + LOG.trace("Attempting to load localization from: {}", file); localizationBundle = loadLocalizationFile(file); } if (StringUtils.isNotEmpty(language) && localizationBundle == null) { String file = String.format(LOCALIZATION_FILENAME_FMT, language); - LOG.info("Attempting to load localization from: {}", file); + LOG.trace("Attempting to load localization from: {}", file); localizationBundle = loadLocalizationFile(file); } if (localizationBundle == null) { - LOG.info("No localization found. Falling back to default language."); + LOG.debug("No localization found. Falling back to default language."); localizationBundle = this.fallback; } this.localized = Objects.requireNonNull(localizationBundle); From e6cd50576798484dd958b684871df562afb307a6 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Tue, 16 May 2017 17:31:15 +0200 Subject: [PATCH 06/14] added logback config for uber-jar, deb and rpm. --- main/ant-kit/src/main/resources/build.xml | 8 ++--- main/ant-kit/src/main/resources/logback.xml | 34 ++++++++++++++++++++ main/uber-jar/src/main/resources/log4j2.xml | 33 ------------------- main/uber-jar/src/main/resources/logback.xml | 19 +++++++++++ 4 files changed, 57 insertions(+), 37 deletions(-) create mode 100644 main/ant-kit/src/main/resources/logback.xml delete mode 100644 main/uber-jar/src/main/resources/log4j2.xml create mode 100644 main/uber-jar/src/main/resources/logback.xml diff --git a/main/ant-kit/src/main/resources/build.xml b/main/ant-kit/src/main/resources/build.xml index 55b8624a1..fe51625c9 100644 --- a/main/ant-kit/src/main/resources/build.xml +++ b/main/ant-kit/src/main/resources/build.xml @@ -29,13 +29,13 @@ - - + + @@ -53,13 +53,13 @@ - - + + diff --git a/main/ant-kit/src/main/resources/logback.xml b/main/ant-kit/src/main/resources/logback.xml new file mode 100644 index 000000000..43ee22c99 --- /dev/null +++ b/main/ant-kit/src/main/resources/logback.xml @@ -0,0 +1,34 @@ + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + ${user.home}/.Cryptomator/cryptomator.log + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + ${user.home}/.Cryptomator/cryptomator.log + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + diff --git a/main/uber-jar/src/main/resources/log4j2.xml b/main/uber-jar/src/main/resources/log4j2.xml deleted file mode 100644 index 9a9ee5032..000000000 --- a/main/uber-jar/src/main/resources/log4j2.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/main/uber-jar/src/main/resources/logback.xml b/main/uber-jar/src/main/resources/logback.xml new file mode 100644 index 000000000..cc4cff54a --- /dev/null +++ b/main/uber-jar/src/main/resources/logback.xml @@ -0,0 +1,19 @@ + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + From d1d3974610790bf03108cb343399ebe8bc38caa5 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Tue, 16 May 2017 17:42:03 +0200 Subject: [PATCH 07/14] updated log config [ci skip] --- main/launcher/src/test/resources/logback-test.xml | 10 ++++++---- main/uber-jar/src/main/resources/logback.xml | 7 ++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/main/launcher/src/test/resources/logback-test.xml b/main/launcher/src/test/resources/logback-test.xml index 6c38440e8..043b6d20a 100644 --- a/main/launcher/src/test/resources/logback-test.xml +++ b/main/launcher/src/test/resources/logback-test.xml @@ -1,7 +1,7 @@ - + @@ -9,10 +9,12 @@ - - + + + + - + diff --git a/main/uber-jar/src/main/resources/logback.xml b/main/uber-jar/src/main/resources/logback.xml index cc4cff54a..721175d1c 100644 --- a/main/uber-jar/src/main/resources/logback.xml +++ b/main/uber-jar/src/main/resources/logback.xml @@ -1,7 +1,7 @@ - + @@ -9,11 +9,12 @@ - + + - + From 24c45c8539e20ad19114fb637edec72252aa2816 Mon Sep 17 00:00:00 2001 From: Tobias Hagemann Date: Tue, 16 May 2017 23:03:51 +0200 Subject: [PATCH 08/14] updated localization [ci skip] --- main/ui/src/main/resources/localization/en.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/ui/src/main/resources/localization/en.txt b/main/ui/src/main/resources/localization/en.txt index 5ddb4c2e6..541808120 100644 --- a/main/ui/src/main/resources/localization/en.txt +++ b/main/ui/src/main/resources/localization/en.txt @@ -15,7 +15,7 @@ main.addDirectory.contextMenu.new=Create New Vault main.addDirectory.contextMenu.open=Open Existing Vault main.directoryList.remove.confirmation.title=Remove Vault main.directoryList.remove.confirmation.header=Do you really want to remove this vault? -main.directoryList.remove.confirmation.content=The vault will only be removed from the list. To permanently delete it, please delete the files from your filesystem. +main.directoryList.remove.confirmation.content=The vault will only be removed from the list. To permanently delete it, please delete the vault from your filesystem. # welcome.fxml welcome.checkForUpdates.label.currentlyChecking=Checking for Updates... @@ -69,7 +69,7 @@ unlock.button.advancedOptions.show=More Options unlock.button.advancedOptions.hide=Less Options unlock.savePassword.delete.confirmation.title=Delete Saved Password unlock.savePassword.delete.confirmation.header=Do you really want to delete the saved password of this vault? -unlock.savePassword.delete.confirmation.content=The saved password of this vault will be immediately deleted from your system keychain. If you'd like to save your password again, you'd have to unlock your vault with the "Save password" option enabled. +unlock.savePassword.delete.confirmation.content=The saved password of this vault will be immediately deleted from your system keychain. If you'd like to save your password again, you'd have to unlock your vault with the "Save Password" option enabled. unlock.choicebox.winDriveLetter.auto=Assign automatically unlock.errorMessage.wrongPassword=Wrong password unlock.errorMessage.mountingFailed=Mounting failed. See log file for details. @@ -99,7 +99,7 @@ unlocked.label.statsDecrypted=decrypted unlocked.ioGraph.yAxis.label=Throughput (MiB/s) unlocked.lock.force.confirmation.title=Locking of %1$s failed unlocked.lock.force.confirmation.header=Do you want to force locking? -unlocked.lock.force.confirmation.content=This may be because other programs are still accessing files in the vault or because some other problem occurred.\n\nPrograms still accessing the files may not work correctly and data not already written by those programs may be lost. +unlocked.lock.force.confirmation.content=This may be because other programs are still accessing files in the vault or because some other problem occurred.\n\nPrograms still accessing the files may not work correctly and data not already written by those programs may be lost. # settings.fxml settings.version.label=Version %s From 63df9a4d8fd4602907b0a6524683ddf8d8aa6ecf Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Wed, 17 May 2017 17:46:29 +0200 Subject: [PATCH 09/14] Added log rotation utility class --- .../logging/LaunchBasedTriggeringPolicy.java | 20 +++++++++++ .../LaunchBasedTriggeringPolicyTest.java | 33 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 main/launcher/src/main/java/org/cryptomator/logging/LaunchBasedTriggeringPolicy.java create mode 100644 main/launcher/src/test/java/org/cryptomator/logging/LaunchBasedTriggeringPolicyTest.java diff --git a/main/launcher/src/main/java/org/cryptomator/logging/LaunchBasedTriggeringPolicy.java b/main/launcher/src/main/java/org/cryptomator/logging/LaunchBasedTriggeringPolicy.java new file mode 100644 index 000000000..a04feebd7 --- /dev/null +++ b/main/launcher/src/main/java/org/cryptomator/logging/LaunchBasedTriggeringPolicy.java @@ -0,0 +1,20 @@ +package org.cryptomator.logging; + +import java.io.File; +import java.util.concurrent.atomic.AtomicBoolean; + +import ch.qos.logback.core.rolling.TriggeringPolicyBase; + +/** + * Triggers a roll-over on the first log event, so each launched application instance will rotate the log. + */ +public class LaunchBasedTriggeringPolicy extends TriggeringPolicyBase { + + private final AtomicBoolean shouldTrigger = new AtomicBoolean(true); + + @Override + public boolean isTriggeringEvent(File activeFile, E event) { + return shouldTrigger.get() && shouldTrigger.getAndSet(false); + } + +} diff --git a/main/launcher/src/test/java/org/cryptomator/logging/LaunchBasedTriggeringPolicyTest.java b/main/launcher/src/test/java/org/cryptomator/logging/LaunchBasedTriggeringPolicyTest.java new file mode 100644 index 000000000..8dd3da4ce --- /dev/null +++ b/main/launcher/src/test/java/org/cryptomator/logging/LaunchBasedTriggeringPolicyTest.java @@ -0,0 +1,33 @@ +package org.cryptomator.logging; + +import java.io.File; + +import org.junit.Assert; +import org.junit.Test; +import org.mockito.Mockito; + +public class LaunchBasedTriggeringPolicyTest { + + @Test + public void testTriggerOnceAndNeverAgain() { + LaunchBasedTriggeringPolicy policy = new LaunchBasedTriggeringPolicy<>(); + File activeFile = Mockito.mock(File.class); + Object event = Mockito.mock(Object.class); + + // 1st invocation + boolean triggered = policy.isTriggeringEvent(activeFile, event); + Assert.assertTrue(triggered); + + // 2nd invocation + triggered = policy.isTriggeringEvent(activeFile, event); + Assert.assertFalse(triggered); + + // 3rd invocation + triggered = policy.isTriggeringEvent(activeFile, event); + Assert.assertFalse(triggered); + + Mockito.verifyZeroInteractions(activeFile); + Mockito.verifyZeroInteractions(event); + } + +} From 1af94c9c21d3926837d2209ed2bc4d856610ed9d Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Wed, 17 May 2017 17:49:57 +0200 Subject: [PATCH 10/14] rotate log files in .rpm and .deb [ci skip] --- main/ant-kit/src/main/resources/logback.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main/ant-kit/src/main/resources/logback.xml b/main/ant-kit/src/main/resources/logback.xml index 43ee22c99..193766d57 100644 --- a/main/ant-kit/src/main/resources/logback.xml +++ b/main/ant-kit/src/main/resources/logback.xml @@ -7,12 +7,21 @@ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - + + ${user.home}/.Cryptomator/cryptomator.log + false + + ${user.home}/.Cryptomator/cryptomator%i.log + 0 + 9 + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + ${user.home}/.Cryptomator/cryptomator.log From 167944e8ed25d8b73c5694f7fd597082554e3042 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 19 May 2017 18:22:00 +0200 Subject: [PATCH 11/14] fixed NPE during startup --- .../src/main/java/org/cryptomator/logging/DebugMode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/launcher/src/main/java/org/cryptomator/logging/DebugMode.java b/main/launcher/src/main/java/org/cryptomator/logging/DebugMode.java index 56179af08..b66a4b75f 100644 --- a/main/launcher/src/main/java/org/cryptomator/logging/DebugMode.java +++ b/main/launcher/src/main/java/org/cryptomator/logging/DebugMode.java @@ -71,7 +71,7 @@ public class DebugMode { public void execute(LoggerContext context) { Logger logger = context.getLogger(loggerName); - if (logger.getLevel().isGreaterOrEqual(level)) { + if (logger != null && logger.getEffectiveLevel().isGreaterOrEqual(level)) { logger.setLevel(level); } } From e5dff4322ab3730c481a763d4ee33b41b6e34d96 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 26 May 2017 13:47:43 +0200 Subject: [PATCH 12/14] moved dagger-compiler as suggested on github.com/google/dagger --- main/commons/pom.xml | 5 ----- main/keychain/pom.xml | 11 ++++++----- main/launcher/pom.xml | 5 ----- main/pom.xml | 7 +++++++ main/ui/pom.xml | 5 ----- 5 files changed, 13 insertions(+), 20 deletions(-) diff --git a/main/commons/pom.xml b/main/commons/pom.xml index fa84ec417..2d4648849 100644 --- a/main/commons/pom.xml +++ b/main/commons/pom.xml @@ -40,11 +40,6 @@ com.google.dagger dagger - - com.google.dagger - dagger-compiler - provided - diff --git a/main/keychain/pom.xml b/main/keychain/pom.xml index d5429fb69..e8e2cc871 100644 --- a/main/keychain/pom.xml +++ b/main/keychain/pom.xml @@ -25,17 +25,18 @@ org.cryptomator jni + + + + com.google.guava + guava + com.google.dagger dagger - - com.google.dagger - dagger-compiler - provided - diff --git a/main/launcher/pom.xml b/main/launcher/pom.xml index 0a57682d6..21cfb26ac 100644 --- a/main/launcher/pom.xml +++ b/main/launcher/pom.xml @@ -34,11 +34,6 @@ com.google.dagger dagger - - com.google.dagger - dagger-compiler - provided - diff --git a/main/pom.xml b/main/pom.xml index c8cc23d83..f25ea06ac 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -326,6 +326,13 @@ 1.8 1.8 + + + com.google.dagger + dagger-compiler + ${dagger.version} + + diff --git a/main/ui/pom.xml b/main/ui/pom.xml index bc21e22f7..3d998b557 100644 --- a/main/ui/pom.xml +++ b/main/ui/pom.xml @@ -84,11 +84,6 @@ com.google.dagger dagger - - com.google.dagger - dagger-compiler - provided - From 0fc2b18f684f5b1850516b6bfad44b8988279589 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 26 May 2017 14:50:37 +0200 Subject: [PATCH 13/14] updated dependencies [ci skip] --- main/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/pom.xml b/main/pom.xml index f25ea06ac..a503e0c0a 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -29,7 +29,7 @@ 1.1.1 1.2.2 - 0.6.0 + 0.6.1 1.0.2 1.7.25 1.2.2 From bff3dbd7778169716f531d34fc3eb75bae099da0 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 26 May 2017 14:51:48 +0200 Subject: [PATCH 14/14] Preparing release --- main/ant-kit/pom.xml | 2 +- main/commons/pom.xml | 2 +- main/jacoco-report/pom.xml | 2 +- main/keychain/pom.xml | 2 +- main/launcher/pom.xml | 2 +- main/pom.xml | 2 +- main/uber-jar/pom.xml | 2 +- main/ui/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main/ant-kit/pom.xml b/main/ant-kit/pom.xml index a2ebbfa6f..be78f8f92 100644 --- a/main/ant-kit/pom.xml +++ b/main/ant-kit/pom.xml @@ -8,7 +8,7 @@ org.cryptomator main - 1.3.0-SNAPSHOT + 1.3.0-rc6 ant-kit pom diff --git a/main/commons/pom.xml b/main/commons/pom.xml index 2d4648849..8ac4900df 100644 --- a/main/commons/pom.xml +++ b/main/commons/pom.xml @@ -10,7 +10,7 @@ org.cryptomator main - 1.3.0-SNAPSHOT + 1.3.0-rc6 commons Cryptomator Commons diff --git a/main/jacoco-report/pom.xml b/main/jacoco-report/pom.xml index 0ad5961f0..62749fd3d 100644 --- a/main/jacoco-report/pom.xml +++ b/main/jacoco-report/pom.xml @@ -5,7 +5,7 @@ org.cryptomator main - 1.3.0-SNAPSHOT + 1.3.0-rc6 jacoco-report Cryptomator Code Coverage Report diff --git a/main/keychain/pom.xml b/main/keychain/pom.xml index e8e2cc871..2f19f9c57 100644 --- a/main/keychain/pom.xml +++ b/main/keychain/pom.xml @@ -3,7 +3,7 @@ org.cryptomator main - 1.3.0-SNAPSHOT + 1.3.0-rc6 keychain System Keychain Access diff --git a/main/launcher/pom.xml b/main/launcher/pom.xml index 21cfb26ac..c0420d976 100644 --- a/main/launcher/pom.xml +++ b/main/launcher/pom.xml @@ -4,7 +4,7 @@ org.cryptomator main - 1.3.0-SNAPSHOT + 1.3.0-rc6 launcher Cryptomator Launcher diff --git a/main/pom.xml b/main/pom.xml index a503e0c0a..98e37939f 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ 4.0.0 org.cryptomator main - 1.3.0-SNAPSHOT + 1.3.0-rc6 pom Cryptomator diff --git a/main/uber-jar/pom.xml b/main/uber-jar/pom.xml index ef23b7fc6..f59da0bc8 100644 --- a/main/uber-jar/pom.xml +++ b/main/uber-jar/pom.xml @@ -5,7 +5,7 @@ org.cryptomator main - 1.3.0-SNAPSHOT + 1.3.0-rc6 uber-jar Single über jar with all dependencies diff --git a/main/ui/pom.xml b/main/ui/pom.xml index 3d998b557..8fa5cd2f5 100644 --- a/main/ui/pom.xml +++ b/main/ui/pom.xml @@ -12,7 +12,7 @@ org.cryptomator main - 1.3.0-SNAPSHOT + 1.3.0-rc6 ui Cryptomator GUI