Using environment variables in plugins' generated configs

Discussion in 'Spigot Plugin Help' started by Miniroid, Jul 12, 2019.

  1. Hello, I am wondering if it is possible to use environment variables in plugins' generated configurations.
    Basically, I am working on my server on a repository, which means that sensitive data like database configuration will be exposed on the repository. I am wondering if there are any ways for me to store data like database's username and password, and be able to call them from the config files itself.

    An example of this would be dynmap plugin, it has configurations that allows me to link up my database, however I would have to enter in my database information in the configuration.txt which is not something I would like to do.

    Thanks!
     
  2. md_5

    Administrator Developer

    Not really, but also where would the environment variables ultimately be stored anyway?
     
  3. Don't keep the files with the sensitive data in the repository and just keep a template in there?
     
  4. I can store it in the server folder and put it under gitignore

    Issue with that is I would want to easily do a pull request on my server after I commit the server configurations in to my repository from my local machine. And I am trying to manage my server configuration with git.