From 2f8ccf3dd0ed81c41b3c4a07694a3fb45594ef0a Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 22 Sep 2022 14:06:14 -0700 Subject: [PATCH] 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 --- plinth/modules/wordpress/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plinth/modules/wordpress/__init__.py b/plinth/modules/wordpress/__init__.py index ae1edd000..ac4f6519d 100644 --- a/plinth/modules/wordpress/__init__.py +++ b/plinth/modules/wordpress/__init__.py @@ -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):