Finish migration to MongoDb and general improvements

This commit is contained in:
2024-12-15 21:22:36 +03:30
parent 29011e34f9
commit dc38ce927f
13 changed files with 370 additions and 416 deletions

View File

@@ -1,23 +1,26 @@
# Disclaimer:
This project involves scraping public data from Mastodon timelines. While this data is generally publicly accessible, it's important to note that scraping and archiving such data may have implications, especially if it involves sensitive information or terms of service violations.
This project involves scraping public data from Mastodon timelines. While this data is generally publicly accessible,
it's important to note that scraping and archiving such data may have implications, especially if it involves sensitive
information or terms of service violations.
I am not responsible for any misuse or unauthorized use of the scraped data. It is the user's responsibility to ensure compliance with all applicable laws, regulations, and terms of service when storing, archiving, or using the data.
I am not responsible for any misuse or unauthorized use of the scraped data. It is the user's responsibility to ensure
compliance with all applicable laws, regulations, and terms of service when storing, archiving, or using the data.
## Required Environment Variables
| Variable Name | Description | Default Value | Format |
|---|---|---|---|
| DB_NAME | Database file name | (Required) | Must not have any extension, plain text |
| BOT_TOKEN | Telegram bot token | (Required) | Standard Telegram bot token format |
| TAG | Mastodon timeline tag | (Required) | Text with no spaces |
| CHANNEL_NUMID | Telegram channel number ID | (Required) | Telegram channel number ID format |
| ADMIN_NUMID | Telegram bot admin/reviewer number ID | (Required) | Telegram user number ID format |
| Variable Name | Description | Default Value | Format |
|---------------|---------------------------------------|---------------|-----------------------------------------|
| DB_NAME | Database file name | (Required) | Must not have any extension, plain text |
| BOT_TOKEN | Telegram bot token | (Required) | Standard Telegram bot token format |
| TAG | Mastodon timeline tag | (Required) | Text with no spaces |
| CHANNEL_NUMID | Telegram channel number ID | (Required) | Telegram channel number ID format |
| ADMIN_NUMID | Telegram bot admin/reviewer number ID | (Required) | Telegram user number ID format |
## Optional Environment Variables
| Variable Name | Description | Default Value | Format |
|---|---|---|---|
| Variable Name | Description | Default Value | Format |
|-----------------|------------------------------|--------------------------------------------|------------|
| CUSTOM_INSTANCE | Custom Mastodon instance URL | [https://haminoa.net](https://haminoa.net) | URL format |
**Note:** All environment variables except `CUSTOM_INSTANCE` are required for the project to function.
@@ -26,14 +29,17 @@ I am not responsible for any misuse or unauthorized use of the scraped data. It
### Published Executable
1. Download the published executable for `Linux-x86` from the [pipeline artifacts](https://gitlab.com/api/v4/projects/61685511/jobs/artifacts/main/raw/publish.tar.gz?job=build)
1. Download the published executable for `Linux-x86` from
the [pipeline artifacts](https://gitlab.com/api/v4/projects/61685511/jobs/artifacts/main/raw/publish.tar.gz?job=build)
2. Navigate to the directory containing the downloaded archive in your terminal and extract the archive.
**Providing Environment Variables:**
**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:
```
DB_NAME=my_data
BOT_TOKEN=your_telegram_bot_token
@@ -41,10 +47,14 @@ TAG=mastodontimelinetag
CHANNEL_NUMID=1234567890
ADMIN_NUMID=9876543210
```
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.**
**Remember to replace `your_telegram_bot_token`, `my_data.json`, `important_data`, `1234567890`, and `9876543210` with
your actual values.**