syncstorage-rs icon indicating copy to clipboard operation
syncstorage-rs copied to clipboard

Automatically configure tokenserver from config

Open kyz opened this issue 1 year ago • 0 comments

The current state of setting up a syncserver is cumbersome, due to configuration being split between the config file and the database.

SyncServer-1.5 took its services and nodes configuration from the config file. Modern syncserver requires you to define it in a database, but you can only do that once the tables exist, for which you first need to run syncserver to create them. Setup looks like this:

  1. Create a database user account and databases
  2. Create or edit config.toml
  3. Run syncserver --config config.toml
  4. Let syncserver create database tables
  5. Stop syncserver
  6. Either use tools provided, or use raw SQL statements, to insert entries into the tokenserver's database (services and nodes tables)
  7. Start syncserver again

This makes it cumbersome to run syncserver "out of the box", for example as a Docker image. You either need a workflow like the above, or you need to manually create the schema that syncserver is going to use, so you can put configuration into the database before syncserver's first run.

I'd like to ask for tokenserver config (services/nodes) to be definable in config.toml file instead. Or at least an optional setting that starts tokenserver running with a single node on a defined public URL, e.g. tokenserver.single_node_url = "https://home-server.example.com/firefox-sync" ... so that no out-of-band SQL work is needed and syncserver can be ready to use on its first invocation.

┆Issue is synchronized with this Jira Task

kyz avatar Jan 14 '25 17:01 kyz