You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bare-bones Electron app for writing password-protected notes and organizing them into a flexible folder structure.
4
4
5
5
This is is a personal project to solve an immediate problem for me: migrating from Apple's Keychain Access app to something cross-platform, local-only and a bit more feature-rich.
6
6
7
-
Features:
7
+
### Features:
8
8
9
-
*All notes are searchable
9
+
*Notes are searchable
10
10
* Notes are organized into folders
11
-
* Password is not connected to your system password
12
-
* Asks for password only once when the app starts
13
-
* You can change the password at any time
11
+
* Password are independent from your system password
12
+
* The password is required only once: when you open the app
14
13
* Notes can be exported in their encrypted form in a single archive and reimported later
14
+
* You can change the password at any time
15
15
16
-
Known issues:
16
+
### Known issues / coming changes:
17
17
18
18
* You can't rename folders directly
19
19
* The window should probably de-authenticate after ~10 minutes of inactivity
20
-
* When you open a note, you should have to unlock it to start editing it
20
+
* When you open a note, you should have to unlock it to start editing it, or the editor should look less like a text area
21
21
* Probably, whenever you open the app or change folders, the "top" note should automatically appear (rather than loading showing nothing)
22
22
23
-
### A note about cryptography and security
23
+
## Installing
24
+
25
+
You need git and node/npm installed. I'm not using yarn here because I haven't migrated to it yet myself. But of course yarn is installed with Electron, so there's no reason I can't get this working with yarn, I think. Steps to install are:
(Or you can download the repo as a ZIP file, unpack it and run `npm install` from there.)
32
+
33
+
### Development:
34
+
35
+
This does not require CRA, Electron or node-sass to be installed globally -- in fact, I recommend that you avoid doing this as a general rule. All dependencies will be installed locally and can be invoked via `package.json`'s custom scripts without any changes to your system's settings.
36
+
37
+
One downside to the way I've set things up is that, during development, you must manually start create-react-app's dev server and once the dev-server is running, you can to start up Electron. If you just start Electron, **you'll see a blank screen.** There are ways to start both simultaneously from a single command, but I find that kind of pointlessly complex. And this way you get both live-reloading in CRA and in Electron. Take a look at the `scripts` in `package.json` for more details.
38
+
39
+
If you want to edit the main electron file, it is located in `public/`.
40
+
41
+
These are the steps to get things running for development.
42
+
43
+
1. In one window, run create-react-app's dev-server
44
+
2. In another window, start up Electron
45
+
3. Optionally, you can also edit the Sass files in a third window
46
+
47
+
#### Window 1 (runs create-react-app dev-server)
48
+
49
+
$ npm run start
50
+
51
+
#### Window 2 (runs electron in dev mode)
52
+
53
+
$ npm run electron
54
+
55
+
#### Window 3 (Optional -- for editing SCSS files)
56
+
57
+
$ npm run css:watch
58
+
59
+
### Publishing
60
+
61
+
$ npm run css # compile the scss to css
62
+
$ npm run build # compile the create-react-app binary
63
+
$ npm run electron:dist # compile the Mac/Win executable
64
+
65
+
## A note about cryptography and security
24
66
25
67
I'm not a crypto programmer and because I'm not foolhardy enough to "roll my own", the AES-GCM implementation here was lifted without any substantive change from MDN's reference page on `SubtleCrypto.encrypt()` found [here](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt). This version uses AES-GCM cipher suite with the recommended 96-bit initialization vector. The [WebCrypto API](https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-encrypt) is fairly straight-forward and I think their implementation is technically correct, but as I just said, I am not a crypto programmer, so use this code at your own risk.
26
68
@@ -30,6 +72,6 @@ If YOU are a crypto programmer and see any issues with the WebCrypto implementat
30
72
31
73
And if you want to use this for your own private notes, I cannot over-emphasize this: please do so at your own risk.
32
74
33
-
###A note about storage
75
+
## A note about storage
34
76
35
77
I'm using [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB), though you will see that in much earlier commits I was using WebSQL with SQLite. In my opinion, IndexedDB is an awful, awful API and WebSQL is almost infinitely superior, easier and more fun to use. Sadly, WebSQL is basically deprecated on most platforms. It is currently supported on Chromium, but I see no reason for it not to be deprecated there either at some point in the future. There are native implementations for Electron that get around this but I am not confident that they will continue to be maintained if WebSQL is eventually, inevitably removed from all platforms. It is fairly simple though to introduce any other storage engine: just write your own module that implements `init`, `notesExist`, `getNotes`, `getNoteById`, `deleteNoteById`, `updateNote`, `createNote`, `exportNotes`, `importNotes`, `updatePassword`, and `search`. Consult the JSDocs for more interface information.
0 commit comments