@stephdl we already fixed it in other modules, take a look at get-config: make sure to return a valid hostname by gsanchietti · Pull Request #6 · NethServer/ns8-prometheus · GitHub
Yes I read about it but why not use socket.getfqdn() it tries first to retrieve the fqdn if not possible it uses socket.gethostname()
The key is that some people could write only an hostname dns name in /etc/hostname instead of a fqdn
The two are valable because hostnamectl writes a fqdn and it is full of sense. How find the server only with a hostname
I found some differences about hostname
in /etc/hostname
and hostname
from hostnamectl
in Linux man pages online
====> It is recommended that this name contains only a single
label, i.e. without any dots.
hostnamectl.
hostnamectl(1) - Linux manual page.
The static and transient hostnames must each be either a
single DNS label (a string composed of 7-bit ASCII lower-case
characters and no spaces or dots, limited to the format
allowed for DNS domain name labels), or a sequence of such
labels separated by single dots that forms a valid DNS FQDN.
The hostname must be at most 64 characters, which is a Linux
limitation
====> a single DNS label or a sequence of such labels separated by single dots
My conclusion:
Do not use /etc/hostname
nor hostnamectl
to know the hostname.
My suggestions:
-
To find the FQDN, you should use the same way as at the end of the installation of NS8 when it displays the URL to go to the adminstration of the cluster i.e. https://FQDN/cluster-admin.
-
To find the
hostname
, you should use the FQDN and isolate the label on the left of the first dot. That way, you can be sure to have the real hostname. -
Also, all the pointers used by all instances (modules/applications) should use the FQDN. i.e. http[s]://FQDN/sftpgo…, and http[s]://FQDN/phpmyadmin…, etc… and should not use http[s]://hostname/…
Wishful suggestions
-
On the installation page of NS8, there should be an example of /etc/hosts.
-
On the installation page of NS8, there should be a chapter about how to get a Let’s Encrypt for servers running on the LOCAL LAN. (A must for anyone testing on a virtual machine on a LOCAL LAN.)
At least, you should tell the path to the different certificates so we can put one there that we obtain by a different way than from the UI. -
Remove the left over of domains like example.com, etc…
I do not want to be right or wrong, I just need to have a NS8 running as it should be: perfectly.
As for stephdl, on holyday, he should not connect to the Internet but rest and be fresh when he comes back to work as we need him that way to continue his fantastic work on NS8.
Michel-André