- Without this users can create multiple repositories for the same disk
location.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Make consumers depend on the repository classes instead of lower level store
API.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
get_repositories method will return repositories instead of dictionaries for
view content. This will make it usable in more situations.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Same module is being used to store/retrieve local disk repositories also.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This introduces flake8 and fixes a bunch of flake8 errors.
flake8 is run with: ./venv/bin/flake8 plinth
if you're using a python3 venv.
We can eventually further integrate this with gitlab ci.
https://salsa.debian.org/freedombox-team/plinth/issues/58
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Remove Python code to handle the extra item in the submitted form
- The select-all checkbox is never submitted in the form since it is missing the
"name" attribute
- Replace selector ':checkbox' with the faster selector '[type=checkbox]'
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This is less tiresome for users and also improves the speed of functional tests.
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Ensure that the fingerprint accepted is the one verified by user. If they
fingerprints and public keys are retrieved separately, there is chance that what
was verified by the user is not what is added to the known hosts file.
- Avoid creating a temporary file when fetching keys
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
- Assume that their SSH public keys are not unverified.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
- Add docstrings.
- Add blank lines for extra readability.
- Use <span> instead of <i> tag for icon in template.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
- From SSH manual, a path may contain : if it is presented as absolute path.
Update regular expression for splitting accordingly.
- Allow Null paths similar to SSH.
- Perform a full regular expression match when splitting path.
- Simplify regular expression.
- Update tests.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
- Create empty directory if not exists
- Check if the directory is empty
- if not empty, check if it's an existing backup repository
- else throw an error
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
- fixes issues as supposed by jvalleroy
- new repositories always get a UUID so they can immediately be fully
used (mounted, queried etc) also before saving them
- remove test connection page -- errors are shown on form submission
- improved error handling when creating remote repositories
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- integrate remote repositories into backups index page
- remove, mount and unmount repositories via UI
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Disk labels are unreliable. They may not exist. There are not unique and two
disks in the system may have the same label. Instead use the device path of the
disk/partition.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Introduce a BackupApp class to store all information about application being
backed up. This cleans up apps lists vs. manifest lists spread out in the
code.
- Introduce ServiceHandler to abstract dealing with services and web
configuration.
- Add enable and disable actions in apache action.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This serves two purposes. First is to assure user in the interface that backup
of the module is not required. Second is to make sure that if an application
is installed during backup it is also reinstalled during restore process (this
need to be implemented).
- Allow backup test to run independently. Initialize the cfg module so that
load_modules() works.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- added unittests
- introduced function backups.get_location_path()
- minor docstring / comment and naming updates
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Allow selection of Root Filesystem or any removable drive.
- Export to FreedomBox-backups folder in selection location.
- Handle export location without / at the end
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>