diff --git a/.bumpversion.cfg b/.bumpversion.cfg index ef473914..b8e804d4 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -4,8 +4,7 @@ commit = True tag = True [bumpversion:file:Makefile] - +[bumpversion:file:setup.cfg] [bumpversion:file:vorta.spec] - [bumpversion:file:src/vorta/_version.py] diff --git a/.gitignore b/.gitignore index dd506460..15d048e5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ docs/ bin/ __pycache__ Makefile +.eggs +vorta.egg-info diff --git a/README.md b/README.md index fa9d70fe..5414a313 100644 --- a/README.md +++ b/README.md @@ -2,31 +2,50 @@ ![](https://files.qmax.us/vorta-screencast-2.gif) -[Vorta](http://memory-alpha.wikia.com/wiki/Vorta) is a GUI for [BorgBackup](https://borgbackup.readthedocs.io). It's in alpha status and currently has the following features: +Vorta is a macOS/Linux GUI for [BorgBackup](https://borgbackup.readthedocs.io). It's currently in alpha status. -- [x] Select and create SSH keys without using the Terminal -- [x] Securely save repo password in Keychain. -- [x] Initialize new remote Borg repositories -- [x] Create new Borg snapshots (backups) from local folders -- [x] Mount existing snapshots with FUSE -- [x] Settings stored in sqlite -- [x] Exclude options/patterns. -- [x] Rule-based scheduling by time, Wifi SSID, etc. -- [x] Scheduling for background backups. -- [x] Tests (partly) +## Main features -Missing features: +- Encrypted, deduplicated and compressed backups to remote repositories +- Works with any remote SSH account that has `borg` installed. Or try [BorgBase](https://www.borgbase.com) for advanced features like append-only repositories and monitoring. +- Add SSH keys and initialize repos directly from the GUI +- Repo keys are securely stored in macOS Keychain, Secret Service or KWallet +- Mount existing snapshots via FUSE +- Flexible scheduling for automatic background backups. +- View a list of snapshots and action logs +- Exclude options/patterns. + +Missing features: (PRs welcome) - [ ] Repo pruning - [ ] Repo checking +- [ ] Full test coverage +- [ ] Packaging for Linux -## Download +## Installation and Download +### macOS The app package under [Releases](https://github.com/borgbase/vorta/releases) should include everything. Just download, unzip and run. -## Development -Conda is used for dependency management. Create a new virtual env using: +### Linux +No package yet. First install Borg's own [dependencies](https://borgbackup.readthedocs.io/en/stable/installation.html#dependencies). Then install via ``` -$ conda env create environment.yml +$ pip install vorta +``` + +After installation run with the `vorta` command. +``` +$ vorta +``` + +## Development +Install in development mode: +``` +$ pip install -e . +``` + +Then run via +``` +$ vorta ``` Qt Creator is used to edit views. Install using Homebrew and then open the .ui files in `vorta/UI`: @@ -35,19 +54,20 @@ $ brew cask install qt-creator $ brew install qt ``` -To run directly: -``` -PYTHONPATH=src python -m vorta -``` - To build a binary package: ``` $ pyinstaller --clean --noconfirm vorta.spec ``` ### Testing (work in progress) -Tests are in the folder `/tests`. Run them with `PYTHONPATH=src pytest`. Testing happens at the level of UI components. Calls to `borg` are mocked and can be replaced with some example json-output. +Tests are in the folder `/tests`. Testing happens at the level of UI components. Calls to `borg` are mocked and can be replaced with some example json-output. To run tests: +``` +$ python setup.py test +``` +## Privacy Policy +- No personal data is ever stored or transmitted by this application. +- During beta, crash reports are sent to [Sentry](https://sentry.io) to quickly find bugs. ## Why the Name? [Vorta](http://memory-alpha.wikia.com/wiki/Vorta) are a race referenced in Star Trek. They serve the Dominion and are replaced by their clones if they die. Just like our backups. diff --git a/environment.yml b/environment.yml deleted file mode 100644 index f14d6e4f..00000000 --- a/environment.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: vorta - -channels: -- conda-forge -- defaults - -dependencies: -- python=3.6.6 -- pyinstaller - -- pip: - - appdirs - - paramiko - - pyqt5 - - peewee - - python-dateutil - - keyring - - pytest - - pytest-qt - - pytest-mock diff --git a/setup.cfg b/setup.cfg index 667d3c43..ecf55c5e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,66 @@ +[metadata] +name = vorta +author = Manuel Riel +description = A GUI for BorgBackup +version = 0.2.0 +url = https://github.com/borgbase/vorta +keywords = + backup + borgbackup +classifiers = + Development Status :: 3 - Alpha + Environment :: MacOS X + Environment :: X11 Applications :: Qt + Operating System :: MacOS + Operating System :: POSIX + License :: OSI Approved :: GNU General Public License v3 (GPLv3) + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Topic :: System :: Archiving :: Backup + Topic :: System :: Systems Administration + Topic :: Utilities +long_description = file: README.md +long_description_content_type = text/markdown +license_file = LICENSE.txt + +[aliases] +test=pytest + +[options] +python_requires = >= 3.6 +setup_requires = + setuptools >= 38.6 + pip >= 10 + pytest-runner + setuptools_git +include_package_data = True +find_packages = + exclude = tests +install_requires = + appdirs + paramiko + pyqt5 + peewee + python-dateutil + keyring + borgbackup + +[options.extras_require] +tests = + pytest + pytest-qt + pytest-mock + mypy + mypy-extensions + +[options.entry_points] +gui_scripts = + vorta = vorta.__main__ + + [tool:pytest] +addopts = -s +testpaths = tests qt_default_raising = true filterwarnings = ignore::DeprecationWarning diff --git a/setup.py b/setup.py index e69de29b..acca8ee2 100644 --- a/setup.py +++ b/setup.py @@ -0,0 +1 @@ +from setuptools import setup; setup() diff --git a/src/vorta/__main__.py b/src/vorta/__main__.py index a5fe34b7..65f1953f 100644 --- a/src/vorta/__main__.py +++ b/src/vorta/__main__.py @@ -2,19 +2,15 @@ import sys import os import peewee +import vorta.models +from vorta.application import VortaApp +from vorta.config import SETTINGS_DIR + # Send crashes to Sentry if getattr(sys, 'frozen', False): import sentry_sdk sentry_sdk.init("https://a4a23df3e44743d5b5c5f06417a9a809@sentry.io/1311799") -# Ensures resource file in icons-folder is found -from vorta.utils import get_asset -sys.path.append(os.path.dirname(get_asset('icons/collection.rc'))) - -import vorta.models -from vorta.application import VortaApp -from vorta.config import SETTINGS_DIR - # Init database sqlite_db = peewee.SqliteDatabase(os.path.join(SETTINGS_DIR, 'settings.db')) vorta.models.init_db(sqlite_db) diff --git a/src/vorta/assets/UI/repotab.ui b/src/vorta/assets/UI/repotab.ui index 067485f1..2f83ba87 100644 --- a/src/vorta/assets/UI/repotab.ui +++ b/src/vorta/assets/UI/repotab.ui @@ -81,7 +81,7 @@ - <html><head/><body><p>Needs Borg installed server-side. Or try <a href="https://www.borgbase.com"><span style=" text-decoration: underline; color:#0000ff;">BorgBase.</span></a> 100GB free during Beta.</p></body></html> + <html><head/><body><p>SSH account with Borg installed server-side. Also try <a href="https://www.borgbase.com"><span style=" text-decoration: underline; color:#0000ff;">BorgBase.</span></a> 100GB free during Beta.</p></body></html> true diff --git a/src/vorta/assets/icons/__init__.py b/src/vorta/assets/icons/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/vorta/assets/icons/collection_rc.py b/src/vorta/views/collection_rc.py similarity index 100% rename from src/vorta/assets/icons/collection_rc.py rename to src/vorta/views/collection_rc.py diff --git a/src/vorta/views/main_window.py b/src/vorta/views/main_window.py index f0a16a21..0ef7869b 100644 --- a/src/vorta/views/main_window.py +++ b/src/vorta/views/main_window.py @@ -11,7 +11,7 @@ from ..borg_runner import BorgThread uifile = get_asset('UI/mainwindow.ui') -MainWindowUI, MainWindowBase = uic.loadUiType(uifile) +MainWindowUI, MainWindowBase = uic.loadUiType(uifile, from_imports=True, import_from='vorta.views') class MainWindow(MainWindowBase, MainWindowUI): diff --git a/src/vorta/views/schedule_tab.py b/src/vorta/views/schedule_tab.py index 94f4593e..e6cc3941 100644 --- a/src/vorta/views/schedule_tab.py +++ b/src/vorta/views/schedule_tab.py @@ -4,7 +4,7 @@ from ..utils import get_asset, get_sorted_wifis from ..models import EventLogModel, WifiSettingModel, BackupProfileMixin uifile = get_asset('UI/scheduletab.ui') -ScheduleUI, ScheduleBase = uic.loadUiType(uifile) +ScheduleUI, ScheduleBase = uic.loadUiType(uifile, from_imports=True, import_from='vorta.views') class ScheduleTab(ScheduleBase, ScheduleUI, BackupProfileMixin):