Compare commits

...

1 Commits

Author SHA1 Message Date
Nathan Sarrazin 7e5e8168ac
Replace `.env.template` by `.env.huggingchat` 2024-02-29 13:32:46 +01:00
5 changed files with 9 additions and 9 deletions

2
.gitignore vendored
View File

@ -11,4 +11,4 @@ SECRET_CONFIG
.idea
!.env.ci
!.env
!.env.template
!.env.huggingchat

View File

@ -593,12 +593,12 @@ You can preview the production build with `npm run preview`.
## Config changes for HuggingChat
The config file for HuggingChat is stored in the `.env.template` file at the root of the repository. It is the single source of truth that is used to generate the actual `.env.local` file using our CI/CD pipeline. See [updateProdEnv](https://github.com/huggingface/chat-ui/blob/cdb33a9583f5339ade724db615347393ef48f5cd/scripts/updateProdEnv.ts) for more details.
The config file for HuggingChat is stored in the `.env.huggingchat` file at the root of the repository. It is the single source of truth that is used to generate the actual `.env.local` file using our CI/CD pipeline. See [updateProdEnv](https://github.com/huggingface/chat-ui/blob/cdb33a9583f5339ade724db615347393ef48f5cd/scripts/updateProdEnv.ts) for more details.
> [!TIP]
> If you want to make changes to model config for HuggingChat, you should do so against `.env.template`.
> If you want to make changes to model config for HuggingChat, you should do so against `.env.huggingchat`.
We currently use the following secrets for deploying HuggingChat in addition to the `.env.template` above:
We currently use the following secrets for deploying HuggingChat in addition to the `.env.huggingchat` above:
- `MONGODB_URL`
- `HF_TOKEN`
@ -615,7 +615,7 @@ You can test the config changes locally by first creating an `.env.SECRET_CONFIG
npm run updateLocalEnv
```
This will replace your `.env.local` file with the one that will be used in prod (simply taking `.env.template + .env.SECRET_CONFIG`).
This will replace your `.env.local` file with the one that will be used in prod (simply taking `.env.huggingchat + .env.SECRET_CONFIG`).
### Populate database

View File

@ -10,8 +10,8 @@ if (!SECRET_CONFIG) {
);
}
// Read the content of the file .env.template
const PUBLIC_CONFIG = fs.readFileSync(".env.template", "utf8");
// Read the content of the file .env.huggingchat
const PUBLIC_CONFIG = fs.readFileSync(".env.huggingchat", "utf8");
// Prepend the content of the env variable SECRET_CONFIG
const full_config = `${PUBLIC_CONFIG}\n${SECRET_CONFIG}`;

View File

@ -9,8 +9,8 @@ const HF_TOKEN = process.env.HF_TOKEN ?? process.env.HF_ACCESS_TOKEN; // token u
const WEBHOOK_URL_REPORT_ASSISTANT = process.env.WEBHOOK_URL_REPORT_ASSISTANT; // slack webhook url used to get "report assistant" events
const ADMIN_API_SECRET = process.env.ADMIN_API_SECRET;
// Read the content of the file .env.template
const PUBLIC_CONFIG = fs.readFileSync(".env.template", "utf8");
// Read the content of the file .env.huggingchat
const PUBLIC_CONFIG = fs.readFileSync(".env.huggingchat", "utf8");
// Prepend the content of the env variable SECRET_CONFIG
const full_config = `${PUBLIC_CONFIG}