Skip to content

Commit

Permalink
mdbook docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperioOne committed Mar 9, 2024
1 parent cac86cf commit 681e8e7
Show file tree
Hide file tree
Showing 25 changed files with 481 additions and 165 deletions.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
book
9 changes: 9 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[book]
authors = ["Timur Olur"]
language = "en"
multilingual = false
src = "src"
title = "Keywich Docs"
[output.html]
preferred-dark-theme = "ayu"
default-theme = "dark"
13 changes: 13 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Summary

- [Introduction](./introduction.md)
- [Installation (Linux)](./installation_linux.md)
- [Installation (Windows)](./installation_windows.md)
- [How to Use](./how_to_use.md)
- [Setup Profile](./setup_profile.md)
- [Charsets](./charsets.md)
- [Managing Keys](./managing_keys.md)
- [Key Parameters](./key_parameters.md)
- [Settings](./settings.md)
- [Shortcuts](./shortcuts.md)
- [CLI](./cli.md)
61 changes: 61 additions & 0 deletions docs/src/charsets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Charsets

The Actual generated password is a fixed-size binary blob based on target length [^charset], which is then converted to
text within a given character range by charset. This is useful when a site or application does not allow certain
characters.

By default, three character sets are created:

- Numeric `0..9`
- Alpha Numeric `a..zA..Z0..9`
- Alpha `a..zA..Z`

## Charset pattern rules

1. The order of range and characters do not matter. For example, `_-!a..zA..Z` and `A..Z_-a..z!` will produce the
same charset.
2. Duplicate values and ranges are ignored. For instance, `__A..Z__A..Z__A..Z__` is parsed as `A..Z_`
3. The left-hand side of a range should be smaller than the right-hand side. Ranges such as `k..a` and `9..1` are not
accepted.
4. Ranges are case-sensitive. Avoid mixing cases like `A..z`.

Example charset pattern with complex symbols:

```
A..Za..z0..9#-_'`"><)(%.,!$€£*+~:;{}[]&
```

Example charset pattern with German alphabet:

```
A..Za..z0..9ÄäÖöẞßÜü
```

## Managing charsets

1. Open **Settings** > **Charsets** and click the **Create** button to create a new charset.
2. Enter a unique charset name.
3. Enter the charset pattern.
4. (Optional) Add a description for the charset.
5. Confirm.
6. New charset will be available when modifying or creating keys.

<div class="warning">

> Deleting a charset and creating a different one with the identical name does not affect existing keys. They will
> continue using the prior one to prevent any unintended password changes.
</div>

## Syntax definition

> *ALPHA_LC* = ASCII lowercase characters\
> *ALPHA_UC* = ASCII uppercase characters\
> *NUMERIC* = ASCII Digits\
> *UTF8* = Any valid UTF8 character\
> *range* = (`ALPHA_LC` ".." `ALPHA_LC`) / (`ALPHA_UP` ".." `ALPHA_UP`) / (`NUMERIC` ".." `NUMERIC`)\
> *content* = `range` / `UTF8`\
> *charset* = 1*`content`

[^charset]: [Target length](./key_parameters.md#target-length) is a key parameter.
35 changes: 35 additions & 0 deletions docs/src/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# CLI

The password generator can be also accessed via the command-line interface (CLI) for general-purpose usage or when you
don't have access to your graphical desktop environment. To view CLI command and options details use `keywich --help`.

> Current version is limited with password generator only. It does not have access to your profile database.
```shell
Usage: keywich generate [OPTIONS] --domain <DOMAIN> --charset <CHARSET> --username <USERNAME>
--target-length <TARGET_LENGTH>

Options:
-d, --domain <DOMAIN> Domain for password
-c, --charset <CHARSET> Password character set
-u, --username <USERNAME> Username for password
-t, --target-length <TARGET_LENGTH> Password target length
-p, --password <PASSWORD> Password
-o, --output-type <OUTPUT_TYPE> Password output type [default: text] [possible values:
phc, text, base64, json, qr]
--revision <REVISION> Seed number [default: 0]
-h, --help Print help
```

Examples:

```shell
keywich generate -d myserver -u admin -t 6 -c A..Za..z0..9 -p pass12345 -o base64
# a3J5Tmlh

keywich generate -d myserver -u admin -t 6 -c A..Za..z0..9 -p pass12345 -o text
# kryNia

keywich generate -d myserver -u admin -t 6 -c A..Za..z0..9 -p pass12345 -o phc
# $kw_scrypt$v=v1$kryNia
```
9 changes: 9 additions & 0 deletions docs/src/how_to_use.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# How to Use

In this section you will learn;
- [How to setup profile](./setup_profile.md)
- [How to create character sets](./charsets.md)
- [Changing application settings](./settings.md)
- [Managing keys](./managing_keys.md)
- [Application shortcuts](./shortcuts.md)
- [Using command line](./cli.md)
Binary file added docs/src/images/advanced_copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/initialization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/keywich_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/src/installation_linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Linux
1 change: 1 addition & 0 deletions docs/src/installation_windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Windows
52 changes: 52 additions & 0 deletions docs/src/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Introduction

<div align="center">

![Keywich Icon](./images/keywich_icon.png)

</div>
<br>
<br>

Keywich is a password generator application built with Rust, [SvelteKit](https://kit.svelte.dev/),
[Skeleton UI](https://www.skeleton.dev/) and [Tauri](https://tauri.app/). The app does not store generated passwords.
Instead, it combines parameters such as the username, domain, and master password with a bit of salt and a hashing
algorithm to create reproducible passwords with the specified length and character sets.

<br>

```
Application architecture overview
┌───────────────────┐ ┌──────────────────┐
│ OS Keyring │ │ Profile Database │
│ │ │ │
│ - Master Password │ │ - Charsets │
└─────────┬─────────┘ │ - Domains │
│ │ - Usernames │
│ │ - Tags │
│ └────────┬─────────┘
│ │
└─────────┐ ┌─────────┘
│ │ Input in, password out
▼ ▼ Nothing stored
┌────────────────────────────────────────────┐ ┌───────────────┐
│ Tauri App │ │ CLI App │
└─────────────────────┬──────────────────────┘ └───────┬───────┘
│ │
└───────┐ ┌───────────────────┘
│ │
│ │
▼ ▼
┌───────────────────────────────────────────────────────────────────────────┐
│ Keywich Password │
│ Generator │
└─────────────────────────────────────┬─────────────────────────────────────┘
┌────────────────────┐
│ Generated Password │
└────────────────────┘
```


37 changes: 37 additions & 0 deletions docs/src/key_parameters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Key Parameters

## Domain

The Service name. The domain is used for generating password and is **case-insensitive**.

## Username

Identification for who is accessing the service. The username is used for generating password and is **case-sensitive**.

## Revision no

Password seed number. Changing this value will result in a new password being generated.

If you ever need to update your password for same username, simply increment or change this value.

## Target length

The desired password length. Currently supports maximum 64 characters. Changing this value will result in a new password
being generated.

## Charset

Defines the range of characters used in generating the output password. For more information, see
the [charsets page](./charsets.md).

## Tags

Used for filtering keys.

## Notes

Additional descriptive text for the key.

## Icon

An icon representing the key that will be displayed in the Pinned Keys and Key List.
45 changes: 45 additions & 0 deletions docs/src/managing_keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Managing Keys

At the **Keys** page, you can create and pin your keys or delete the existing keys.

## Creating a key

1. Open **Keys** page and click the **Create** button.
2. Enter domain for the key which can be a non-URL text like `my_server`.
3. Enter the username for the key.
4. Select a charset. If you need a different charset see [charsets](./charsets.md).
5. Choose a password length between `1` and `64`.
6. (Optional) Add tags for filtering.
7. (Optional) Add notes about the key.
8. (Optional) Set a custom revision no.
9. (Optional) Set an icon for key. Supported formats are `jpeg` and `png`.
10. Click to **Confirm** button.

## Quick and Advanced Copy

Generate and copy your password to the clipboard via left-clicking the copy button on the keys page, or right-clicking
the copy button to open `Advanced Copy` menu for additional options like base64 encoding, URI encoded, QR Code and clear
text.

![Advanced copy menu view](./images/advanced_copy.png)

## Pinning a key

Pin frequently used keys to home page by clicking star icon in the key list.

## Updating a key

To update keys, use the pen icon on the keys page. The Update procedure is identical to creating a new key.

<div class="warning">

> Changing any of the following parameters: `username`, `domain`, `revision no`, `charset` or `target length` will change the output
> password. Only change these values if your intention is to update the password.
>
> You can always generate your old password by using your previous parameters.
</div>

## Deleting a key

To delete a key, simply left-click delete button and confirm on the keys page.
22 changes: 22 additions & 0 deletions docs/src/settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Settings

You can change the application theme and language via **Settings** page.

Currently, there are 11 color theme mainly from [SkeletonUI](https://www.skeleton.dev/) and 2 language option _(EN,
TR)_.

All configurations are stored in `config.json`, located at:

- `/home/${USER}/.local/share/com.superiorone.keywich/config.json` for Linux.
- `C:\Users\${USER}\AppData\Local\com.superiorone.keywich\config.json` for Windows.

Here's an example of a `config.json` file:

```json
{
"color_theme": "default",
"locale": "en",
"is_light_theme": false
}
```

14 changes: 14 additions & 0 deletions docs/src/setup_profile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Setup Profile

Profile database is not initialized when you start the application first time. It asks for your Master Password
which is used for generating your passwords and creating an encryption key for the profile database.

If there is already an existing profile database in the application local data, the application will only ask for master
password for unlocking the database.

> It is important to ensure that your master password is long, random and unique to enhance the security of your
> generated passwords and profile database
![Initialization screen view](./images/initialization.png)


16 changes: 16 additions & 0 deletions docs/src/shortcuts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Shortcuts

**General:**

- `Ctrl` + `1` : Open home page.
- `Ctrl` + `2` : Open keys list.
- `Ctrl` + `3` : Open settings.
- `Ctrl` + `L` : Lock/Logout.
- `Ctrl` + `I` : Log panel.

**Keys page:**

- `Ctrl` + `F` : Open/Close key filter.
- `Ctrl` + `N` : Create new key.

> Current version does not have configurable shortcuts.
4 changes: 2 additions & 2 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.2",
"@sveltejs/kit": "^2.5.3",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@tailwindcss/forms": "^0.5.7",
"@types/eslint": "^8.56.5",
Expand All @@ -31,7 +31,7 @@
"svelte-preprocess": "^5.1.3",
"tailwindcss": "^3.4.1",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"typescript": "^5.4.2",
"vite": "^5.1.5",
"vitest": "^1.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion libs/keywich_api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"author": "",
"license": "ISC",
"devDependencies": {
"typescript": "^5.3.3"
"typescript": "^5.4.2"
}
}
4 changes: 2 additions & 2 deletions libs/keywich_lib/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libs/tauri_api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"typescript": "^5.3.3"
"typescript": "^5.4.2"
},
"peerDependencies": {
"@keywich/api": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dev:desktop": "pnpm -C ./tauri_app run dev",
"dev:gui": "pnpm -C ./gui run dev",
"build:desktop": "pnpm -C ./tauri_app run build",
"build:gui": "pnpm -C ./gui run build"
"build:gui": "pnpm -C ./gui run build",
"build:docs": "mdbook build ./docs"
}
}
Loading

0 comments on commit 681e8e7

Please sign in to comment.