This seems to be a regression from earlier behavior.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Mock the app so that it doesn't have to be loaded.
Closes: #1645.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Remove checking of the sender is 'test' and use mocking.
- Remove need for tests being run as root.
- Simplify log messages, avoid pylint warnings.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Refactor the help menu into a django template include.
- Show help menu if user is logged in, instead of after completing firstboot.
Closes: #1517
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil@medhas.org Rename help-menu.inc to help-menu.inc]
[sunil@medhas.org Use user.is_authenticated instead of another variable]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
No longer showing network connections in firstboot. Removed dead code.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Use '#' vs '$' to indicate root vs. user message.
- Remove '-n' argument to sudo as it is always present.
- Remove env arguments to sudo as they are only present during debug.
- Remove full path to the action as they are already thoroughly checked.
- Print the message as a shell command with escapes instead of as python list.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
It is no longer very useful and floods the log window, taking our attention away
from more import things. It is only useful during new module development. Module
load order message helps anyway.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Add a domain only if it is not already present.
- Remove a domain only if it is already present.
- Refactor utility methods in separate module for reuse.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Debian has a patch to configuration to change port 5443 to 5280 in ejabberd
package version 18.12. However, 5443 is the correct port to host BOSH. So,
change it back. In 19.x, this behavior has changed to use both ports 5443 (for
BOSH) and 5280 (for web administration).
Closes: #1640.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
When a large number of archives and repositories exist, the add repository
buttons are not easily discover-able by the user.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
When there are no additional disks available, don't show an empty drop down
for disks and throw an error when submitting. Instead make it clear that no
additional disks are available and that is why repository can't be created.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- 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>
- Without this error, users will believe that a repository is encrypted (as
password is provided) but it is not (repository was created earlier without a
password).
- Remove the need to send credentials, an instance property, while getting
encryption data, an instance method.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Simplify repository initialization using inheritance.
- Share the code for saving repository for disk and remote repositories. Error
messages are properly handled for disk repositories too.
- Move logic to create remote SSH directory to SSH repository class instead of
views.
- Create a new error for handling borg repository already existing while
initialization.
- Get information of repository after initializing so that password errors are
caught early.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- No need to override run method in derived class if known_credentials is a
class property exposed by base class.
- Move a method for cosmetic.
- Minor formatting.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
The constructor of the Repository object is being used for two distinct
purposes. One is to load the object from database and other to instantiate it
with parameter such that it can be saved to database. Separating the two usages
to different methods simplifies code and parameter passing for consumers.
Also turn some class specific constants from globals to class constants.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
It is being used to mean initialize the borg repository as well as creating an
instance of the repository class object. Use 'initialize' for former and
'get_instance' for latter.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Use repository class instances instead of custom ad-hoc data structures such as
repo_data.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Make store an internal implementation detail of the repository class and achieve
better abstraction.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
It is not required by any consumers. Allows for better abstraction on a complex
class.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
borg_path clearly signifies that it is to be used by borg and consumers of the
class will not be confused by it.
Also rename some repo_path variables in test cases.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Since the method is being called on Repository classes, _repository suffix is
redundant.
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>
- Use sort_order property to decide which type of repositories should be listed
first.
- Remove getting repositories of a given type and retrieve all of them at the
same time.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Also make storage_type an abstract property so that derived classes are forced
to override it.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Remove incorrect instantiation of SSH repository for local disk repositories.
- Clarify the removal message to convey that backups are not removed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>