there is a bug in the cached Tabs in the GUI of Nethserver. It is not critical, it is just “not nice”.
Do the following:
Go to: DNS => Server alias
Create a Server alias
Go to: DNS => Hosts
Create a Host with the Same name as the Server alias
Go to: DNS => Server alias
Delete the Server alias
Result:
Error 404
Nethgui: 404 - not found
1352715526
I think the reason is just because the Serveralias-Tabcontent is cached and didn’t get a trigger to refresh, after the alias is now not an alias anymore but a DNS Host-Entry.
you can use the same domain name (for example domain.com) between the ‘hosts’ tab and the ‘server alias’ tab of the ‘dns’ panel
Of course after that I can see the two identical domain name in the two panels and when I try to edit the ‘server alias’ name, I got a 404 error.
method :
set a domain name in the server alias
set an identical domain name in the hosts tab (we must have a validation to avoid this)
try to edit the domain name in the ‘server alias’ tab and you got a 404 error.
In fact we overwrite the database key( with a different type : remote or self), and it is not good, you should not use it if the key is used elsewhere. A validation is needed here
I saw this bug because I’m looking a way to set as reserved a domain name, in fact I want to use a domain name as a virtualhost of dokuwiki (by example) and I don’t want to use it for an ibay later. But with the approach of Neth, I worry it is not possible to block the usage of a key name. The method I known is to set the type with ‘reserved’ or whatever you need
one way to verify in the host tab if the key is not used in the server alias tab, but the same solution doesn’t work in the server alias tab, maybe because the class php is not exactly the same (class ServerAlias extends \Nethgui\Controller\TableController instead of class Modify extends \Nethgui\Controller\Table\Modify)
does it is needed to code the sever alias tab like the host tab ?
Maybe the Message should be a little bit more detailed like “Hostname already in use for another Host or Server Alias”. Otherwise you may look in the Hosts-Page and think “hmmm… no it’s not”
it is valid, but in the meanwhile I want to use the host database for saving a domain name as the document root of a module. So it will be useless, you will have an error because the key is used by me.
@Hunv can you test the inverse, set a domain name in host tab, and verify that in the server alias tab you cannot use it.