Skip to content

Register My Server behaviour #2095

@pljones

Description

@pljones

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

  1. Start the server UI with registration disabled
  2. Enter example.com in the directory address field on the options tab
  3. Enable registration - registration will fail
  4. 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...

  1. Disable registration - the UI displays "Unregistered" but there has been no indication that the server is no longer a directory
  2. Delete the value from the directory address field - the console displays No longer a directory server
  3. Enter localhost again and the console will once more Now a directory server without updating the UI
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions