Skip to content

Commit

Permalink
Document temporary file extension behavior when using template (jrnl-…
Browse files Browse the repository at this point in the history
…org#1686)

* Document jrnl's temp file behavior when using templates
* Move up "Files in transit from editor to jrnl" section and add notes about template extension behavior in solutions that reference .jrnl extension
* Update privacy-and-security.md
  • Loading branch information
micahellison authored Feb 25, 2023
1 parent 18397b1 commit fcac94a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
43 changes: 27 additions & 16 deletions docs/privacy-and-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@ Windows doesn't log history to disk, but it does keep it in your command prompt
session. Close the command prompt or press `Alt`+`F7` to clear your history
after journaling.

## Files in transit from editor to jrnl

When creating or editing an entry, `jrnl` uses a unencrypted temporary file on
disk in order to give your editor access to your journal. After you close your
editor, `jrnl` then deletes this temporary file.

So, if you have saved a journal entry but haven't closed your editor yet, the
unencrypted temporary remains on your disk. If your computer were to shut off
during this time, or the `jrnl` process were killed unexpectedly, then the
unencrypted temporary file will remain on your disk. You can mitigate this
issue by only saving with your editor right before closing it. You can also
manually delete these files from your temporary folder. By default, they
are named `jrnl*.jrnl`, but if you use a
[template](reference-config-file.md#template), they will have the same
extension as the template.

## Editor history

Some editors keep usage history stored on disk for future use. This can be a
Expand All @@ -83,7 +99,8 @@ the `workbench.localHistory.enabled` setting in the
Alternatively, you can disable this feature for specific files by configuring a
[pattern](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options)
in the `workbench.localHistory.exclude` setting. To exclude unencrypted temporary files generated
by `jrnl`, you can set the `**/jrnl*.jrnl` pattern for the `workbench.localHistory.exclude` setting
by `jrnl`, you can set the `**/jrnl*.jrnl` (unless you are using a
[template](reference-config-file.md#template)) pattern for the `workbench.localHistory.exclude` setting
in the [Settings editor](https://code.visualstudio.com/docs/getstarted/settings#_settings-editor).

!!! note
Expand Down Expand Up @@ -129,7 +146,11 @@ autocommand can be used. Place this in your `~/.vimrc`:
autocmd BufNewFile,BufReadPre *.jrnl setlocal viminfo= noswapfile noundofile nobackup nowritebackup noshelltemp history=0 nomodeline secure
```

Please see `:h <option>` in Vim for more information about the options mentioned.
!!! note
If you're using a [template](reference-config-file.md#template), you will
have to use the template's file extension instead of `.jrnl`.

See `:h <option>` in Vim for more information about the options mentioned.

### Neovim

Expand Down Expand Up @@ -171,21 +192,11 @@ vim.api.nvim_create_autocmd( {"BufNewFile","BufReadPre" }, {
})
```

Please see `:h <option>` in Neovim for more information about the options mentioned.

## Files in transit from editor to jrnl

When creating or editing an entry, `jrnl` uses a unencrypted temporary file on
disk in order to give your editor access to your journal. After you close your
editor, `jrnl` then deletes this temporary file.
!!! note
If you're using a [template](reference-config-file.md#template), you will
have to use the template's file extension instead of `.jrnl`.

So, if you have saved a journal entry but haven't closed your editor yet, the
unencrypted temporary remains on your disk. If your computer were to shut off
during this time, or the `jrnl` process were killed unexpectedly, then the
unencrypted temporary file will remain on your disk. You can mitigate this
issue by only saving with your editor right before closing it. You can also
manually delete these files (i.e. files named `jrnl*.jrnl`) from your temporary
folder.
Please see `:h <option>` in Neovim for more information about the options mentioned.

## Plausible deniability

Expand Down
4 changes: 3 additions & 1 deletion docs/reference-config-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ value for journals that already have data in them.

### template
The path to a text file to use as a template for new entries. Only works when you
have the `editor` field configured.
have the `editor` field configured. If you use a template, the editor's
[temporary files](privacy-and-security.md#files-in-transit-from-editor-to-jrnl)
will have the same extension as the template.

### tagsymbols
Symbols to be interpreted as tags.
Expand Down

0 comments on commit fcac94a

Please sign in to comment.