Removed direct env var from readme
This commit is contained in:
40
README.md
40
README.md
@@ -31,41 +31,7 @@ I am not responsible for any misuse or unauthorized use of the scraped data. It
|
||||
|
||||
**Providing Environment Variables:**
|
||||
|
||||
* **Windows:**
|
||||
- Open a command prompt and navigate to the directory containing the executable.
|
||||
- Set environment variables before running the program using the `set` command. For example:
|
||||
```bash
|
||||
set DB_NAME=my_data.json BOT_TOKEN=your_telegram_bot_token TAG=important_data CHANNEL_NUMID=1234567890 ADMIN_NUMID=9876543210
|
||||
your_project_name.exe
|
||||
```
|
||||
* **macOS/Linux:**
|
||||
- Open a terminal and navigate to the directory containing the executable.
|
||||
- Set environment variables before running the program using the `export` command. For example:
|
||||
```bash
|
||||
export DB_NAME=my_data.json BOT_TOKEN=your_telegram_bot_token TAG=important_data CHANNEL_NUMID=1234567890 ADMIN_NUMID=9876543210
|
||||
./your_project_name
|
||||
```
|
||||
|
||||
**Replace `your_project_name` with the actual name of the downloaded executable file and your own environment variable values.**
|
||||
|
||||
### Using `dotnet run`
|
||||
|
||||
1. Ensure you have .NET 8 installed on your system.
|
||||
2. Open a terminal and navigate to the root directory of your project where the `.csproj` file resides.
|
||||
|
||||
**Providing Environment Variables:**
|
||||
|
||||
There are two ways to provide environment variables when using `dotnet run`:
|
||||
|
||||
**A. Using the `DOTNET_VARIABLES` environment variable:**
|
||||
|
||||
Set the `DOTNET_VARIABLES` environment variable to a semicolon-separated list of key-value pairs for your environment variables. For example:
|
||||
|
||||
```bash
|
||||
export DOTNET_VARIABLES="DB_NAME=my_data.json;BOT_TOKEN=your_telegram_bot_token;TAG=important_data;CHANNEL_NUMID=1234567890;ADMIN_NUMID=9876543210"
|
||||
dotnet run
|
||||
```
|
||||
**B. Using a `.env` file:**
|
||||
**Using a `.env` file:**
|
||||
1. Create a file named .env in the root directory of your project.
|
||||
2. Add each environment variable on a separate line in the format KEY=VALUE. For example:
|
||||
```
|
||||
@@ -75,8 +41,10 @@ TAG=important_data
|
||||
CHANNEL_NUMID=1234567890
|
||||
ADMIN_NUMID=9876543210
|
||||
```
|
||||
3. Run the following command:
|
||||
1. Run the following command:
|
||||
```bash
|
||||
dotnet run
|
||||
or
|
||||
./mstdnCats
|
||||
```
|
||||
**Remember to replace `your_telegram_bot_token`, `my_data.json`, `important_data`, `1234567890`, and `9876543210` with your actual values.**
|
Reference in New Issue
Block a user