Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added possibility to set config file path in environment file #9048

Merged
merged 3 commits into from
Oct 3, 2023

Conversation

nwalser
Copy link
Contributor

@nwalser nwalser commented Sep 30, 2023

Hi Eugeny

This PR adds the ability to set the config file via an environment variable. The variable can be set in a .env file.
For now you would need to edit the .env file manually to move the config file to another location.

Is there a particular problem with the current implementation? Or is it possible to continue on this path and add the needed UI changes?

Resolves: #4327 #6842

@Eugeny
Copy link
Owner

Eugeny commented Oct 2, 2023

Hi, thanks for the contribution! This looks good to me so far, though I would rename the var to TABBY_CONFIG_DIRECTORY since your name is generic enough that it could have been set on a user's system by something else.

@Eugeny Eugeny merged commit 612d6ef into Eugeny:master Oct 3, 2023
7 of 10 checks passed
@Eugeny
Copy link
Owner

Eugeny commented Oct 3, 2023

Thank you! @all-contributors add @nwalser for code

@allcontributors
Copy link
Contributor

@Eugeny

I've put up a pull request to add @nwalser! 🎉

@3lorsin
Copy link

3lorsin commented Jan 1, 2024

Hi @Eugeny and @nwalser

I am having a difficult time finding where the .env file is, or where I need to add it to my filesystem. I have both a Windows 10 machine (installed via the setup exe) and a Debian Linux machine (installed via packagecloud).

Maybe this info could be added to the Repo's Wiki Config-File page?

Thank You!

@nwalser
Copy link
Contributor Author

nwalser commented Jan 1, 2024

Hi @3lorsin
This would be quite helpful indeed. I will have a look at it in a few days as I am currently busy.
I'll keep you posted. Cheers, Nathaniel

@nwalser
Copy link
Contributor Author

nwalser commented Jan 4, 2024

@3lorsin I will answer your question here as I am not able to edit the wiki pages currently.

Tabby will read out the value of the TABBY_CONFIG_DIRECTORY environment variable, in which you can define a directory path to which the config file will be stored/loaded. You have two options to set the desired path:

  • You can set this environment variable on the operating system level according to your specific operating system.
  • You can place a text file named .env inside the installation directory of tabby (e. g. on windows "C:\Users{username}\AppData\Local\Programs\Tabby") with the variables as key value pairs. (TABBY_CONFIG_DIRECTORY="{PATH_TO_DIRECTORY}". Tabby will read these key value pairs and inject them into the application as if they where environment variables set by the operating system.

Note

If you have a current configuration for tabby already, you will have to move this file manually to the new place. If there is no config file in the new place a default one gets created for you.

Let me know if this worked for you, or if I may clarify something for you. :)

@3lorsin
Copy link

3lorsin commented Jan 9, 2024

@nwalser This is working perfectly for me. Thank You for the information and adding this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Custom configuration file path
3 participants