Closed aaaskew closed 4 years ago
Thanks for your detailed issue!
The reason that we require a valid domain is that when this was made, self-signed certs didn't work.
You are welcome with a PR for review. :eyes:
Thanks!
I don't feel comfortable providing a pull request for a couple of reasons. Formost amongst those is that the change to the resolved.conf file is dependant on setting a fixed IP address and DNS server in Ubuntu Netplan. When you make that change, you also need to make this change. If someone can point me to an installation script for fixed DNS server settings then maybe this file can be edited in the same place.
Should this be a documentation improvement instead for people who set a fixed IP address?
The other reason for my uncertainty is that I don't know if this the right thing to do or if the docker image or setup for Collabora should be changed.
I don't have enough technical knowledge to know if it is possible to add a DNS server to a docker interface automatically when adding the Collabora docker image or if the Collabora image should not check the /etc/hosts file before DNS?
DNS is set here: https://github.com/nextcloud/vm/blob/master/nextcloud_install_production.sh#L172 and here: https://github.com/nextcloud/vm/blob/master/static/static_ip.sh#L121 which is this: https://github.com/nextcloud/vm/blob/master/lib.sh#L46
Should this be a documentation improvement instead for people who set a fixed IP address?
It would be even better if everything worked as intended, which I think it does now. But you are welcome to improve it of course. :+1:
Thanks for the update. I am not a coder nowadays, or at least very rusty, and have not used Git for more than commenting. I will see if I can make some changes but this will take time.
I would like to see if I can pull a DNS server from DHCP rather than using the subnet gateway or at least provide the ability to set it manually.
No worries, let it take the time it needs. :)
Thanks! :+1:
@aaaskew Any update here?
I have been otherwise occupied. I got as far as the following script line which extracts all unique entries from the DHCP leases file. The aim would be that this would be one of the options selectable when picking a DNS server. The list being
Set DNS:
OpenDNS?
cat /var/lib/dhcp/dhclient.leases2 | grep 'option domain-name-servers' | sed -r 's/^.?option domain-name-servers (.);/\1/' | sed 's/\,/\n/g' | sort -u | tr '\n' ' ' | sed 's/ $//'
::1 192.168.0.1
When I eventually get back to it, I would embbed something like this to set the DNS server.
OK, waiting for your PR. :) :+1:
Pull request #1306 created, although it might need some style fixes
Collabora docker image incorrectly requires Internet gateway port forwarding and loopback connection from docker image to external Internet gateway IP address back to the Nextcloud server due to bad default DNS setup.
Can the VM be improved or at least FAQ documentation.
Steps to reproduce
Expected behaviour
It is possible to edit a document
Actual behaviour
Collabora cannot open the document. nextcloud.domain.net inside Collabora docker image resolves to external IP address of Internet gateway. This is not good as it means that all Collabora document opens are going via the Internet gateway when they can be connected directly on the VM.
The problem is with systemd-resolve or docker settings. The VM /etc/hosts file does not appear to be used inside the Collabora docker image and it gets DNS settings from systemd-resolve which has per-interface DNS resolvers. Setting a fixed DNS server against an interface in Netplan only affects that interface and not the docker interface.
I fixed the problem by setting the systemd-resolve default DNS server. See proposed fix below. Maybe there is a better way of solving this?
Please fix or document in FAQ what needs to be done
Server configuration
Nextcloud server version: (see your admin page) 18.0.4
Server OS (Ubuntu server is default) Default - Ubuntu 18.04.4
How did you install the VM? (Scripted install from master OR Released version) Release install
Network
Do you use DHCP? No
Is port 80 and/or 443 open? On Internet gateway, port forwarding done during installation only. Removed afterwards.
Logs / Screenshots
Netplan config file (/etc/netplan/01-netcfg.yaml)
Log file (docker logs xxx)
SystemD resolver before fix (systemd-resolve --status)
Proposed fix (/etc/systemd/resolved.conf)