mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
nextcloud: Minor refactoring
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
722da5b0d5
commit
72c8a3f7b8
@ -251,13 +251,13 @@ def _configure_ldap():
|
|||||||
def _configure_systemd():
|
def _configure_systemd():
|
||||||
"""Create systemd units files for container and cron jobs."""
|
"""Create systemd units files for container and cron jobs."""
|
||||||
# Create service and timer for running periodic php jobs.
|
# Create service and timer for running periodic php jobs.
|
||||||
nextcloud_cron_service_content = '''
|
nextcloud_cron_service_content = f'''
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Nextcloud cron.php job
|
Description=Nextcloud cron.php job
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecCondition=/usr/bin/podman exec --user www-data nextcloud-freedombox php occ status -e
|
ExecCondition=/usr/bin/podman exec --user www-data {CONTAINER_NAME} /var/www/html/occ status -e
|
||||||
ExecStart=/usr/bin/podman exec --user www-data nextcloud-freedombox php /var/www/html/cron.php
|
ExecStart=/usr/bin/podman exec --user www-data {CONTAINER_NAME} php /var/www/html/cron.php
|
||||||
KillMode=process
|
KillMode=process
|
||||||
''' # noqa: E501
|
''' # noqa: E501
|
||||||
nextcloud_cron_timer_content = '''[Unit]
|
nextcloud_cron_timer_content = '''[Unit]
|
||||||
@ -293,9 +293,8 @@ def uninstall():
|
|||||||
def _drop_database():
|
def _drop_database():
|
||||||
"""Drop the database that was created during install."""
|
"""Drop the database that was created during install."""
|
||||||
with action_utils.service_ensure_running('mysql'):
|
with action_utils.service_ensure_running('mysql'):
|
||||||
query = f'''DROP DATABASE IF EXISTS {DB_NAME};
|
_database_query(f'DROP DATABASE IF EXISTS {DB_NAME};')
|
||||||
DROP USER IF EXISTS '{DB_USER}'@'localhost';'''
|
_database_query(f"DROP USER IF EXISTS '{DB_USER}'@'localhost';")
|
||||||
_database_query(query)
|
|
||||||
|
|
||||||
|
|
||||||
def _generate_secret_key(length=64, chars=None):
|
def _generate_secret_key(length=64, chars=None):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user