Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Added SQLCipher support
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandtM committed Feb 3, 2016
1 parent b3b8c62 commit e4096a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ docs/_build/
# PyBuilder
target/

cipher_key.txt
6 changes: 4 additions & 2 deletions journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
import os

from peewee import *

from playhouse.sqlcipher_ext import SqlCipherDatabase

try:
input = raw_input # for python2 compatibility
except NameError:
pass

path = os.getenv('HOME', os.path.expanduser('~')) + '/.tnote'
db = SqliteDatabase(path + '/diary.db')

with open('cipher_key.txt', 'r') as cipher_file:
db = SqlCipherDatabase(path + '/diary.db', passphrase=cipher_file.read())

class DiaryEntry(Model):

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
peewee==2.8.0
pysqlcipher3==1.0.1

0 comments on commit e4096a2

Please sign in to comment.