wordpress: Use drop-in config component for /etc files

Tests:

- Config files are all symlinks in /etc/
- Web interface works
- Adding a plugin using auto-download works
- fail2ban-client status shows wordpress-freedombox
- fail2ban catches invalid login attempts

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2023-05-16 13:53:31 -07:00 committed by James Valleroy
parent 73bc89b916
commit 86444764a7
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
6 changed files with 14 additions and 1 deletions

View File

@ -144,3 +144,7 @@ rm_conffile /etc/apt/apt.conf.d/20freedombox-allow-release-info-change 23.10~
rm_conffile /etc/apt/apt.conf.d/60unattended-upgrades 23.10~ rm_conffile /etc/apt/apt.conf.d/60unattended-upgrades 23.10~
rm_conffile /etc/needrestart/conf.d/freedombox.conf 23.10~ rm_conffile /etc/needrestart/conf.d/freedombox.conf 23.10~
rm_conffile /etc/apache2/includes/freedombox-auth-ldap.conf 23.10~ rm_conffile /etc/apache2/includes/freedombox-auth-ldap.conf 23.10~
rm_conffile /etc/apache2/conf-available/wordpress-freedombox.conf 23.10~
rm_conffile /etc/fail2ban/jail.d/wordpress-freedombox.conf 23.10~
rm_conffile /etc/fail2ban/filter.d/wordpress-freedombox.conf 23.10~
rm_conffile /etc/wordpress/freedombox-static.php 23.10~

View File

@ -5,6 +5,7 @@ from django.utils.translation import gettext_lazy as _
from plinth import app as app_module from plinth import app as app_module
from plinth import cfg, frontpage, menu from plinth import cfg, frontpage, menu
from plinth.config import DropinConfigs
from plinth.daemon import Daemon from plinth.daemon import Daemon
from plinth.modules.apache.components import Webserver from plinth.modules.apache.components import Webserver
from plinth.modules.backups.components import BackupRestore from plinth.modules.backups.components import BackupRestore
@ -42,7 +43,7 @@ class WordPressApp(app_module.App):
app_id = 'wordpress' app_id = 'wordpress'
_version = 3 _version = 4
def __init__(self): def __init__(self):
"""Create components for the app.""" """Create components for the app."""
@ -86,6 +87,14 @@ class WordPressApp(app_module.App):
conflicts_action=Packages.ConflictsAction.REMOVE) conflicts_action=Packages.ConflictsAction.REMOVE)
self.add(packages) self.add(packages)
dropin_configs = DropinConfigs('dropin-configs-wordpress', [
'/etc/apache2/conf-available/wordpress-freedombox.conf',
'/etc/fail2ban/jail.d/wordpress-freedombox.conf',
'/etc/fail2ban/filter.d/wordpress-freedombox.conf',
'/etc/wordpress/freedombox-static.php',
])
self.add(dropin_configs)
firewall = Firewall('firewall-wordpress', info.name, firewall = Firewall('firewall-wordpress', info.name,
ports=['http', 'https'], is_external=True) ports=['http', 'https'], is_external=True)
self.add(firewall) self.add(firewall)