Skip to content

Commit

Permalink
v0.2.0, fix for passphrase generation with rekey support for old data…
Browse files Browse the repository at this point in the history
…bases.

Fixed: Some generated database encryption keys fails due incorrect byte/character sequence.
Fixed: is_db_created now also checks app db size, if it's 0 byte it's considered as not initialized.
Added: Better file and console logging support
  • Loading branch information
SuperioOne committed Mar 14, 2024
1 parent 090a4c0 commit 09de073
Show file tree
Hide file tree
Showing 28 changed files with 664 additions and 354 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# v0.2.0 - March 14, 2024
----------------

## Added

- Persisted log files and stdout logging.
- GUI can now be started with different log levels (default is `WARN`) via `keywich gui --log-level <LOG_LEVEL>`.

## Fixes

- **BREAKING** Some master passwords generate invalid database encryption keys. All app databases will be
automatically upgraded to the new passphrase generator. Note that downgrade will not possible after the upgrade.
- A zero-byte `app.db` file no longer breaks profile initialization.

## Known issues

- On Windows, the console is detached from GUI window, making the CLI unusable.
- On Linux, `webkit2gtk >= 2.42.x` when used with Nvidia proprietary drivers, may display an empty window
with the error message `KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied`. Current known solutions are:
- Set `WEBKIT_DISABLE_DMABUF_RENDERER=1` environment variable.
- Enable `nvidia.drm_modeset=1` kernel parameters.
2 changes: 2 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
- [Settings](./settings.md)
- [Shortcuts](./shortcuts.md)
- [CLI](./cli.md)
- [Changelog](./changelog.md)
- [v0.2.0](./changelogs/v0_2_0.md)
1 change: 1 addition & 0 deletions docs/src/chad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
3 changes: 3 additions & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelogs

- [**v0.2.0** - *March 14, 2024*](./changelogs/v0_2_0.md)
27 changes: 27 additions & 0 deletions docs/src/changelogs/v0_2_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# v0.2.0
----------------

<div align="right">

*March 14, 2024*

</div>

## Added

- Persisted log files and stdout logging.
- GUI can now be started with different log levels (default is `WARN`) via `keywich gui --log-level <LOG_LEVEL>`.

## Fixes

- **`BREAKING`** Some master passwords generate invalid database encryption keys. All app databases will be
automatically upgraded to the new passphrase generator. Note that downgrade will not possible after the upgrade.
- A zero-byte `app.db` file no longer breaks profile initialization.

## Known issues

- On Windows, the console is detached from GUI window, making the CLI unusable.
- On Linux, `webkit2gtk >= 2.42.x` when used with Nvidia proprietary drivers, may display an empty window
with the error message `KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied`. Current known solutions are:
- Set `WEBKIT_DISABLE_DMABUF_RENDERER=1` environment variable.
- Enable `nvidia.drm_modeset=1` kernel parameters.
8 changes: 4 additions & 4 deletions docs/src/installation.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Installation

See [GitHub release page](https://github.com/SuperioOne/keywich/releases/tag/v0.1.0) for the all available binaries.
See [GitHub release page](https://github.com/SuperioOne/keywich/releases/tag/v0.2.0) for the all available binaries.

## Linux x86_64 (.deb)

1. Download [`.deb`](https://github.com/SuperioOne/keywich/releases/download/v0.1.0/keywich_0.1.0_amd64.deb) package
1. Download [`.deb`](https://github.com/SuperioOne/keywich/releases/download/v0.2.0/keywich_0.2.0_amd64.deb) package
from GitHub release page.

2. Use `dpkg` to install the package.
Expand All @@ -17,7 +17,7 @@ dpkg -i keywich_0.1.0_amd64.deb

PKGBUILD is created but not added to AUR yet.

1. Download [`PKGBUILD`](https://github.com/SuperioOne/keywich/releases/download/v0.1.0/PKGBUILD) file
1. Download [`PKGBUILD`](https://github.com/SuperioOne/keywich/releases/download/v0.2.0/PKGBUILD) file
from GitHub release page.

2. Use `makepkg` tool to install the package.
Expand All @@ -28,7 +28,7 @@ makepkg --install

## Windows x86_64

Download [`.msi`](https://github.com/SuperioOne/keywich/releases/download/v0.1.0/Keywich_0.1.0_x64_en-US.msi) installer
Download [`.msi`](https://github.com/SuperioOne/keywich/releases/download/v0.2.0/Keywich_0.2.0_x64_en-US.msi) installer
package and execute it.

## From source
Expand Down
6 changes: 3 additions & 3 deletions gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@skeletonlabs/skeleton": "^2.9.0",
"@skeletonlabs/tw-plugin": "^0.3.1",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.3",
"@sveltejs/kit": "^2.5.4",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@tailwindcss/forms": "^0.5.7",
"@types/eslint": "^8.56.5",
Expand All @@ -27,12 +27,12 @@
"postcss": "^8.4.35",
"postcss-load-config": "^5.0.3",
"svelte": "^4.2.12",
"svelte-check": "^3.6.6",
"svelte-check": "^3.6.7",
"svelte-preprocess": "^5.1.3",
"tailwindcss": "^3.4.1",
"tslib": "^2.6.2",
"typescript": "^5.4.2",
"vite": "^5.1.5",
"vite": "^5.1.6",
"vitest": "^1.3.1"
},
"type": "module",
Expand Down
19 changes: 9 additions & 10 deletions gui/src/hooks.client.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import type {LogLevelType} from "$lib";
import {
ApplicationSink, ConsoleSink, LoggerConfigurator, try_parse_log_level,
LogLevel, configStore, i18nStore, RPC, AppEventBus, Log
} from "$lib";
import {env} from "$env/dynamic/public";
import {goto} from "$app/navigation";

const LOG_LEVEL: LogLevelType = try_parse_log_level(env.PUBLIC_KW_LOG_LEVEL) ?? LogLevel.INFO;

LoggerConfigurator([
ConsoleSink(LOG_LEVEL),
ApplicationSink(LOG_LEVEL, 1000)
]);

RPC.load_configs().then(async (app_config) => {
try {
if (app_config.configs) {
const LOG_LEVEL = try_parse_log_level(app_config.log_level) ?? LogLevel.INFO;
LoggerConfigurator.setup([
ConsoleSink(LOG_LEVEL),
ApplicationSink(LOG_LEVEL, 1000)
]);

configStore.init(app_config.configs);

if (app_config.configs?.locale && app_config.locale_keys) {
Expand All @@ -25,9 +22,11 @@ RPC.load_configs().then(async (app_config) => {
available_locales: app_config.available_locales
});
}
} else {
console.error("Application config is empty.");
}
} catch (err) {
Log.error(err);
console.error(err);
}

await AppEventBus.addListener("unlock_required", async () => {
Expand Down
8 changes: 5 additions & 3 deletions gui/src/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ const emitter = new LogEmitter();
*
* @param sinks - The sinks to register with the logger.
*/
export const LoggerConfigurator = (sinks: LoggerSink[]) => {
for (const sink of sinks) {
emitter.register(sink);
export const LoggerConfigurator = {
setup: (sinks: LoggerSink[]) => {
for (const sink of sinks) {
emitter.register(sink);
}
}
};

Expand Down
1 change: 1 addition & 0 deletions gui/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
storePopup.set({computePosition, autoUpdate, flip, shift, offset, arrow});
</script>


<svelte:window
on:contextmenu|preventDefault={() => {}}
on:keydown={(event) => {
Expand Down
1 change: 1 addition & 0 deletions libs/keywich_api/src/api/configs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface AppConfig {
is_db_created: boolean;
locale_keys?: Record<string, string>;
available_locales: string[];
log_level: "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
}

export interface ConfigRPCApi {
Expand Down
Loading

0 comments on commit 09de073

Please sign in to comment.