Projects tigase _server server-core Issues #1575
Stop overriding config.tdsl in-place (#1575)
Wojciech Kapcia (Tigase) opened 2 months ago

Currently, when tigase-server detect any problem with config.tdsl file it overwrites it with "correct" one and make the backup of the previous one. This is less than ideal for a couple of reasons:

  1. configuration file should not be automatically edited by the application -- bad practice
  2. it tends to replace configuration file with some parts commented out with the "correct" one while making backup, which makes it very inconvenient to restore previous version (with comments and more elaborate configuration).

The backup mechanism tends to generate a lot of exactly the same files still:

Screenshot 2026-04-10 at 16.17.00.png

~/dev/tigase/devops/tigase-deployment/config/tigase-server/etc on  master [!?]
🕙 [16:17:29] ❯ diff config.tdsl.old config.tdsl.old.1

~/dev/tigase/devops/tigase-deployment/config/tigase-server/etc on  master [!?]
🕙 [16:17:42] ❯ diff config.tdsl.old config.tdsl.old.2

~/dev/tigase/devops/tigase-deployment/config/tigase-server/etc on  master [!?]
🕙 [16:17:45] ❯ diff config.tdsl.old config.tdsl.old.3

~/dev/tigase/devops/tigase-deployment/config/tigase-server/etc on  master [!?]
🕙 [16:17:46] ❯ diff config.tdsl.old config.tdsl.old.4

~/dev/tigase/devops/tigase-deployment/config/tigase-server/etc on  master [!?]

Proposal:

  1. flip the mechnism: leave the config.tdsl file as is (it's loaded either way) and instead output correct version to: config.tdsl-new file
  2. ideally check if there is no file like that and if it's not the same to avoid pointless multiplication
  • Andrzej Wójcik (Tigase) commented 1 week ago

    I've decided to create config.tdsl.new that will keep the updated version of the config file. If during startup update will be need, but Tigase XMPP Server will find existing config.tdsl.new with exactly the same configuration as to be stored - it will not override the file. If update content will be different that current content of config.tdsl.new, the file content will be replaced.

  • Andrzej Wójcik (Tigase) changed state to 'In QA' 1 week ago
    Previous Value Current Value
    Open
    In QA
  • Wojciech Kapcia (Tigase) commented 1 week ago

    Works perfectly!

  • Wojciech Kapcia (Tigase) changed state to 'Closed' 1 week ago
    Previous Value Current Value
    In QA
    Closed
issue 1 of 1
Type
Improvement
Priority
Normal
Assignee
Version
8.5.0
Sprints
n/a
Customer
n/a
Iterations
Issue Votes (0)
Watchers (3)
Reference
tigase/_server/server-core#1575
Please wait...
Page is in error, reload to recover