nextcloud / nextcloud/ansible-collection-nextcloud-admin
Fix Common Name for self-signed TLS certificate
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 165
- Forks
- 86
- Avg merge
- 15d 13h
- Merged PRs (30d)
- 1
Description
A self-signed TLS certificate is generated by an Ansible task running the required OpenSSL command. A certificate needs a common name, which should match the requested domain name.
Currently this common name is gathered from the hostname command, like this: https://github.com/nextcloud/ansible-collection-nextcloud-admin/blob/a03c570ddab00d55c6a0c686f130f44a5af5351c/roles/install_nextcloud/tasks/tls_selfsigned.yml#L13
But this "fails" and just generates a certificate with the literal text: ${hostname --fqdn}
I changed it to use an Ansible fact gathered beforehand, like: {{ ansible_facts["fqdn"] }}
WIth the help of that change the self signed certificate generation works fine and the common name matches the configured hostname.
This task would mostly be used for quick demos to spin Nextcloud and not need to worry about the TLS certificates yet. So this a minor detail. I hope it helped!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with roles/install_nextcloud/tasks/tls_selfsigned.yml at the OpenSSL command around line 13, and compare how the common name is currently obtained with the Ansible fact described in the issue. Verify that the generated self-signed certificate uses the configured hostname as its common name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ansible
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100