Skip to content

Feature Request: Normalize SSL provider tasks #893

@tangrufus

Description

@tangrufus

What is the current behavior?

  • letsencrypt has its own role whereas self-signed-certificate is embedded inside wordpress-setup.

  • Although letsencrypt task is separated, its variables (for example: letsencrypt_cert_ids) are leaded to other tasks like wordpress-setup because they are used in Nginx templates.

What is the expected or desired behavior?

Normalize SSL provider tasks:

  • Separate self-signed-certificate task

  • SSL provider tasks (letsencrypt & self-signed-certificate) template their own Nginx config to {{ nginx_path }}/includes.d/{{ item.key }}/ssl/xxx.conf (Note: ssl subdirectory!)

  • Remove hardcoded Nginx ssl config, for example:

    {% if item.value.ssl.provider | default('manual') == 'manual' and item.value.ssl.cert is defined and item.value.ssl.key is defined -%}
    ssl_certificate {{ nginx_path }}/ssl/{{ item.value.ssl.cert | basename }};
    ssl_certificate_key {{ nginx_path }}/ssl/{{ item.value.ssl.key | basename }};
    {% elif item.value.ssl.provider | default('manual') == 'letsencrypt' -%}
    ssl_certificate {{ nginx_path }}/ssl/letsencrypt/{{ item.key }}-{{ letsencrypt_cert_ids[item.key] }}-bundled.cert;
    ssl_certificate_key {{ nginx_path }}/ssl/letsencrypt/{{ item.key }}.key;
    {% elif item.value.ssl.provider | default('manual') == 'self-signed' -%}
    ssl_certificate {{ nginx_path }}/ssl/{{ item.key }}.cert;
    ssl_trusted_certificate {{ nginx_path }}/ssl/{{ item.key }}.cert;
    ssl_certificate_key {{ nginx_path }}/ssl/{{ item.key }}.key;
    {% endif -%}
    {% endif -%}
    {% endblock -%}

  • Move SSL provider tasks after wordpress-setup to prevent wordpress-setup/nginx-includes from deleting ssl nginx config.

Please provide use cases for changing the current behavior:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions