zoph: Fix failing PHP configuration requirements

I tested both fresh install and updating an existing installation.
When updating an existing instance, the app had to be manually enabled,
so I added:

```
elif old_version < 2:
            self.enable()
```

Fixes: #2345

Signed-off-by: Benedek Nagy <contact@nbenedek.me>
[sunil: Change the config name to zoph-freedombox.php]
[sunil: Enable the config during update only if app is already enabled]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Benedek Nagy 2024-01-14 15:20:04 +01:00 committed by Sunil Mohan Adapa
parent acc498cb90
commit 9c5491de7e
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 18 additions and 1 deletions

View File

@ -7,6 +7,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.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
from plinth.modules.firewall.components import Firewall from plinth.modules.firewall.components import Firewall
@ -42,7 +43,7 @@ class ZophApp(app_module.App):
app_id = 'zoph' app_id = 'zoph'
_version = 1 _version = 2
def __init__(self): def __init__(self):
"""Create components for the app.""" """Create components for the app."""
@ -76,10 +77,18 @@ class ZophApp(app_module.App):
ports=['http', 'https'], is_external=True) ports=['http', 'https'], is_external=True)
self.add(firewall) self.add(firewall)
dropin_configs = DropinConfigs('dropin-configs-zoph', [
'/etc/apache2/conf-available/zoph-freedombox.conf',
])
self.add(dropin_configs)
webserver = Webserver('webserver-zoph', 'zoph', webserver = Webserver('webserver-zoph', 'zoph',
urls=['https://{host}/zoph/']) urls=['https://{host}/zoph/'])
self.add(webserver) self.add(webserver)
webserver = Webserver('webserver-zoph-freedombox', 'zoph-freedombox')
self.add(webserver)
backup_restore = ZophBackupRestore('backup-restore-zoph', backup_restore = ZophBackupRestore('backup-restore-zoph',
**manifest.backup) **manifest.backup)
self.add(backup_restore) self.add(backup_restore)
@ -91,6 +100,9 @@ class ZophApp(app_module.App):
privileged.setup() privileged.setup()
if not old_version: if not old_version:
self.enable() self.enable()
elif old_version < 2:
if self.get_component('webserver-zoph').is_enabled():
self.enable()
class ZophBackupRestore(BackupRestore): class ZophBackupRestore(BackupRestore):

View File

@ -0,0 +1,5 @@
<Location "/zoph">
<IfModule proxy_fcgi_module>
ProxyFCGISetEnvIf true PHP_VALUE "max_execution_time = 100 \n upload_max_filesize = 16M \n post_max_size = 16M"
</IfModule>
</Location>