wordpress: Reload apache after app update

- So that the new configuration file to disable
readme.html/xmlrpc.php/wp-cron.php takes effect.

Tests:

- Install wordpress without the security changes. Notice that the three URLs are
accessible. Apply the patch, run ./setup install and restart FreedomBox service.
Wordpress app is updated and the security changes take effect. The three URLs
are return forbidden response without manually restarting apache2.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa 2022-09-22 14:06:14 -07:00
parent f702e044f3
commit 2f8ccf3dd0

View File

@ -46,7 +46,7 @@ class WordPressApp(app_module.App):
app_id = 'wordpress'
_version = 2
_version = 3
def __init__(self):
"""Create components for the app."""
@ -109,6 +109,9 @@ class WordPressApp(app_module.App):
actions.superuser_run('wordpress', ['setup'])
if not old_version:
self.enable()
elif old_version < 3:
# Apply changes to Apache configuration from v2 to v3.
actions.superuser_run('service', ['reload', 'apache2'])
class WordPressBackupRestore(BackupRestore):