Skip to content

Commit

Permalink
Merge pull request #280 from marioqxx/main
Browse files Browse the repository at this point in the history
Fix a bug in nc_apache2.j2 template concerning intermed-CA. Remove ansible-lint warnings and add config-variable needed for SSO to nc_apache2.j2 template.
  • Loading branch information
wiktor2200 authored Jun 28, 2023
2 parents 640a5e3 + 2febd3b commit 89326cb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions roles/install_nextcloud/tasks/tls_installed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ansible.builtin.set_fact:
nextcloud_tls_cert_key_file: "{{ nextcloud_tls_cert_key }}"

- name: "[INSTALLED TLS] - Define certificate chain path"
- name: "[INSTALLED TLS] - Define certificate chain path"
ansible.builtin.set_fact:
nextcloud_tls_cert_chain_file: "{{ nextcloud_tls_cert_chain }}"
nextcloud_tls_chain_file: "{{ nextcloud_tls_cert_chain }}"
when: nextcloud_tls_cert_chain is defined
22 changes: 12 additions & 10 deletions roles/install_nextcloud/tasks/tls_signed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
nextcloud_tls_chain_file: "{{ nextcloud_tls_chain_file | default(cert_path + nextcloud_instance_name + \".pem\") }}"
when: nextcloud_tls_src_chain is defined

- name: "[SIGNED TLS] - Copy certificate to the host"
- name: "[SIGNED TLS] - Copy certificate file for apache2 to the host"
ansible.builtin.copy:
dest: "{{ nextcloud_tls_cert_file }}"
src: "{{ nextcloud_tls_src_cert }}"
Expand All @@ -36,21 +36,23 @@
- nextcloud_tls_src_chain is defined
- nextcloud_websrv in ["nginx"]

- name: "[SIGNED TLS] - Key is copied to the host"
- name: "[SIGNED TLS] - Copy certificate chain file for apache2 to the host"
ansible.builtin.copy:
dest: "{{ nextcloud_tls_cert_key_file }}"
src: "{{ nextcloud_tls_src_cert_key }}"
dest: "{{ nextcloud_tls_chain_file }}"
src: "{{ nextcloud_tls_src_chain }}"
owner: "{{ nextcloud_websrv_user }}"
group: "{{ nextcloud_websrv_group }}"
mode: "0400"
mode: 0400
force: false
when:
- nextcloud_tls_src_chain is defined
- nextcloud_websrv not in ["nginx"]

- name: "[SIGNED TLS] - Certificate chain is copied to the host"
- name: "[SIGNED TLS] - Key is copied to the host"
ansible.builtin.copy:
dest: "{{ nextcloud_tls_chain_file }}"
src: "{{ nextcloud_tls_src_chain }}"
dest: "{{ nextcloud_tls_cert_key_file }}"
src: "{{ nextcloud_tls_src_cert_key }}"
owner: "{{ nextcloud_websrv_user }}"
group: "{{ nextcloud_websrv_group }}"
mode: "0640"
mode: 0400
force: false
when: nextcloud_tls_src_chain is defined
5 changes: 3 additions & 2 deletions roles/install_nextcloud/templates/apache2_nc.j2
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@
DocumentRoot {{ nextcloud_webroot }}
{% if (nextcloud_max_upload_size_in_bytes|int) <= 2147483647-%}
LimitRequestBody {{ nextcloud_max_upload_size_in_bytes }}
LimitRequestFieldsize 32768
{% endif -%}
SSLEngine on
SSLCertificateFile {{ nextcloud_tls_cert_file }}
SSLCertificateKeyFile {{ nextcloud_tls_cert_key_file }}
{% if nextcloud_tls_cert_chain_file is defined %}
SSLCertificateChainFile {{ nextcloud_tls_cert_chain_file }}
{% if nextcloud_tls_chain_file is defined %}
SSLCertificateChainFile {{ nextcloud_tls_chain_file }}
{% endif %}

# enable HTTP/2, if available
Expand Down

0 comments on commit 89326cb

Please sign in to comment.