From bb9ec188e045226e631194d2d1037d0a34b605cc Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Thu, 31 Dec 2020 03:59:26 +0000 Subject: [PATCH] added work on faster and safer database for blocks and general KV --- src/filepaths/__init__.py | 2 ++ src/safedb/__init__.py | 2 ++ src/safedb/securestring/__init__.py | 20 ++++++++++++++++++-- src/utils/createdirs.py | 3 ++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/filepaths/__init__.py b/src/filepaths/__init__.py index 32330f6d..e37270ed 100644 --- a/src/filepaths/__init__.py +++ b/src/filepaths/__init__.py @@ -38,3 +38,5 @@ ephemeral_services_file = home + 'ephemeral-services.list' restarting_indicator = home + "is-restarting" secure_erase_key_file = home + "erase-key" + +master_db_location = home + "database/" diff --git a/src/safedb/__init__.py b/src/safedb/__init__.py index e7275ae2..37cade5e 100644 --- a/src/safedb/__init__.py +++ b/src/safedb/__init__.py @@ -2,6 +2,8 @@ from typing import Union from enum import Enum, auto import dbm +from filenuke import nuke + from .securestring import generate_key_file, protect_string, unprotect_string diff --git a/src/safedb/securestring/__init__.py b/src/safedb/securestring/__init__.py index 0a6c7101..01731dde 100644 --- a/src/safedb/securestring/__init__.py +++ b/src/safedb/securestring/__init__.py @@ -1,4 +1,6 @@ -"""Wrap RinseOff, a c# CLI tool for secure data erasure via a keyfile. +"""Onionr - Private P2P Communication + +Wrap RinseOff, a c# CLI tool for secure data erasure via a keyfile. Intended for encrypting database entries. @@ -6,7 +8,6 @@ It is quite slow since it spawns an external process, but an ext process is necessary to keep the key out of memory as much as possible """ - import os from typing import Union @@ -14,6 +15,21 @@ import subprocess from filepaths import secure_erase_key_file, app_root import logger +""" +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" + _rinseoff = f"{app_root}/src/rinseoff/rinseoffcli" diff --git a/src/utils/createdirs.py b/src/utils/createdirs.py index d0590bf4..f819800b 100644 --- a/src/utils/createdirs.py +++ b/src/utils/createdirs.py @@ -36,7 +36,8 @@ def create_dirs(): order of the hardcoded list below, then trigger creation of DBs""" gen_dirs = [home, filepaths.block_data_location, - filepaths.contacts_location, filepaths.export_location] + filepaths.contacts_location, filepaths.export_location, + filepaths.master_db_location] for path in gen_dirs: if not os.path.exists(path): os.makedirs(path)