pueue icon indicating copy to clipboard operation
pueue copied to clipboard

Token substitution in pueue config files

Open j-xella opened this issue 6 months ago • 3 comments

A detailed description of the feature you would like to see added.

It would be great to have token substitution in pueue config files. For example, in

pueue_directory: /common/path/prefix.%HOST%

the %HOST% token would get replaced with actual host name of the machine, before the pueue_directory value is used.

First tokens that come to my mind: %USER%, %HOST%, %HOME%

Explain your usecase of the requested feature

We have a cluster of Linux boxes to which we log in with the same account, and our home partition is stored on a network share and mounted in the same location on each box. This makes it difficult to use the same pueue configuration on all boxes. The same configuration means the same pueue_directory. If that directory is somewhere under home folder and the home folder is shared, pueued servers on different machines effectively use the same files and conflict with each other.

Another (potential) use of this feature could be where one common config would be created on a machine that would work differently for different users.

Alternatives

It is possible to use separate configs for each box, or have one config with separate profiles. However, there are certain drawbacks:

  • Maintenance overhead - you need to maintain multiple copies of configs, where the only difference is pueue_directory. Maybe that could be reduced if profiles inherit the values in main client/daemon/shared sections - but this is not the case at the moment, correct?
  • Invocation overhead - now each pueue call will have additional params. This can be mitigated with setting environment variables or command aliases, but makes shell configs more complex.

Another approach could be to point pueue_directory to a location that is not shared between multiple machines. But that would mean storing a lot of sensitive data outside the home folder in my case, which I would rather avoid.

Additional context

No response

j-xella avatar Aug 09 '24 14:08 j-xella