Rui Ferrao opened 1 decade ago
|
|
Wojciech, there was a lot of work in the configuration area in the Tigase server. I am not sure if this ticket is still relevant or if perhaps there is a better way already implement for this? |
|
While there are significant changes to the configuration (DSL) this particular functionality is not implemented. I think that %andrzej.wojcik would be better person to comment on how this fits into DSL. |
|
I was thinking about providing a way to pass variables to DSL as it is a very good idea in case of cluster node related settings. I was also thinking about possibility to pass some variable defined in DSL so it could be reused - but later on after some adjustments in DSL this is not needed any more. |
|
The ticket is 4 years old, so I do not think it is a high priority right now. However, I think it could be very useful as you say in clustered setup but in particular for VMs on cloud like AWS and similar. Lots of information about VM instance is passed through environmental variables so this would be a good way to automatically setup Tigase configuration and adjust it to the environment. Andrzej, it was you who worked on DSL for Tigase? I am assigning this ticket to you then. |
|
I added support for using environment variables and system properties in configuration file. To set property
To use system property you need to replace To fix this particular issue and use variables in strings, I introduced computable variables. So now to set
While already working on this I decided to allow simple computations in config file (ie. to make values set in milliseconds more readable). Now to set property
instead of:
I updated DSL description in documentation. %wojtek Please review this changes in description of DSL and let me know, if this format and description is OK or if I should improve some parts. |
|
I've tested on the latest version from @origin/master@:
And it seems not working:
Possible improvements
PS. during the upgrade repository URL is converted to:
|
|
Wojciech Kapcia wrote:
If you are looking at dumps of configuration file then there may be an issue (have you check it in any other way?), because when I was implementing support for variables I implemented serialization of variables, so dump stores same value as an input file (generally I did that as I think that this way I suppose I should update code, so that dumps will have variables resolved to an exact values, right?
hm, this is fact is different properties and environment variables as stated in documentation of JDK (I used methods of
I think it is only a warning in log files but will solve it as I will work on documentation improvements. Please review my comments and let me know what you think. |
|
Andrzej Wójcik wrote:
I tested with VHosts by trying to connect however it looks like the issue may be related to how it's handled:
However other configuration (admins,
For the dump file I think we should use effective values. Also, except for the WebInstaller, I think we shouldn't touch the config file (and if we want updateable configuration I think we should lean towards db-stored config [there was a storage for that already]) which could be shared among nodes and updated by any of them… actually I think it would be quite good, same level of usefulness in cluster as with automatic cluster-nodes discovery... at the lowest we could pass only a main repository url and then rest of the config would be read from that repo... but I think I got carried away ;) ).
+1
I know where it came from, but not every user of the Tigase has to be a Java developer and familiar with that hence including at least reference will be helpful. |
|
Wojciech Kapcia wrote:
I'm not sure why VHosts are not working. I think this property should work in a same way as other properties. Maybe it is somehow related to
Yes, and it is correct as you cannot set a multiple items in a list at once - you need to provide a whole list. This works, so I think it is ok. (it works in same way as Groovy would work). You should be able to use it in following ways:
where in first two cases you passes single JID and in last one comma separated list of JIDs.
Yes, it would be nice, but I wanted to have some kind of semi-automatic reconfiguration, so it would be possible to apply some changes to server configuration at runtime and later decide that it works fine and we want to keep them - and for that we would need possibility to save config without exact values.
Done.
Added links to documentation related to system properties and environment variables in JDK documentation. |
|
Andrzej Wójcik wrote:
I've run a quick tests and provided you with the steps to reproduce - I haven't went through the code trying to fix the issue.
Well, Tigase is intended for all folks and expecting Groovy familiarity to setup a configuration file seems odd.
IMHO should be explicitly stated in the documentation.
Thanks
Thanks. |
|
I've added information about usage of variables/properties with comma separated values to documentation to section about DSL. |
|
Looks good. |
|
Wojciech Kapcia wrote:
While working on #5591 I've run into the problem with this hence re-openning the issue as the bit above slipped. Basically using this functionality in system properties (with dashes) doesn't work. After running a couple of tests:
Looks like we should either:
What do you think? I would say that going forward we should eliminate as much as possible using system properties? |
|
I've added support for expanding variables to System properties. I agree with you - we should stop using System properties. Everything with |
|
Andrzej Wójcik wrote:
Thank you, works OK now. |
Type |
New Feature
|
Priority |
Minor
|
Assignee | |
RedmineID |
835
|
Version |
tigase-server-8.0.0
|
Estimation |
8h
|
Spent time |
70h 30m
|
It would be really nice to be able to expand environment variables in init.properties.
I am already taking care of this without any problem in my individual components, but would be really nice to do the same with something like this :
basic-conf/logging/java.util.logging.FileHandler.pattern=${HOME_DIR}/log
I can help to provide a patch if you would like.
Rui