Skip to content

Commit

Permalink
prep for release
Browse files Browse the repository at this point in the history
  • Loading branch information
meld-cp committed Aug 27, 2023
1 parent 7bfd957 commit 9eb1094
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 40 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ dist
*.map
test-vault

# tools
src/tools/offline-decrypt.js
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ You can install the plugin via the Community Plugins tab within Obsidian by sear

> Please report any bugs or feature requests [here](https://github.com/meld-cp/obsidian-encrypt/issues).
### 2.3.0
- add encrypt/decrypt of `.md` or `.encrypted` notes #68 (via file context menu, ribbon icon or command palette, helps with #91, #103, #108, #114)
- fix double blank line #107
- fix offline decrypt tool #111 (found in `/tools/decrypt.html`)
- ribbon icon changes
- code refactor and clean up

### 2.2.0
- stronger encryption (thanks @brycx)
- fix #92 - Enable selection text in Reading view
Expand All @@ -51,9 +58,9 @@ https://raw.githubusercontent.com/meld-cp/obsidian-encrypt/main/
<img alt="Run the Encrypt/Decrypt command" src="https://raw.githubusercontent.com/meld-cp/obsidian-encrypt/main/docs/assets/eg_ed_cp.png" />
-->

### Standalone, always encrypted, notes (.encrypted files)
### Whole encrypted notes (.encrypted files)
#### To create a new encrypted note
1. Select 'Create encrypted note' from the command palette.
1. Select 'Create encrypted note' from the command palette (or click the ribbon icon).
2. Enter and confirm a password and optional hint to use.
3. Edit your encrypted note (it's contents will be encrypted and saved to disk).

Expand All @@ -64,9 +71,20 @@ https://raw.githubusercontent.com/meld-cp/obsidian-encrypt/main/
#### To changing an encrypted notes password and hint
1. Open the note as usual from the navigation tree.
2. Enter the password for the note.
3. Click 'Change Password' from the tab title bar or tab context menu.
3. Click the 'Change Password' icon from the tab title bar or tab context menu.
4. Enter the new password and hint.

#### To encrypt/decrypt an existing note
- Right-click the file and choose 'Encrypt note' or 'Decrypt note'.

OR

- Select the ribbon icon named 'Convert to or from an Encrypted note' to toggle the active file between encrypted and not.

OR

- Select 'Convert to or from an Encrypted note' from the command palette (or even better, bind a hot key)

### In-place Encryption

#### To encrypt selected text
Expand Down Expand Up @@ -105,15 +123,14 @@ https://raw.githubusercontent.com/meld-cp/obsidian-encrypt/main/
### Common Settings
| | |
|--|--|
| Confirm password | Confirm password when encrypting |
| Confirm password | Confirm password when encrypting (recommended) |
| Remember password | Remember the last used password for this session. |
| Remember Password Timeout | The number of minutes to remember the last used password. |
| Remember Password Using | Remember passwords by using File or Parent path |
| Remember Password Using | Remember passwords by using `File Name` or `Parent Folder` matching |

### Whole note encryption Settings
| | |
|--|--|
| Add ribbon icon to create note | Adds a ribbon icon to the left bar to create an encrypted note. |
| Default view for new tabs | The default view that a new encrypted note tab gets opened in |

### In-place encryption Settings
Expand Down
31 changes: 5 additions & 26 deletions esbuild-tool-decrypt.config.mjs
Original file line number Diff line number Diff line change
@@ -1,45 +1,24 @@
import esbuild from "esbuild";
import process from "process";
//import builtins from 'builtin-modules';
import copyStaticFiles from 'esbuild-copy-static-files';

const prod = (process.argv[2] === 'production');

esbuild.build({
entryPoints: ['src/tools/offline-decrypt.ts'],
bundle: true,
external: [
// 'obsidian',
// 'electron',
// '@codemirror/autocomplete',
// '@codemirror/collab',
// '@codemirror/commands',
// '@codemirror/language',
// '@codemirror/lint',
// '@codemirror/search',
// '@codemirror/state',
// '@codemirror/view',
// '@lezer/common',
// '@lezer/highlight',
// '@lezer/lr',
//...builtins
],
format: 'iife',
watch: !prod,
target: 'es2018',
logLevel: "info",
sourcemap: 'inline',
treeShaking: false,
minify: false,
outfile: './src/tools/offline-decrypt.js',
sourcemap: prod ? false : 'inline',
treeShaking: prod,
minify: prod,
outfile: './tools/offline-decrypt.js',
plugins:[
copyStaticFiles({
src: './src/tools/offline-decrypt.js',
dest: './dist/tools/offline-decrypt.js',
}),
copyStaticFiles({
src: './src/tools/decrypt.html',
dest: './dist/tools/decrypt.html',
dest: './tools/decrypt.html',
}),
]
}).catch(() => process.exit(1));
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "meld-encrypt",
"name": "Meld Encrypt",
"version": "2.2.0",
"version": "2.3.0",
"minAppVersion": "1.0.3",
"description": "Hide secrets in your vault",
"author": "meld-cp",
Expand All @@ -10,5 +10,5 @@
"fundingUrl": {
"Buy Me a Coffee": "https://www.buymeacoffee.com/cleon",
"GitHub Sponsor": "https://github.com/sponsors/meld-cp"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-sample-plugin",
"version": "2.2.0",
"version": "2.3.0",
"description": "Hide secrets in your vault",
"main": "main.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/tools/decrypt.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Decryptor Tool for Obsidian Meld Encrypt Plugin</title>
<title>Decrypt Tool for Obsidian Meld Encrypt Plugin</title>
<script src="offline-decrypt.js"></script>
<style>
:root{
Expand Down Expand Up @@ -65,7 +65,7 @@
<body>

<div class="row-500">
<h1>🔐 Decryptor Tool for Obsidian Meld Encrypt Plugin 🔐</h1>
<h1>🔐 Decrypt Tool for Obsidian Meld Encrypt Plugin 🔐</h1>

<p>Use this tool to decrypt notes without using the Obsidian Meld Encrypt Plugin.</p>

Expand Down
112 changes: 112 additions & 0 deletions tools/decrypt.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Decrypt Tool for Obsidian Meld Encrypt Plugin</title>
<script src="offline-decrypt.js"></script>
<style>
:root{
font-family: Arial, Helvetica, sans-serif;
}

body{
display: flex;
flex-direction: column;
align-items: center;
background-color: #eee;
}

h1{
text-align: center;
}

.row-500{
display: flex;
flex-direction: column;
max-width: 500px;
}

.col{
display: flex;
flex-direction: row;
align-items: baseline;
}

label{
color: blue;
margin-top: 1em;
}

textarea{
height: 5em;
resize: vertical;
padding: 0.5em;
}

button, input{
padding: 0.5em;
}

#pw{
margin-right: 1em;
}

#m{
margin-left: 1em;
}

.footnote{
margin-top: 4em;
font-size: 0.8em;
}
</style>
</head>
<body>

<div class="row-500">
<h1>🔐 Decrypt Tool for Obsidian Meld Encrypt Plugin 🔐</h1>

<p>Use this tool to decrypt notes without using the Obsidian Meld Encrypt Plugin.</p>

<label for="et">Encrypted Text</label>
<textarea id="et"></textarea>

<label for="pw">Password</label>
<div class="col">
<input id="pw" type="password">
<button id="btnDecrypt" type="button">🔓 Decrypt</button>
<span id="m"></span>
</div>

<label for="dt">Decrypted Text</label>
<textarea id="dt" readonly=""></textarea>

<p class="footnote"><b>Note:</b> As an offline backup, you can save your own copy of this tool. Right click and choose 'Save link as' for: <a href="decrypt.html" download>this page</a> and the <a href="crypto-helper.js">decryptor code</a></p>

</div>

<script>
document.getElementById('btnDecrypt').onclick = (ev) => decryptHandler();

async function decryptHandler(){
const eTextEncrypted = document.querySelector('#et');
const ePassword = document.querySelector('#pw');
const eTextDecrypted = document.querySelector('#dt');
const eMessage = document.querySelector('#m');

eMessage.innerHTML = '';

const result = await $.decrypt(eTextEncrypted.value, ePassword.value);

if (result === null){
eMessage.innerHTML = '👎 Decryption failed';
eTextDecrypted.value = '';
}else{
eMessage.innerHTML = '👍 Decrypted';
eTextDecrypted.value = result
}
}
</script>
</body>
</html>
1 change: 1 addition & 0 deletions tools/offline-decrypt.js

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

3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
"2.1.1": "1.0.3",
"2.1.2": "1.0.3",
"2.1.3": "1.0.3",
"2.2.0": "1.0.3"
"2.2.0": "1.0.3",
"2.3.0": "1.0.3"
}

0 comments on commit 9eb1094

Please sign in to comment.