From dcdb52c047c15c7351129f82f8e922f96210fd57 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Mon, 23 Dec 2024 12:23:58 +0000 Subject: [PATCH] add: nextcloud php config --- group_vars/all.yaml | 7 +++ group_vars/ths.yaml | 5 +++ roles/nextcloud/tasks/main.yaml | 7 +++ .../nextcloud/templates/nextcloud-config.php | 43 +++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 roles/nextcloud/templates/nextcloud-config.php diff --git a/group_vars/all.yaml b/group_vars/all.yaml index 00554f4..0be6b00 100644 --- a/group_vars/all.yaml +++ b/group_vars/all.yaml @@ -11,6 +11,12 @@ code_server_password: HISTORY_PURGED_SECRET nextcloud_ssl_enabled: false nextcloud_cert_name: nextcloud.atlantishq.de +nextcloud_instance_id: HISTORY_PURGED_SECRET +nextcloud_password_salt: HISTORY_PURGED_SECRET +nextcloud_instance_secret: HISTORY_PURGED_SECRET +nextcloud_master_domain: nextcloud.atlantishq.de +nextcloud_db_password: HISTORY_PURGED_SECRET + tor_bridge_name: HISTORY_PURGED_SECRET tor_bridge_email: nobody@HISTORY_PURGED_SECRET.com @@ -93,6 +99,7 @@ opensearch_manager_nodes: extra_root_keys: - "# no extra keys" +smtp_user_domain: atlantishq.de smtp_internal_host: mail.atlantishq.de smtp_internal_host_port: 8025 smtp_service_user: noreply diff --git a/group_vars/ths.yaml b/group_vars/ths.yaml index d44ee55..ec6fa36 100644 --- a/group_vars/ths.yaml +++ b/group_vars/ths.yaml @@ -1,4 +1,9 @@ --- nextcloud_nginx_ssl_enabled: false +nextcloud_instance_id: HISTORY_PURGED_SECRET +nextcloud_password_salt: HISTORY_PURGED_SECRET +nextcloud_instance_secret: HISTORY_PURGED_SECRET +nextcloud_master_domain: ths.atlantishq.de +nextcloud_db_password: HISTORY_PURGED_SECRET checks : - { user : sheppy, name : irc, cmd : ""} diff --git a/roles/nextcloud/tasks/main.yaml b/roles/nextcloud/tasks/main.yaml index 0fcd97a..c9b2d04 100644 --- a/roles/nextcloud/tasks/main.yaml +++ b/roles/nextcloud/tasks/main.yaml @@ -11,6 +11,13 @@ job: /usr/bin/sudo -u www-data /usr/bin/php -f /var/www/nextcloud/cron.php user: root +- name: Template nextcloud php conf + template: + src: "nextcloud-config.php" + dest: "/var/www/nextcloud/config/config.php" + owner: www-data + group: www-data + - name: Template nginx base conf template: src: "{{ item }}" diff --git a/roles/nextcloud/templates/nextcloud-config.php b/roles/nextcloud/templates/nextcloud-config.php new file mode 100644 index 0000000..fc864ab --- /dev/null +++ b/roles/nextcloud/templates/nextcloud-config.php @@ -0,0 +1,43 @@ + '{{ nextcloud_instance_id }}', + 'passwordsalt' => '{{ nextcloud_password_salt }}', + 'secret' => '{{ nextcloud_instance_secret }}', + 'trusted_domains' => + array ( + 0 => '{{ nextcloud_master_domain }}', + ), + 'datadirectory' => '/var/www/nextcloud/data', + 'dbtype' => 'pgsql', + 'version' => '30.0.4.1', + 'overwrite.cli.url' => 'https://{{ nextcloud_master_domain }}', + 'dbname' => 'nextcloud', + 'dbhost' => 'localhost', + 'dbport' => '', + 'dbtableprefix' => 'oc_', + 'dbuser' => 'nextcloud', + 'dbpassword' => '{{ nextcloud_db_password }}', + 'installed' => true, + 'mail_domain' => '{{ smtp_user_domain }}', + 'mail_from_address' => 'noreply', + 'mail_smtpmode' => 'smtp', + 'mail_sendmailmode' => 'smtp', + 'mail_smtphost' => '{{ smtp_internal_host }}', + 'mail_smtpport' => '{{ smtp_internal_host_port }}', + 'default_phone_region' => 'DE', + 'app_install_overwrite' => + array ( + 0 => 'twofactor_rcdevsopenotp', + 1 => 'calendar', + ), + 'maintenance' => false, + 'theme' => '', + 'loglevel' => 0, + 'encryption.legacy_format_support' => false, + 'encryption.key_storage_migrated' => false, + 'mail_smtpauth' => 1, + 'mail_smtpname' => '{{ smtp_service_user }}@{{ smtp_user_domain }}', + 'mail_smtppassword' => '{{ smtp_service_pass }}', + 'maintenance_window_start' => 100, + 'memcache.local' => '\OC\Memcache\APCu', +);