8 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
8ba444990b
backups: Set proper permissions for backups-data directory
Fixes: #2554

- Update permissions on the backups-data directory so that files are only
accessible by root users.

- Ensure that the directory is created by the 'backups' app and not by each of
the apps that take the backup.

Tests:

- Run functional tests for miniflux, dynamicdns, wordpress, zoph, and nextlcoud.
There was an unrelated functional test case failure in nextcloud.

- On a fresh installation, apply patch. Service is restarted. The directory is
created with proper permissions and ownership.

- On a fresh installation, without the patch. Backup the dynamicdns app. The
directory is created with incorrect permissions. Apply the patch. Service is
restarted. Proper permissions are set on the directory.

- On a setup with incorrect permissions, re-run backups app's setup. The
permissions are updated correctly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-12-15 20:16:36 -05:00
Sunil Mohan Adapa
61ff15a04f
*: Use action_utils.run instead of subprocess.run
- This is to capture stdout and stderr and transmit that from privileged daemon
back to the service to be displayed in HTML.

Tests:

- Unit tests and code checks pass.

- Some of the modified actions work as expected.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2025-09-29 16:58:53 +03:00
Sunil Mohan Adapa
f9c624562a
wordpress: Fix minor issue in restoring database
- 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>
2024-03-11 15:24:21 -07:00
Sunil Mohan Adapa
f0ff0c181b
wordpress: Drop database user when app is uninstalled
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-11 16:50:45 -04:00
Sunil Mohan Adapa
d615ff107e
wordpress: Fix backup, restore and uninstall when db is not running
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-11 16:50:42 -04:00
Sunil Mohan Adapa
717e8cd7f5
wordpress: Don't fail setup if mysql installed but not running
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>
2024-03-11 16:50:12 -04:00
nbenedek
30b0019865
wordpress: Completely uninstall app
* When app is uninstalled, remove config files and drop the database
* Declare PUBLIC_ACCESS_FILE with pathlib.Path
* Add public access file to the backup manifest

Tests:
1. Install and setup wordpress
2. Reinstall the app and confirm that the initial setup page is shown to the user
3. Functional tests passed

Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, minor refactoring]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-04-14 18:58:59 +05:30
Sunil Mohan Adapa
d68a84d245
wordpress: Use privileged decorator for actions
Tests:

- Functional tests work (when libpam-tmpdir is removed)
  - Backup and restore of database works
- Initial setup work
  - Configuration file is created
  - Database is created
  - Website is accessible
- Enabling/disabling public access works
  - Configuration file created/deleted
  - App page show proper status

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:53:39 -04:00