Describe the bug
When running as a server with the UI, the interaction between enabling registration and setting the directory address to "localhost" isn't great.
There also appear to be some inconsistencies in the way the inifile is processed... though I've not managed to reproduce them (as it regards legacy updates that rarely happen).
To Reproduce
- Start the server UI with registration disabled
- Enter
example.com in the directory address field on the options tab
- Enable registration - registration will fail
- Change the directory address to
localhost on the options tab - the console (in Linux, at least) will display Now a directory server but the UI still displays Registration failed
Next...
- Disable registration - the UI displays "Unregistered" but there has been no indication that the server is no longer a directory
- Delete the value from the directory address field - the console displays
No longer a directory server
- Enter
localhost again and the console will once more Now a directory server without updating the UI
- Enabling registration has no visible effect
Expected behavior
This is all caused by the evolution of the directory code. Originally, you ran the client or the server. Then Volker added the original central directory with servers manually added to the source code. Then, a bit later, you could enable registration with that single site -- -e originally didn't take a parameter - there was only the one central directory. But very soon the parameter was added, with localhost meaning "I'm a directory" and both clients and servers supported one custom directory in the UI...
When reading the inifile:
- start off with a directory type of none
- there might only be the
enabled flag - indicating whether or not to register with the default directory. If enabled, set directory type to default (may get overwritten later)
- there might be the old
customserver value, add that into the first entry in the custom directory servers list and set the directory type to custom (may get overwritten later)
- there might be the customservers/directoryservers values, add these into the list
- if the directory type exists, use it - overwriting any other value for type
I'm not sure if "none" exists for directory type. If not, it should - it makes more sense than the current "enabled" flag.
In the UI, then:
- Get rid of the Register my server checkbox entirely - and all the way through to the server list
- Select "None" from the directory type selection list if you do not want to register
- If the server is not registered it should not become a directory server if the custom directory address is set to
localhost - that should only set the stored value for the string
- It should be the attempt to register as localhost (i.e. switching to custom directory type with localhost as the directory address) that switches on directory server processing and this should be fed back to the UI
- "Unregistering" from localhost (either changing the directory type or directory address) should then switch off directory server processing
Notes
I've a fix for this in my pending queue locally but it needs more work.
Describe the bug
When running as a server with the UI, the interaction between enabling registration and setting the directory address to "localhost" isn't great.
There also appear to be some inconsistencies in the way the inifile is processed... though I've not managed to reproduce them (as it regards legacy updates that rarely happen).
To Reproduce
example.comin the directory address field on the options tablocalhoston the options tab - the console (in Linux, at least) will displayNow a directory serverbut the UI still displaysRegistration failedNext...
No longer a directory serverlocalhostagain and the console will once moreNow a directory serverwithout updating the UIExpected behavior
This is all caused by the evolution of the directory code. Originally, you ran the client or the server. Then Volker added the original central directory with servers manually added to the source code. Then, a bit later, you could enable registration with that single site --
-eoriginally didn't take a parameter - there was only the one central directory. But very soon the parameter was added, withlocalhostmeaning "I'm a directory" and both clients and servers supported one custom directory in the UI...When reading the
inifile:enabledflag - indicating whether or not to register with the default directory. If enabled, set directory type to default (may get overwritten later)customservervalue, add that into the first entry in the custom directory servers list and set the directory type to custom (may get overwritten later)I'm not sure if "none" exists for directory type. If not, it should - it makes more sense than the current "enabled" flag.
In the UI, then:
localhost- that should only set the stored value for the stringNotes
I've a fix for this in my pending queue locally but it needs more work.