Fixes: #2381.
When app is being uninstalled, it is disabled. Use that to not show the setup
page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2376.
Fixes: #2317.
When an app is removed, its packages are purged. However, there is another
installed app that needs these packages, we should keep those packages. We have
already implemented checking the packages against other apps' packages. However,
we are not checking if we are removing dependencies of other apps' packages.
This will still result in removal apps' packages.
To solve this problem, get list of packages of all the apps, then iterate over
their dependencies recursively and compile a comprehensive list of packages to
keep. Use this to reduce the set of packages to remove.
Tests:
- Without the patch, install bepasty and janus. Uninstall janus app and notice
that bepasty package is removed. With the patch, the problem is not observed.
- Printing the comprehensive list of packages to keep shows an extensive set
computed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
NetBIOS was used with now deprecated SMB1 protocol.
Tests performed:
- Windows 10 can access shares when the nmbd service is disabled.
- In stable and testing containers, all the samba module tests pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Also:
- Remove addressses [fc00::]/7 and [fe80::] from `allow hosts`, as
those had no effect as described in #2334.
- Remove unknown parameter `access control = yes` from Samba
configuration.
Tests performed in a stable container:
- After Samba app upgrade was performed, enabled Samba Home share.
- Using the `testparm` command, checked that the share is accessible
from ::1 IPv6 address:
```
> sudo testparm -s /etc/samba/smb-freedombox.conf host-ip ::1
Allow connection from host-ip (::1) to disk_home
> sudo testparm -s /etc/samba/smb-freedombox.conf host-ip ::2
Denied connection from host-ip (::2)
Deny connection from host-ip (::2) to disk_home
```
- Checked that when `ping localhost` returns ::1 in the container,
all the Samba tests pass.
Closes#2334.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Simplify success message for easy localization.
Tests:
- Update configuration notice the success message is shown properly.
- Insert errors in set_config() privileged method and notice that HTML error is
shown properly.
- Insert errors in privileged.delete() method, print 'Config is in use.' message
on stderr and notice that HTML error is shown properly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Reduce the number of specialized messages to ease localization and clear way
for generalized configuration change handler.
Tests:
- Update the one or two configuration setting at the same time and notice that a
single message is shown.
- When no setting is changed and form is submitted, 'settings unchanged' message
is shown.
- Raise error when enabling/disable auto updates and notice a proper HTML error
shown. When other setting is also updated, then one error and one success
message is shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- In a VM, mount a loopback disk. Insert an error in ejected code and notice
that HTML message is shown properly during eject operation.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This allows the certbot command output to be shown accurately in the HTML
error message.
Tests:
- Edit the code to show all the action buttons in the UI. Set domain to
mydomain.example. Run all four actions. Notice that HTML error message are shown
and certbot output is shown properly in stdout/stderr sections.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Edit auto-mounting to try mounting an already mounted device. In a VM, during
service startup, notice the warning about failure to auto-mount as device is
already mounted.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- The privileged call already prints the log message with full error details.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- We have new way to show extra details with exceptions in HTML.
- This handling of error details in PackageException is mostly unused and
unnecessary complexity.
Tests:
- Introduce exception into package.install() and package.uninstall() methods.
Test that exceptions are being shown properly in Django error messages.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Insert an exception in privileged setup() and uninstall() method and try to
install/uninstall app and notice that error messages are shown in a simple
format and extra details are provided, collapsed by default.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2161.
- Sections are ordered by importance on which administrator must act after
setting up the system.
- Consistent order across all the languages.
- Update the styling for the section hearers.
- For system section, make them compact.
- Make them look like a header text (with underline) rather than a
divider (like in a menu).
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Mostly because administrators won't discover the email address field for the
user later on.
- This field is important to be able to run 'reset password' operation.
Tests:
- In stable and testing containers, run first boot wizard. Enter the email
address during the first boot and see that it was saved as part of user account.
Leave the email address blank and it is possible to proceed. User account show
blank email address.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Overlooked in !2454.
Tests:
- Take a backup of wordpress app and disable it. Restore from the backup
succeeds after that.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Fixes an issue with zoph not being setup after uninstall+install setup and
makes a test pass.
- Some failures exist but don't seem related to this change.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2346.
Tests:
- Without the patch, install zoph, take a backup. Note the db password in
/etc/zoph.ini. Uninstall zoph. Install it. Note that db password changed.
Restore from previous backup. Note that password has been restored to old value
and zoph is unable to connect to database.
- With the patch, repeat the test and notice zoph works after restore.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
When mysql server is not running, app installation fails. Similarly the setup
process will fail when app is being upgrade and database upgrade needs to be
performed. So, ensure that database server is running before attempting
install/upgrade of app.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This will help apps like zoph that need to have database server running to
install or upgrade a package.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When app is disabled, it can't be setup as it requires database server and
connecting to the database.
- If app is disabled, we don't show configuration any more, so redirection to
setup page is also not needed. This results in neither setup nor configuration
being shown when app is disabled.
- During uninstall process, app is disable for first. So, the workaround
implemented in is_configured() is no longer needed.
Tests:
- Install zoph. Setup page is shown. Disable the app by disabling the apache
configuration for it and restart service. Setup is no longer shown.
- Uninstall zoph. During the uninstall setup, when page is refreshing, setup
page is not shown.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- MySQL server may be disabled when zoph is disabled. Trying to retrieve
configuration or trying to set the configuration at the time will result in
failures. So, disable the configuration form so that get/set of configuration
does not happen.
Tests:
- Disable zoph. Configuration form will disappear. Re-enable zoph, configuration
form will reappear.
- Functional tests for zoph pass.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Some apps store their configuration in database. The database server may not
be running when app is disabled. Configuration changes may then not be
possible for such apps. Provide the ability to disable configuration for apps
that don't support configuration changes when disabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Install zoph and disable it. This will install mysql and disable it. Then
install wordpress. Installation should succeed.
- Disable wordpress and re-run setup. Setup should succeed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>