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
|
$ 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
|
## 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.)
|
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 =
|
keywords =
|
||||||
backup
|
backup
|
||||||
borgbackup
|
borgbackup
|
||||||
|
# List of classifiers: https://pypi.org/pypi?%3Aaction=list_classifiers
|
||||||
classifiers =
|
classifiers =
|
||||||
Development Status :: 3 - Alpha
|
Development Status :: 4 - Beta
|
||||||
Environment :: MacOS X
|
Environment :: MacOS X
|
||||||
Environment :: X11 Applications :: Qt
|
Environment :: X11 Applications :: Qt
|
||||||
Operating System :: MacOS
|
Operating System :: MacOS
|
||||||
|
@ -37,7 +38,6 @@ install_requires =
|
||||||
python-dateutil
|
python-dateutil
|
||||||
keyring
|
keyring
|
||||||
apscheduler
|
apscheduler
|
||||||
sentry-sdk
|
|
||||||
psutil
|
psutil
|
||||||
pyobjc-core; sys_platform == 'darwin'
|
pyobjc-core; sys_platform == 'darwin'
|
||||||
pyobjc-framework-Cocoa; sys_platform == 'darwin'
|
pyobjc-framework-Cocoa; sys_platform == 'darwin'
|
||||||
|
|
|
@ -2,13 +2,12 @@ import sys
|
||||||
import os
|
import os
|
||||||
import peewee
|
import peewee
|
||||||
|
|
||||||
from vorta.models import init_db, SettingsModel
|
from vorta.models import init_db
|
||||||
from vorta.application import VortaApp
|
from vorta.application import VortaApp
|
||||||
from vorta.config import SETTINGS_DIR
|
from vorta.config import SETTINGS_DIR
|
||||||
from vorta.updater import get_updater
|
from vorta.updater import get_updater
|
||||||
import vorta.sentry
|
|
||||||
import vorta.log
|
|
||||||
from vorta.utils import parse_args
|
from vorta.utils import parse_args
|
||||||
|
from vorta.log import init_logger
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -22,14 +21,12 @@ def main():
|
||||||
if os.fork():
|
if os.fork():
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
init_logger(foreground=want_foreground)
|
||||||
|
|
||||||
# Init database
|
# Init database
|
||||||
sqlite_db = peewee.SqliteDatabase(os.path.join(SETTINGS_DIR, 'settings.db'))
|
sqlite_db = peewee.SqliteDatabase(os.path.join(SETTINGS_DIR, 'settings.db'))
|
||||||
init_db(sqlite_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 = VortaApp(sys.argv, single_app=True)
|
||||||
app.updater = get_updater()
|
app.updater = get_updater()
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,16 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -10,8 +10,8 @@ from PyQt5 import QtCore
|
||||||
from PyQt5.QtWidgets import QApplication
|
from PyQt5.QtWidgets import QApplication
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
from ..models import EventLogModel, BackupProfileMixin
|
from vorta.models import EventLogModel, BackupProfileMixin
|
||||||
from ..utils import keyring
|
from vorta.utils import keyring
|
||||||
|
|
||||||
mutex = QtCore.QMutex()
|
mutex = QtCore.QMutex()
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -174,8 +174,9 @@ class BorgThread(QtCore.QThread, BackupProfileMixin):
|
||||||
self.log_event(f'{parsed["path"]} ({parsed["status"]})')
|
self.log_event(f'{parsed["path"]} ({parsed["status"]})')
|
||||||
except json.decoder.JSONDecodeError:
|
except json.decoder.JSONDecodeError:
|
||||||
msg = line.strip()
|
msg = line.strip()
|
||||||
self.log_event(msg)
|
if msg: # Log only if there is something to log.
|
||||||
logger.warning(msg)
|
self.log_event(msg)
|
||||||
|
logger.warning(msg)
|
||||||
|
|
||||||
if p.poll() is not None:
|
if p.poll() is not None:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
|
@ -10,23 +10,25 @@ import os
|
||||||
import logging
|
import logging
|
||||||
from .config import LOG_DIR
|
from .config import LOG_DIR
|
||||||
|
|
||||||
logger = logging.getLogger('vorta')
|
logger = logging.getLogger()
|
||||||
logger.setLevel(logging.DEBUG)
|
|
||||||
|
|
||||||
# create handlers
|
|
||||||
fh = logging.FileHandler(os.path.join(LOG_DIR, 'vorta.log'))
|
|
||||||
# fh.setLevel(logging.DEBUG)
|
|
||||||
|
|
||||||
ch = logging.StreamHandler()
|
def init_logger(foreground=False):
|
||||||
ch.setLevel(logging.WARNING)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
logging.getLogger('peewee').setLevel(logging.INFO)
|
||||||
|
logging.getLogger('apscheduler').setLevel(logging.INFO)
|
||||||
|
|
||||||
# create logging format
|
# create logging format
|
||||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||||
|
|
||||||
# apply formatter
|
# create handlers
|
||||||
fh.setFormatter(formatter)
|
fh = logging.FileHandler(os.path.join(LOG_DIR, 'vorta.log'))
|
||||||
ch.setFormatter(formatter)
|
fh.setLevel(logging.DEBUG)
|
||||||
|
fh.setFormatter(formatter)
|
||||||
|
logger.addHandler(fh)
|
||||||
|
|
||||||
# add handlers
|
if foreground: # log to console, when running in foreground
|
||||||
logger.addHandler(fh)
|
ch = logging.StreamHandler()
|
||||||
logger.addHandler(ch)
|
ch.setLevel(logging.DEBUG)
|
||||||
|
ch.setFormatter(formatter)
|
||||||
|
logger.addHandler(ch)
|
||||||
|
|
|
@ -191,7 +191,7 @@ def init_db(con):
|
||||||
ArchiveModel, WifiSettingModel, EventLogModel, SchemaVersion])
|
ArchiveModel, WifiSettingModel, EventLogModel, SchemaVersion])
|
||||||
|
|
||||||
if BackupProfileModel.select().count() == 0:
|
if BackupProfileModel.select().count() == 0:
|
||||||
default_profile = BackupProfileModel(name='Default Profile')
|
default_profile = BackupProfileModel(name='Default')
|
||||||
default_profile.save()
|
default_profile.save()
|
||||||
|
|
||||||
# Default settings for all platforms.
|
# Default settings for all platforms.
|
||||||
|
@ -202,12 +202,6 @@ def init_db(con):
|
||||||
'type': 'checkbox',
|
'type': 'checkbox',
|
||||||
'label': 'Use light system tray icon (applies after restart, useful for dark themes).'
|
'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',
|
'key': 'enable_notifications', 'value': True, 'type': 'checkbox',
|
||||||
'label': 'Display notifications when background tasks fail.'
|
'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