mirror of https://github.com/borgbase/vorta
Smaller issues for v0.6.5 (#123)
* Clarify tray icon behavior in INSTALL.md. Fixes #111 * Rename default profile to just "Default". Fixes #116 * Remove Sentry bug reporting. Add link to Github instead. Fixes #117 * Log to terminal only when running in foreground.
This commit is contained in:
parent
d2f618babf
commit
42191725b5
|
@ -7,6 +7,9 @@ The generic way is to install it as Python package using [PIP](https://pip.readt
|
|||
$ pip3 install vorta
|
||||
```
|
||||
|
||||
### Desktop Tray Icon
|
||||
Unless Vorta is started with the `--foreground` option, it will minimize to the system tray without opening a settings window. Be sure your desktop environment supports tray icons by e.g. installing this [Gnome extension](https://extensions.gnome.org/extension/615/appindicator-support/).
|
||||
|
||||
## Distribution Packages
|
||||
If available, prefer distribution-specific packages, as they offer better integration. (If you added Vorta to a Linux distribution, open an issue or PR and it will be added here.)
|
||||
|
||||
|
|
|
@ -7,8 +7,9 @@ url = https://github.com/borgbase/vorta
|
|||
keywords =
|
||||
backup
|
||||
borgbackup
|
||||
# List of classifiers: https://pypi.org/pypi?%3Aaction=list_classifiers
|
||||
classifiers =
|
||||
Development Status :: 3 - Alpha
|
||||
Development Status :: 4 - Beta
|
||||
Environment :: MacOS X
|
||||
Environment :: X11 Applications :: Qt
|
||||
Operating System :: MacOS
|
||||
|
@ -37,7 +38,6 @@ install_requires =
|
|||
python-dateutil
|
||||
keyring
|
||||
apscheduler
|
||||
sentry-sdk
|
||||
psutil
|
||||
pyobjc-core; sys_platform == 'darwin'
|
||||
pyobjc-framework-Cocoa; sys_platform == 'darwin'
|
||||
|
|
|
@ -2,13 +2,12 @@ import sys
|
|||
import os
|
||||
import peewee
|
||||
|
||||
from vorta.models import init_db, SettingsModel
|
||||
from vorta.models import init_db
|
||||
from vorta.application import VortaApp
|
||||
from vorta.config import SETTINGS_DIR
|
||||
from vorta.updater import get_updater
|
||||
import vorta.sentry
|
||||
import vorta.log
|
||||
from vorta.utils import parse_args
|
||||
from vorta.log import init_logger
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -22,14 +21,12 @@ def main():
|
|||
if os.fork():
|
||||
sys.exit()
|
||||
|
||||
init_logger(foreground=want_foreground)
|
||||
|
||||
# Init database
|
||||
sqlite_db = peewee.SqliteDatabase(os.path.join(SETTINGS_DIR, 'settings.db'))
|
||||
init_db(sqlite_db)
|
||||
|
||||
# Send crashes to Sentry.
|
||||
if SettingsModel.get(key='send_sentry_reports').value:
|
||||
vorta.sentry.init()
|
||||
|
||||
app = VortaApp(sys.argv, single_app=True)
|
||||
app.updater = get_updater()
|
||||
|
||||
|
|
|
@ -66,6 +66,16 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>(<a href="https://github.com/borgbase/vorta/issues/new/choose"><span style=" text-decoration: underline; color:#0000ff;">Report</span></a> a Bug)</p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -10,8 +10,8 @@ from PyQt5 import QtCore
|
|||
from PyQt5.QtWidgets import QApplication
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
from ..models import EventLogModel, BackupProfileMixin
|
||||
from ..utils import keyring
|
||||
from vorta.models import EventLogModel, BackupProfileMixin
|
||||
from vorta.utils import keyring
|
||||
|
||||
mutex = QtCore.QMutex()
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -174,8 +174,9 @@ class BorgThread(QtCore.QThread, BackupProfileMixin):
|
|||
self.log_event(f'{parsed["path"]} ({parsed["status"]})')
|
||||
except json.decoder.JSONDecodeError:
|
||||
msg = line.strip()
|
||||
self.log_event(msg)
|
||||
logger.warning(msg)
|
||||
if msg: # Log only if there is something to log.
|
||||
self.log_event(msg)
|
||||
logger.warning(msg)
|
||||
|
||||
if p.poll() is not None:
|
||||
time.sleep(0.1)
|
||||
|
|
|
@ -10,23 +10,25 @@ import os
|
|||
import logging
|
||||
from .config import LOG_DIR
|
||||
|
||||
logger = logging.getLogger('vorta')
|
||||
logger.setLevel(logging.DEBUG)
|
||||
logger = logging.getLogger()
|
||||
|
||||
# create handlers
|
||||
fh = logging.FileHandler(os.path.join(LOG_DIR, 'vorta.log'))
|
||||
# fh.setLevel(logging.DEBUG)
|
||||
|
||||
ch = logging.StreamHandler()
|
||||
ch.setLevel(logging.WARNING)
|
||||
def init_logger(foreground=False):
|
||||
logger.setLevel(logging.DEBUG)
|
||||
logging.getLogger('peewee').setLevel(logging.INFO)
|
||||
logging.getLogger('apscheduler').setLevel(logging.INFO)
|
||||
|
||||
# create logging format
|
||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
# create logging format
|
||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
|
||||
# apply formatter
|
||||
fh.setFormatter(formatter)
|
||||
ch.setFormatter(formatter)
|
||||
# create handlers
|
||||
fh = logging.FileHandler(os.path.join(LOG_DIR, 'vorta.log'))
|
||||
fh.setLevel(logging.DEBUG)
|
||||
fh.setFormatter(formatter)
|
||||
logger.addHandler(fh)
|
||||
|
||||
# add handlers
|
||||
logger.addHandler(fh)
|
||||
logger.addHandler(ch)
|
||||
if foreground: # log to console, when running in foreground
|
||||
ch = logging.StreamHandler()
|
||||
ch.setLevel(logging.DEBUG)
|
||||
ch.setFormatter(formatter)
|
||||
logger.addHandler(ch)
|
||||
|
|
|
@ -191,7 +191,7 @@ def init_db(con):
|
|||
ArchiveModel, WifiSettingModel, EventLogModel, SchemaVersion])
|
||||
|
||||
if BackupProfileModel.select().count() == 0:
|
||||
default_profile = BackupProfileModel(name='Default Profile')
|
||||
default_profile = BackupProfileModel(name='Default')
|
||||
default_profile.save()
|
||||
|
||||
# Default settings for all platforms.
|
||||
|
@ -202,12 +202,6 @@ def init_db(con):
|
|||
'type': 'checkbox',
|
||||
'label': 'Use light system tray icon (applies after restart, useful for dark themes).'
|
||||
},
|
||||
{
|
||||
'key': 'send_sentry_reports',
|
||||
'value': True,
|
||||
'type': 'checkbox',
|
||||
'label': 'Send errors to Sentry. This helps us quickly find bugs.'
|
||||
},
|
||||
{
|
||||
'key': 'enable_notifications', 'value': True, 'type': 'checkbox',
|
||||
'label': 'Display notifications when background tasks fail.'
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
import sentry_sdk
|
||||
from vorta._version import __version__
|
||||
|
||||
|
||||
def scrub_sensitive_data(event, hint):
|
||||
"""Adapted from https://stackoverflow.com/questions/9807634/
|
||||
find-all-occurrences-of-a-key-in-nested-python-dictionaries-and-lists/29652561"""
|
||||
def gen_dict_extract(key, var):
|
||||
if hasattr(var, 'items'):
|
||||
for k, v in var.items():
|
||||
if k == key:
|
||||
var[k] = 'FILTERED'
|
||||
yield v
|
||||
if isinstance(v, dict):
|
||||
for result in gen_dict_extract(key, v):
|
||||
yield result
|
||||
elif isinstance(v, list):
|
||||
for d in v:
|
||||
for result in gen_dict_extract(key, d):
|
||||
yield result
|
||||
|
||||
list(gen_dict_extract('BORG_PASSPHRASE', event))
|
||||
list(gen_dict_extract('password', event))
|
||||
return event
|
||||
|
||||
|
||||
def init():
|
||||
sentry_sdk.init("https://a4a23df3e44743d5b5c5f06417a9a809@sentry.io/1311799",
|
||||
release=__version__,
|
||||
before_send=scrub_sensitive_data)
|
Loading…
Reference in New Issue