sjstein / R8DIUM

A discord bot to manage individual run8 users
GNU General Public License v3.0
2 stars 0 forks source link

Is there a need to track HostSecurity file changes #82

Open sjstein opened 8 months ago

sjstein commented 8 months ago

Currently, the only time the bot merges data from the HostSecurity file back to the user database is when a user is added, deleted, banned, or un-banned (these are the functions that affect the HostSecurity file contents). When any of those commands are given to the bot, it first merges the HostSecurity data back into the database and then writes a new HostSecurity file.

@Garrisonsan asked about the frequency of this operation which brought up this issue.

With this current design, there will be long bouts of no updates to the user database even if/when the hostSecurity file is updated.

sjstein commented 8 months ago

Possible changes:

  1. Implement a routine (cron) merge from the HostSecurity back to the user database.
  2. Routinely compare the existing HostSecurity file to one store in memory. If there is a change, do the merge.
  3. Reinstate the original way I had envisioned the merge happening - e.g. have a bot command to do the merge

Note: If there is going to be an automated implementation, need to verify that writing to the user db with the merge doesn't screw something up if a database access is happening due to another bot command

sjstein commented 8 months ago

Until we get a decent schema implemented in the HostSecurity xml file, I do not see this as an issue. Currently, the Run8 server nukes the UniqueLogin -> Name field, so we have to track our users via the password anyway.

In other words, we don't really care what is in the HostSecurity file - so the need to keep our db up-to-date is moot.

Marking on hold pending server changes.