Skip to content

Commit

Permalink
Merge branch 'master' into fix-custom-dates
Browse files Browse the repository at this point in the history
  • Loading branch information
wren authored Nov 12, 2019
2 parents 1fa851e + c098888 commit 25c0fea
Show file tree
Hide file tree
Showing 45 changed files with 452 additions and 528 deletions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

## Bug report

Hello! Thank you for reporting an issue!
If you would fill out the below points, that would make our process a whole lot easier!

* **Please tell us about your environment:**
- Jrnl version: (run `jrnl -v`)
- How you installed Jrnl
- Operating system [MacOS, Linux, Windows?]

* **What is the current behavior?**

* **Please provide the steps to reproduce and if possible a minimal demo of the problem**

* **What is the expected behavior?**

* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for jrnl
title: ''
labels: enhancement
assignees: ''

---

## Feature Request

Hello! Thank you for reporting an issue!
If you would fill out the below points, that would make our process a whole lot easier!

* **What is the motivation / use case for changing the behavior?**

* **Please provide examples of the usage**

* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/support_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Support Request
about: Get help with jrnl
title: ''
labels: support
assignees: ''

---

## Support request

Hello! Thank you for reporting an issue!
If you would fill out the below points, that would make our process a whole lot easier!

* **Please tell us about your environment:**

- Jrnl version: (run `jrnl -v`)
- How you installed Jrnl

- Operating system [MacOS, Linux, Windows?]

* **What are you trying to do?**

* **What have you tried?**

* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# **TEMPLATE PLEASE EDIT**
*Thank you for wanting to contribute! Please fill out this description as well as look at the checklist!*

*Short block of text containing:
- Relevant changes in text form
- related issues
- Motivation (if applicable)
- Example of usage (if applicable)
- Example of changes to config files (if applicable)
*
### Checklist
- [ ] The code change is tested and works locally.
- [ ] Tests pass. Your PR cannot be merged unless tests pass
- [ ] There is no commented out code in this PR.
- [ ] Have you followed the guidelines in our Contributing document?
- [ ] Have you checked to ensure there aren't other open [Pull Requests](../pulls) for the same update/change?
- [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Have you written new tests for your core changes, as applicable?
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
dist: xenial # required for Python >= 3.7
language: python
python: "3.7"
git:
depth: false
before_install:
- pip install poetry
- pip install poetry~=0.12.17
install:
# we run `poetry version` here to appease poetry about '0.0.0-source'
- poetry version
Expand All @@ -11,7 +13,6 @@ script:
- poetry run python --version
- poetry run behave
before_deploy:
- pip install poetry
- poetry config http-basic.pypi $PYPI_USER $PYPI_PASS
- poetry version $TRAVIS_TAG
- poetry build
Expand All @@ -22,3 +23,10 @@ deploy:
on:
branch: master
tags: true
after_deploy:
- git config --global user.email "[email protected]"
- git config --global user.name "Jrnl Bot"
- git checkout master
- git add pyproject.toml
- git commit -m "Incrementing version to ${TRAVIS_TAG}"
- git push https://${GITHUB_TOKEN}@github.com/jrnl-org/jrnl.git master
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Changelog

## 2.0

* Cryptographical backend changed from PyCrypto to cryptography.io
* Cryptographic backend changed from PyCrypto to cryptography.io
* Config now respects XDG conventions and may move accordingly
* Config now saved as YAML
* Config name changed from `journals.jrnl_name.journal` to `journals.jrnl_name.path`
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Unfortunately, bugs happen. If you found one, please [open a new issue](https://
Feature requests and ideas
--------------------------

So, you have an idea for a great feature? Awesome! We'd love to hear from you! Please [open a new issue](https://github.com/jrnl-org/jrnl/issues) and describe the goal of the feature, and any relvant use cases. We'll discuss the issue with you, and decide if it's a good fit for the project.
So, you have an idea for a great feature? Awesome! We'd love to hear from you! Please [open a new issue](https://github.com/jrnl-org/jrnl/issues) and describe the goal of the feature, and any relevant use cases. We'll discuss the issue with you, and decide if it's a good fit for the project.

When discussing new features, please keep in mind our design goals. jrnl strives to do one thing well. To us, that means:

* be _slim_
* have a simple interface
* avoid dupicating functionality
* avoid duplicating functionality


A short note for new programmers and programmers new to python
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Manuel Ebert
Copyright (c) 2014-2019 Manuel Ebert

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
82 changes: 26 additions & 56 deletions docs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
## Configuration File

You can configure the way jrnl behaves in a configuration file. By
default, this is `~/.jrnl_config`. If you have the `XDG_CONFIG_HOME`
default, this is `~/.config/jrnl/jrnl.yaml`. If you have the `XDG_CONFIG_HOME`
variable set, the configuration file will be saved as
`$XDG_CONFIG_HOME/jrnl/.jrnl_config`.
`$XDG_CONFIG_HOME/jrnl/jrnl.yaml`.

!!! note
On Windows, The configuration file is typically found at `C:\Users\[Your Username]\.jrnl_config`.
On Windows, the configuration file is typically found at `%USERPROFILE%\.config\jrnl\jrnl.yaml`.

The configuration file is a simple JSON file with the following options
and can be edited with any plain text editor.
The configuration file is a YAML file with the following options
and can be edited with a plain text editor.

!!! note
Backup your config file before editing. Changes to the config file
have destructive effects on your journal!

- `journals`
paths to your journal files
Expand Down Expand Up @@ -51,46 +55,16 @@ and can be edited with any plain text editor.
Or use the built-in prompt or an external editor to compose your
entries.

## DayOne Integration

Using your DayOne journal instead of a flat text file is dead simple --
instead of pointing to a text file, change your `.jrnl_config` to point
to your DayOne journal. This is a folder named something like
`Journal_dayone` or `Journal.dayone`, and it's located at

- `~/Library/Application Support/Day One/` by default
- `~/Dropbox/Apps/Day One/` if you're syncing with Dropbox and
- `~/Library/Mobile
Documents/5U8NS4GX82~com~dayoneapp~dayone/Documents/` if you're
syncing with iCloud.

Instead of all entries being in a single file, each entry will live in a
separate `plist` file. So your `.jrnl_config` should look like this:

``` javascript
{
...
"journals": {
"default": "~/journal.txt",
"dayone": "~/Library/Mobile Documents/5U8NS4GX82~com~dayoneapp~dayone/Documents/Journal_dayone"
}
}
```

## Multiple journal files

You can configure `jrnl`to use with multiple journals (eg.
`private` and `work`) by defining more journals in your `.jrnl_config`,
`private` and `work`) by defining more journals in your `jrnl.yaml`,
for example:

``` javascript
{
...
"journals": {
"default": "~/journal.txt",
"work": "~/work.txt"
}
}
``` yaml
journals:
default: ~\journal.txt
work: ~\work.txt
```
The `default` journal gets created the first time you start `jrnl`
Expand All @@ -106,26 +80,22 @@ will both use `~/work.txt`, while `jrnl -n 3` will display the last
three entries from `~/journal.txt` (and so does `jrnl default -n 3`).

You can also override the default options for each individual journal.
If you `.jrnl_config` looks like this:

``` javascript
{
...
"encrypt": false
"journals": {
"default": "~/journal.txt",
"work": {
"journal": "~/work.txt",
"encrypt": true
},
"food": "~/my_recipes.txt",
}
If your `jrnl.yaml` looks like this:

``` yaml
encrypt: false
journals:
default: ~/journal.txt
work:
journal: ~/work.txt
encrypt: true
food: ~/my_recipes.txt
```

Your `default` and your `food` journals won't be encrypted, however your
`work` journal will! You can override all options that are present at
the top level of `.jrnl_config`, just make sure that at the very least
you specify a `"journal": ...` key that points to the journal file of
the top level of `jrnl.yaml`, just make sure that at the very least
you specify a `journal: ...` key that points to the journal file of
that journal.

!!! note
Expand Down
36 changes: 21 additions & 15 deletions docs/encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Encrypting and decrypting

If you don't choose to encrypt your file when you run
If you dont choose to encrypt your file when you run
`jrnl` for the first time, you can encrypt
your existing journal file or change its password using
your existing journal file or change its password using this:

``` sh
jrnl --encrypt
Expand All @@ -18,53 +18,59 @@ replaced by the encrypted file. Conversely,
jrnl --decrypt
```

will replace your encrypted journal file by a Journal in plain text. You
can also specify a filename, ie. `jrnl --decrypt plain_text_copy.txt`,
will replace your encrypted journal file with a journal in plain text. You
can also specify a filename, i.e. `jrnl --decrypt plain_text_copy.txt`,
to leave your original file untouched.

## Storing passwords in your keychain

Whenever you encrypt your journal, you are asked whether you want to
store the encryption password in your keychain. If you do this, you
won't have to enter your password every time you want to write or read
wont have to enter your password every time you want to write or read
your journal.

If you don't initially store the password in the keychain but decide to
do so at a later point -- or maybe want to store it on one computer but
not on another -- you can simply run `jrnl --encrypt` on an encrypted
If you dont initially store the password in the keychain but decide to
do so at a later point or maybe want to store it on one computer but
not on another you can simply run `jrnl --encrypt` on an encrypted
journal and use the same password again.

## A note on security

While jrnl follows best practises, true security is an illusion.
Specifically, jrnl will leave traces in your memory and your shell
history -- it's meant to keep journals secure in transit, for example
history its meant to keep journals secure in transit, for example
when storing it on an
[untrusted](http://techcrunch.com/2014/04/09/condoleezza-rice-joins-dropboxs-board/)
services such as Dropbox. If you're concerned about security, disable
history logging for journal in your `.bashrc`
services such as Dropbox. If youre concerned about security, disable
history logging for journal in your `.bashrc`:

``` sh
HISTIGNORE="$HISTIGNORE:jrnl *"
```

If you are using zsh instead of bash, you can get the same behaviour
adding this to your `zshrc`
If you are using zsh instead of bash, you can get the same behaviour by
adding this to your `zshrc`:

``` sh
setopt HIST_IGNORE_SPACE
alias jrnl=" jrnl"
```

The fish shell does not support automatically preventing logging like
this. To prevent `jrnl` commands being logged by fish, you must make
sure to type a space before every `jrnl` command you enter. To delete
existing `jrnl` commands from fish’s history, run
`history delete --prefix 'jrnl '`.

## Manual decryption

Should you ever want to decrypt your journal manually, you can do so
with any program that supports the AES algorithm in CBC. The key used
for encryption is the SHA-256-hash of your password, the IV
(initialisation vector) is stored in the first 16 bytes of the encrypted
file. The plain text is encoded in UTF-8 and padded according to PKCS\#7
before being encrypted. Here's a Python script that you can use to
decrypt your journal
before being encrypted. Heres a Python script that you can use to
decrypt your journal:

``` python
#!/usr/bin/env python3
Expand Down
17 changes: 1 addition & 16 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,12 @@ On other platforms, install *jrnl* using pip
pip install jrnl
```

Or, if you want the option to encrypt your journal,

``` sh
pip install jrnl[encrypted]
```

to install the dependencies for encrypting journals as well.


!!! note
Installing the encryption library, `pycrypto`, requires a `gcc` compiler. For this reason, jrnl will
not install `pycrypto` unless explicitly told so like this. You can [install PyCrypto manually](https://www.dlitz.net/software/pycrypto/)
first or install it with `pip install pycrypto` if you have a `gcc` compiler.
Also note that when using zsh, the correct syntax is `pip install "jrnl[encrypted]"` (note the quotes).

The first time you run `jrnl` you will be asked where your journal file
should be created and whether you wish to encrypt it.

## Quickstart

to make a new entry, just type
To make a new entry, just type

``` sh
jrnl yesterday: Called in sick. Used the time to clean the house and spent 4h on writing my book.
Expand Down
Loading

0 comments on commit 25c0fea

Please sign in to comment.