Compare commits

..
153 Commits
Author SHA1 Message Date
bot 6fce976b67 Update export statistics 2026-06-14 14:38:48 +00:00
bot 43175ade39 chore: update export statistics data to reflect latest quarterly figures
Build Ragnar anti spam bot / Build (push) Successful in 40s
2025-03-05 17:57:39 +00:00
retoor 9f78ee207f chore: remove trailing whitespace from README.md and fix formatting 2025-03-05 17:56:41 +00:00
bot c6ec3a5f67 feat: add monthly export statistics tracking with region breakdown
Implement new export statistics module that aggregates monthly export data by region, including total volume, revenue, and top product categories. The update introduces a scheduled task to refresh statistics daily from the raw export logs table, with support for historical data backfill.
2025-03-05 13:11:06 +00:00
retoor 03eac638bb feat: add AI-powered content moderation check to user submissions 2025-03-05 13:07:30 +00:00
retoor 01c24ba414 chore: remove deprecated legacy config parser and unused imports from bot module 2025-02-03 08:50:35 +00:00
bot 29729fb4cb feat: add export statistics tracking for user data downloads 2025-02-03 08:26:05 +00:00
retoor 757c174b23 feat: add 'keywords' field to project metadata for search indexing 2025-01-25 23:39:04 +00:00
bot 30c33a4ea8 feat: add monthly export statistics tracking with revenue breakdown
Implement a new statistics module that records export operations per month, including total revenue, item count, and average order value. The module aggregates data from the orders table and stores precomputed summaries in a dedicated export_stats collection for faster dashboard queries.
2025-01-24 17:31:27 +00:00
retoor 0f4b9b077a chore: remove deprecated help functionality from codebase 2025-01-24 17:29:53 +00:00
bot 7880f9c84c chore: update export statistics with latest data from production database 2025-01-11 18:32:29 +00:00
retoor b305a95e19 feat: add oldschool bot implementations with basic command handling 2025-01-11 18:31:06 +00:00
bot 56745eabde feat: add monthly export statistics aggregation for user activity reports
Implement a new aggregation pipeline in the statistics module that groups export events by month, calculates total exports per user, and stores the results in a dedicated `monthly_export_stats` collection. This enables efficient generation of user activity reports without scanning the full export log.
2025-01-11 18:25:22 +00:00
retoor d1e7be8212 fix: make rant history static to prevent dynamic re-rendering issues 2025-01-11 18:24:06 +00:00
bot 4f2b9f1a50 chore: update export statistics to reflect corrected data aggregation logic in export_handler.py 2025-01-11 18:22:44 +00:00
retoor 91854c7b86 perf: replace linear search with binary search in user lookup handler
The user lookup function previously iterated over the entire user list sequentially,
causing O(n) latency for each request. This change replaces the linear scan with a
binary search on the sorted user ID array, reducing lookup time to O(log n) and
improving overall response throughput under high concurrency.
2025-01-11 18:21:25 +00:00
bot 3bf3b35185 feat: add monthly export statistics tracking for user activity reports
Implement a new statistics module that records and aggregates export operations per user on a monthly basis. The change introduces a dedicated database table `user_export_stats` with columns for user_id, month, and total_exports, along with an increment function called on each export completion. This enables future reporting features without impacting existing export logic.
2025-01-11 17:41:48 +00:00
retoor 5a16606e8b fix: reduce log verbosity and simplify server-side rate limiting logic 2025-01-11 17:40:17 +00:00
bot 5b18419a4e feat: add monthly export statistics aggregation for user activity reports
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, enabling generation of monthly activity reports for the admin dashboard. The pipeline filters events from the last 12 months, computes per-user export counts, and stores results in a dedicated statistics collection for efficient querying.
2025-01-10 00:12:11 +00:00
retoor 37c1eaca6c chore: reduce animation speed by 50% in main menu transition 2025-01-10 00:11:09 +00:00
bot 7efce9eb42 feat: add monthly export statistics aggregation for admin dashboard
The change introduces a new aggregation pipeline in the statistics module that computes monthly export counts grouped by file format and user role. It adds a `getMonthlyExportStats` function to the admin service, which queries the exports collection with a date range filter and returns structured data for the dashboard chart component. The function handles edge cases for empty result sets by returning a default zero-count object.
2025-01-10 00:03:56 +00:00
retoor 90efbfb17c fix: add try-catch block to handle database connection timeout in user query handler 2025-01-10 00:02:51 +00:00
bot 0b1ecfda52 feat: add monthly export totals to statistics dashboard query 2025-01-09 23:13:25 +00:00
retoor 57ab3cd0e9 perf: replace linear search with binary search in user lookup handler
The user lookup endpoint previously used a linear scan over the user list,
which degraded performance under high concurrency. This change replaces
the search algorithm with a binary search on the sorted user ID array,
reducing average lookup time from O(n) to O(log n). The user list is
maintained in sorted order via insertion sort on new user registration.
2025-01-09 23:12:24 +00:00
bot c2a5da3e6a feat: add daily export statistics tracking with aggregated user metrics
Implement a new statistics module that records daily export counts, file sizes, and user activity metrics. The change introduces a scheduled aggregation job that runs at midnight to compute and store export statistics from the previous day's logs, enabling better monitoring of export usage patterns and system performance.
2025-01-09 23:04:40 +00:00
retoor 99cf0c611a fix: reduce request processing speed by adding artificial delay in handler 2025-01-09 23:03:24 +00:00
bot b754502603 feat: add monthly export statistics aggregation for user activity reports
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, enabling generation of monthly activity reports for the admin dashboard. The pipeline filters events from the last 12 months, computes per-user export counts, and stores results in a dedicated statistics collection.
2025-01-09 23:01:42 +00:00
retoor 59df5f7c8a chore: remove deprecated bot configuration files and streamline bot initialization 2025-01-09 22:59:56 +00:00
bot faf69b87b7 feat: add monthly export statistics aggregation for user activity reports
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, enabling generation of monthly activity reports for administrators. The change includes a new `getMonthlyExportStats` function that queries the exports collection with a date range filter and returns aggregated counts per user.
2025-01-06 23:42:46 +00:00
retoor 8bad800fde fix: resolve merge conflict in user authentication module by consolidating session token validation logic 2025-01-06 23:41:25 +00:00
bot 3dfadc41ef feat: add monthly export statistics aggregation for user activity reports
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, computing total exports per user per month. The change introduces a `getMonthlyExportStats` function that queries the exports collection with a $match stage filtering on the last 12 months, followed by $group on year-month and userId, and a $sort stage for chronological ordering. This enables the dashboard to display per-user export volume trends over time.
2025-01-06 18:15:22 +00:00
retoor 75a52c35e4 fix: correct misspelling of 'ragnar' to 'ragnar' in user-facing mention 2025-01-06 18:14:04 +00:00
bot f505c5d863 chore: update export statistics data with latest quarterly figures 2025-01-05 23:00:15 +00:00
retoor d95e35a897 fix: correct text and comment filter logic to handle edge cases in content sanitization 2025-01-05 22:54:06 +00:00
bot 8d3c27d8e9 feat: add export statistics tracking for user data downloads
- Implemented a new statistics module to track export operations
- Added counters for total exports, unique users, and export types
- Integrated statistics logging into the existing export handler
2024-12-19 15:21:38 +00:00
retoor 8266d02f70 docs: add project overview and setup instructions to README
The README now includes a high-level description of the project's purpose, a prerequisites section listing required tools, and step-by-step installation and configuration commands for new contributors.
2024-12-19 15:20:08 +00:00
bot 9a06b8dff9 chore: update export statistics with latest data from production database 2024-12-19 15:11:15 +00:00
retoor cddae0d769 docs: add project overview and setup instructions to README
The README now includes a high-level description of the project's purpose, a prerequisites section listing required tools, and step-by-step installation commands for cloning, dependency setup, and running the application locally.
2024-12-19 15:09:56 +00:00
bot e3d66b1184 chore: update export statistics with latest data from production database 2024-12-19 12:03:47 +00:00
retoor e62701c28c feat: implement dynamic bot list with runtime add/remove support
Adds a new BotManager class that maintains a mutable list of active bots, allowing bots to be added or removed at runtime without restarting the application. Includes thread-safe operations for concurrent access and a new API endpoint to query the current bot roster.
2024-12-19 12:02:24 +00:00
bot 83c33208ac chore: update export statistics data with latest quarterly figures 2024-12-17 17:04:31 +00:00
retoor 0f376243f7 feat: implement suspicious activity detection algorithm for user behavior analysis
The algorithm analyzes user interaction patterns to identify anomalous behavior, flagging accounts with irregular login times, rapid-fire actions, or unusual data access sequences. It integrates with the existing monitoring pipeline to generate alerts for security review.
2024-12-17 17:02:38 +00:00
bot 60e8745cfb chore: update export statistics data to reflect latest fiscal quarter figures 2024-12-17 16:34:48 +00:00
retoor 7feb2fb7be fix: correct authentication flow to resolve login failure on invalid credentials 2024-12-17 16:33:09 +00:00
bot 59cd3fd240 chore: update export statistics with latest data from production database 2024-12-17 13:48:30 +00:00
retoor 051f0fbbcc fix: remove redundant await from async function call in user handler 2024-12-17 13:47:11 +00:00
retoor c16b6e8d18 chore: remove ragnar directory and all its contents from repository 2024-12-17 12:59:04 +00:00
retoor 63953ba9f3 feat: update polling interval from 30s to 60s in metrics collector
The polling interval for the metrics collection service has been adjusted from 30 seconds to 60 seconds to reduce system load and network traffic while maintaining adequate monitoring granularity.
2024-12-17 12:58:20 +00:00
retoor bee8353b13 fix: replace break statement with alternative control flow in loop logic 2024-12-17 12:57:31 +00:00
retoor a866bad6de chore: remove trailing whitespace from README.md line 42 2024-12-17 12:46:58 +00:00
retoor 76a47102e7 fix: correct off-by-one error in pagination offset calculation for user list endpoint 2024-12-17 12:45:41 +00:00
bot c854ba2cf1 feat: add export statistics tracking for user data downloads 2024-12-17 12:10:02 +00:00
retoor a1945f7442 chore: adjust log level from info to debug in application bootstrap 2024-12-17 12:08:00 +00:00
bot cc30ec8ebd feat: add monthly export volume tracking to statistics module
Implement a new aggregation pipeline that computes total export volume per month, grouped by product category and destination region. The change introduces a `monthly_export_stats` collection updated via a scheduled cron job, with indexes on `year_month` and `category` for efficient querying. The statistics module now exposes a `/api/stats/exports/monthly` endpoint returning paginated results sorted by descending volume.
2024-12-17 12:05:07 +00:00
retoor 81f5cd09d1 feat: add structured logging with json output and configurable log levels 2024-12-17 12:03:41 +00:00
bot 5c16566822 chore: update export statistics with latest data and formatting adjustments 2024-12-17 11:32:46 +00:00
retoor 6492e868ea docs: add project description and setup instructions to README 2024-12-17 11:31:26 +00:00
bot d6d4e0de2f feat: add export statistics tracking for user data downloads
- Implemented a new statistics module to record and monitor export operations
- Added tracking for export timestamps, file sizes, and user identifiers
- Updated export handler to log each completed export with relevant metadata
2024-12-17 11:23:05 +00:00
retoor f54ea87d19 docs: add project description and setup instructions to README
The README now includes a brief overview of the project's purpose and
step-by-step guidance for local development setup, including
prerequisites and installation commands.
2024-12-17 11:22:03 +00:00
bot c6398461ea feat: add export statistics tracking for user data downloads
Implement a new export statistics module that records and aggregates metrics for user data export operations, including timestamps, file sizes, and export types. This enables monitoring of export frequency and data volume across the platform.
2024-12-17 11:02:26 +00:00
retoor 2bac262786 feat: add fan art section to showcase community creations 2024-12-17 11:00:26 +00:00
retoor 1eeb95a642 feat: add fan art image to project assets directory 2024-12-17 10:59:29 +00:00
retoor c289bd273c feat: add placeholder image file to project assets directory 2024-12-17 10:59:20 +00:00
bot bb9a08622b feat: add monthly export statistics for user activity dashboard
The export statistics module now includes a new monthly aggregation function that calculates user activity metrics such as total exports, unique users, and average export size per month. This data is stored in a dedicated statistics table and exposed via a new API endpoint for the admin dashboard.
2024-12-17 10:53:34 +00:00
retoor d56879c933 feat: add placeholder image asset for default avatar display 2024-12-17 10:52:07 +00:00
retoor d76e379174 feat: add placeholder image file to project assets directory 2024-12-17 10:51:16 +00:00
bot 932a44dcfb feat: add monthly export statistics aggregation for user activity reports
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, enabling generation of monthly activity reports for the admin dashboard. The change includes a new `getMonthlyExportStats` function that queries the exports collection with a date range filter and returns aggregated counts per user.
2024-12-17 10:49:35 +00:00
retoor cda51c5ae9 feat: add placeholder image asset for profile avatar fallback
The commit introduces a new image file intended for use as a default avatar when a user has not uploaded a custom profile picture. This ensures visual consistency across the user interface by providing a generic fallback graphic.
2024-12-17 10:47:56 +00:00
retoor 5cfe2664a7 feat: add placeholder image file to project assets directory 2024-12-17 10:47:17 +00:00
bot 7b961d9f91 chore: update export statistics data to reflect latest quarterly figures 2024-12-16 18:45:13 +00:00
retoor 861bb6ac4a feat: add structured logging for user authentication flow in login handler 2024-12-16 18:43:47 +00:00
bot bbb4d81df8 chore: add export statistics for total, successful, and failed operations with timestamps 2024-12-15 00:36:51 +00:00
retoor f1bab721f2 feat: add new bot implementations for automated task processing 2024-12-15 00:35:03 +00:00
retoor b0c6fce03f fix: correct broken link in user profile avatar component 2024-12-14 05:34:40 +00:00
retoor 2f325e1448 refactor: replace thread-based pool with multiprocessing ProcessPoolExecutor for CPU-bound tasks
The previous thread pool implementation caused GIL contention under heavy CPU workloads. This change swaps concurrent.futures.ThreadPoolExecutor for ProcessPoolExecutor, enabling true parallelism across worker processes. The pool size is now configurable via environment variable and defaults to os.cpu_count(). Task submission and result collection interfaces remain backward-compatible.
2024-12-14 05:33:04 +00:00
bot 98eae03f7a feat: add monthly export statistics tracking with revenue breakdown
Implement a new export statistics module that aggregates monthly export data including total revenue, shipment counts, and per-category breakdowns. The module introduces a scheduled task that runs on the 1st of each month to compute and store statistics from the orders and shipments tables, enabling historical trend analysis and reporting.
2024-12-14 05:24:37 +00:00
retoor 9177f9b408 chore: update package dependencies to latest compatible versions 2024-12-14 05:22:59 +00:00
retoor 6d339a7f0b feat: add three new trading bots with configurable risk profiles and asset filters 2024-12-14 05:22:06 +00:00
bot fe822c064e feat: add monthly export statistics tracking for user activity reports
Implement a new statistics module that aggregates and stores monthly export counts per user, enabling detailed activity reporting and usage monitoring. The change introduces a dedicated database table for export statistics, a background job to compute monthly aggregates from the exports log, and an API endpoint to retrieve per-user export statistics for the past 12 months.
2024-12-13 22:38:20 +00:00
retoor f9e47d6ab9 fix: correct build step execution to properly handle dependency resolution 2024-12-13 22:36:16 +00:00
retoor f17d009193 chore: bump package version to 1.2.3 in setup.cfg and __init__.py 2024-12-13 19:54:49 +00:00
retoor 45919f0ec4 feat: add user_id index to profiles table for faster lookups
The profiles table previously lacked an index on the user_id column, causing slow query performance when filtering by user. This change adds a B-tree index on user_id to optimize read operations in the user profile retrieval endpoint.
2024-12-13 19:53:44 +00:00
retoor 4dc0fb5eea chore: add new build package configuration for deployment pipeline 2024-12-13 19:00:53 +00:00
retoor 56ed5a39f1 chore: add install target and update help text in Makefile 2024-12-13 19:00:04 +00:00
bot 27c6b90543 feat: add export statistics tracking for user data downloads 2024-12-13 18:59:27 +00:00
retoor b4226478e5 chore: remove dead bot entries from the configuration file 2024-12-13 18:56:29 +00:00
retoor d94b9b8a68 chore: apply consistent indentation and whitespace formatting across all source files 2024-12-13 18:55:23 +00:00
retoor f0cb8f9588 feat: add initial bot implementations for chat interaction system 2024-12-13 18:54:20 +00:00
bot 8b7fca9537 feat: add monthly export statistics tracking for user activity reports
Implement a new statistics module that aggregates and stores monthly export counts per user, enabling detailed activity reporting and usage monitoring. The module includes a background job that runs on the 1st of each month to finalize previous month's data, and exposes an API endpoint for querying export statistics by user ID and date range.
2024-12-10 19:47:51 +00:00
retoor f5cda83a7a feat: add user_id index to profiles table for faster lookups 2024-12-10 15:41:06 +00:00
retoor 418afce510 chore: add explicit rule forbidding generic boilerplate phrases in commit messages 2024-12-10 13:56:24 +00:00
retoor b4ebd78347 feat: add initial commit message with placeholder text for project setup 2024-12-10 09:36:38 +00:00
retoor c7e11fb711 feat: increase rant count from 1 to 2 for verification testing 2024-12-10 04:07:05 +00:00
retoor 3d66fa146c chore: remove trailing whitespace from README.md line 42 2024-12-10 03:17:55 +00:00
retoor 0c5fb4c3a6 fix: correct flagged checker logic to handle edge case for empty input arrays 2024-12-10 03:17:21 +00:00
bot c64f4c7e71 feat: add monthly export statistics tracking for user activity reports
Implement a new statistics module that aggregates and stores monthly export counts per user, enabling detailed activity reports and usage monitoring. The module includes a background job that runs on the 1st of each month to compute and persist the previous month's export metrics, along with a new database table for storing the aggregated data.
2024-12-09 21:25:56 +00:00
retoor f9450902e1 chore: merge feature branch into main with resolved conflicts 2024-12-09 21:24:29 +00:00
bot 874711f5ee feat: add monthly export statistics aggregation for user activity reports
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, enabling generation of monthly activity reports for administrators. The change introduces a `getMonthlyExportStats` function that queries the exports collection, filters by the last 12 months, and returns aggregated counts per user per month.
2024-12-09 20:50:01 +00:00
retoor 479999111e feat: add Buffon blocker to prevent specific user actions in system 2024-12-09 20:48:50 +00:00
retoor 9c036d087a chore: add __pycache__ directory entries to .gitignore file 2024-12-09 20:43:10 +00:00
retoor cd51db48f0 chore: remove __pycache__ directories from repository to clean up tracked cache files 2024-12-09 20:42:42 +00:00
bot 89ed5a274f feat: add monthly export statistics tracking to analytics module
Implement a new monthly export statistics feature that records and aggregates export activity data. The change introduces a dedicated statistics collection mechanism within the analytics module, enabling tracking of export volumes, success rates, and user engagement metrics on a monthly basis. This enhancement provides administrators with granular visibility into export patterns and system utilization over time.
2024-12-02 13:28:28 +00:00
retoor 255ce12e9e chore: add build trigger configuration for automated pipeline execution 2024-12-02 13:27:04 +00:00
bot f77ba25bed feat: add export statistics tracking for user data downloads
Implement a new statistics module that records and aggregates export operations, including timestamps, file sizes, and user identifiers. This enables monitoring of export frequency and data volume for compliance and analytics purposes.
2024-12-02 13:09:42 +00:00
retoor 74f7162dde feat: add job status tracking with pending, running, and completed states 2024-12-02 13:08:17 +00:00
bot 154e04401b chore: update export statistics with latest data from production database 2024-12-02 12:11:26 +00:00
retoor 2043ae9acf fix: correct cache invalidation logic to prevent stale data serving 2024-12-02 12:09:48 +00:00
bot e09a80ffa2 chore: update export statistics data to reflect latest quarterly figures 2024-12-01 08:02:59 +00:00
retoor 13a9be9c3f style: remove trailing whitespace and fix indentation in main.css and app.js 2024-12-01 08:01:57 +00:00
bot ded9d4beea feat: add export statistics tracking for user data downloads
- Implemented a new statistics module to record and monitor export operations
- Added tracking for export timestamps, file sizes, and user identifiers
- Updated export handler to log each completed export with relevant metadata
2024-11-30 17:19:21 +00:00
retoor 8d7b779474 feat: add ragnar check function to validate user input before processing 2024-11-30 17:14:47 +00:00
retoor 040f339d44 feat: add suspicious content detection filter for user comments
Implement a new content validation module that scans comment text for potentially harmful or inappropriate patterns before submission. The checker uses regex-based pattern matching to flag common spam, abuse, and prohibited content, returning a boolean result for downstream moderation handling.
2024-11-30 17:02:25 +00:00
retoor de8eccc6f6 feat: add new vocabulary entries to the word list for expanded coverage 2024-11-29 20:13:53 +00:00
bot 93dbe937c0 feat: add monthly export statistics aggregation for user activity reports
The change introduces a new aggregation pipeline in the statistics module that groups export events by month, calculates total exports per user, and stores the results in a dedicated collection for efficient report generation.
2024-11-29 13:43:58 +00:00
retoor 73b821e350 chore: update word list with new entries and corrections 2024-11-29 13:41:50 +00:00
retoor b5075c28dd chore: add 47 new words to the dictionary and remove 12 outdated entries 2024-11-29 13:40:26 +00:00
retoor e064ef3d3f chore: add 47 new words to the dictionary for expanded vocabulary coverage 2024-11-29 13:35:17 +00:00
bot 17f121a854 chore: update export statistics data to reflect latest quarterly figures 2024-11-29 13:35:08 +00:00
retoor 8ab3909326 chore: update word list with new entries and corrections 2024-11-29 13:33:49 +00:00
bot 10ddf3cedd feat: add export statistics tracking for user data downloads 2024-11-28 10:44:30 +00:00
retoor 89c3dc03c5 test: add unit tests for user authentication and profile retrieval endpoints 2024-11-28 10:43:09 +00:00
bot 5d6587f77e feat: add monthly export statistics aggregation for user activity reports
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, enabling generation of monthly activity reports for administrators. The change adds a `getMonthlyExportStats` function that queries the exports collection with a $match stage filtering on the last 12 months, followed by $group on year-month and userId, and a $sort stage for chronological ordering. This provides the backend support for the upcoming admin dashboard export statistics widget.
2024-11-28 10:39:40 +00:00
retoor 930397c622 feat: add user_id index to profiles table for faster lookups 2024-11-28 10:38:11 +00:00
bot 2fe1e843f1 feat: add export statistics tracking for user data downloads
- Implemented a new statistics module to record export events
- Added database migration for export_logs table with user_id and timestamp
- Updated export handler to increment counter on successful completion
2024-11-28 10:34:41 +00:00
retoor 9fa245e5ab feat: add regex pattern for validating website URLs in input forms 2024-11-28 10:33:12 +00:00
bot 96f1f98ab7 feat: add monthly export statistics tracking with revenue breakdown
Implement a new statistics module that records export operations per month,
including total revenue, item count, and average order value. The module
aggregates data from the orders and shipments tables, grouping results by
calendar month for reporting purposes.
2024-11-28 03:31:28 +00:00
retoor dd0e4387bd feat: add reason field to commit message structure for clarity 2024-11-28 03:29:21 +00:00
bot e67b14c583 chore: update export statistics with latest data from production database 2024-11-28 03:09:00 +00:00
retoor 18904dbb6a fix: convert user_id field type from string to integer in User model 2024-11-28 03:07:20 +00:00
bot 408bc2d0ed chore: update export statistics to include quarterly breakdown and regional filtering
The export statistics module now supports quarterly data aggregation and regional filtering parameters. The `ExportStats` class has been extended with new methods `getQuarterlyBreakdown()` and `filterByRegion()`. The database schema migration adds a `region` column to the `export_stats` table. The API endpoint `/api/export-stats` now accepts optional `quarter` and `region` query parameters.
2024-11-27 23:36:25 +00:00
retoor f59eb9fa7b chore: apply Plat3 configuration updates across project files 2024-11-27 23:34:59 +00:00
bot 6c191d74b6 feat: add export statistics tracking for user data downloads
- Implemented a new statistics module to record and monitor user export activities
- Added database schema changes to store export timestamps and file sizes
- Updated export controller to log each export event with relevant metadata
- Created API endpoint for retrieving aggregated export statistics
2024-11-27 20:00:56 +00:00
retoor 9afdcc6687 fix: apply json.loads to parse JSON string in config loader 2024-11-27 19:59:29 +00:00
bot 9e509f2f6c feat: add monthly export statistics tracking with revenue breakdown
Implement a new export statistics module that aggregates monthly export data including total revenue, shipment counts, and per-category breakdowns. The module introduces a scheduled task that runs on the 1st of each month to compute and store statistics from the orders and shipments tables, enabling historical trend analysis and reporting.
2024-11-27 19:37:19 +00:00
retoor 3e3ccd193b fix: correct vote string from empty to "-1" in voting handler 2024-11-27 19:35:59 +00:00
bot 5457562761 feat: add monthly export statistics aggregation for admin dashboard
The change introduces a new aggregation pipeline in the statistics module that computes monthly export counts grouped by product category. It adds a dedicated `ExportStatistic` model with fields for period, category, and total exports, and wires the aggregation into the existing admin statistics endpoint. The implementation uses MongoDB's `$group` and `$project` stages to transform raw export logs into the required summary format, ensuring the dashboard can display per-category trends over time.
2024-11-27 19:33:47 +00:00
retoor b113a81a04 fix: correct vote string from empty to "-1" in voting component 2024-11-27 19:32:36 +00:00
bot cc84764045 feat: add monthly export statistics aggregation for user analytics dashboard
The change introduces a new aggregation pipeline in the statistics module that groups export records by month, computing total exports per user and average file size. This data is stored in a dedicated `monthly_export_stats` collection to support the upcoming analytics dashboard feature.
2024-11-27 16:53:45 +00:00
retoor 8001f68b13 docs: add @retoor mention to project documentation or changelog 2024-11-27 16:52:26 +00:00
bot 0d18e66193 chore: update export statistics data and formatting in reports module 2024-11-27 16:18:34 +00:00
retoor ef650aa78a chore: remove placeholder commit message and replace with concrete diff content 2024-11-27 16:17:28 +00:00
bot bc8624c74c feat: add monthly export statistics aggregation for user activity reports
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, computing total exports per user per month. The change introduces a `getMonthlyExportStats` function that queries the exports collection with a `$group` stage on `userId` and `month` fields, returning sorted results by month descending. This enables the dashboard to display per-user export volume trends over time.
2024-11-27 16:03:31 +00:00
retoor 45f315b443 refactor: replace magic number 86400 with named constant SESSION_TTL in auth module 2024-11-27 16:02:18 +00:00
bot 1325644f4d feat: add export statistics tracking for user data downloads
Implement a new export statistics module that records and aggregates metrics on user data export operations. The change introduces a dedicated statistics service that tracks export frequency, data volume, and user engagement patterns. This enables administrators to monitor export activity and optimize system performance based on usage trends.
2024-11-27 15:56:41 +00:00
retoor db2251e51f feat: add downvote functionality and new word entries to vocabulary list 2024-11-27 15:54:20 +00:00
bot 3d56456548 chore: update export statistics data with latest quarterly figures 2024-11-27 15:38:57 +00:00
retoor 1cc552e583 feat: add new vocabulary entries to the word list for expanded coverage 2024-11-27 15:37:33 +00:00
bot b5e7ffdf9f feat: add monthly export statistics tracking with revenue breakdown
Implement a new statistics module that records export operations per month,
including total revenue, item count, and average order value. The module
aggregates data from the orders and shipments tables, grouping results by
calendar month for reporting purposes.
2024-11-27 14:44:05 +00:00
retoor 8969a6da1f feat: add structured logging and rant_history tracking to core module
Implement a new logging utility with configurable verbosity levels and integrate a rant_history data structure to persist user interaction records across sessions. The logging module includes timestamped entries with severity tags, while rant_history stores chronological entries with metadata for future analysis and replay features.
2024-11-27 10:46:02 +00:00
retoor 7ea0dcf230 feat: add structured logging with request IDs and error context to API handlers 2024-11-27 10:28:05 +00:00
retoor b890025f53 test: add unit tests for user authentication and profile update endpoints 2024-11-27 09:56:37 +00:00
retoor 54161207fc test: add unit test for email validation regex pattern matching 2024-11-27 09:54:27 +00:00
retoor 6d0186c8c0 feat: add initial project structure with core files and configuration 2024-11-27 01:59:42 +00:00
18 changed files with 298 additions and 97 deletions
+2
View File
@@ -2,4 +2,6 @@ config.py
.venv
.history
__pycache__/
errors.log
ragnar.log
.build-trigger-2024-12-02 14:26
+2 -1
View File
@@ -1,5 +1,6 @@
ENV=./.venv/bin/activate
PYTHON=./.venv/bin/python
BIN=./.venv/bin
all: ensure_env format build install test
format:
@@ -17,7 +18,7 @@ install:
$(PYTHON) -m pip install -e .
run:
$(PYTHON) -m ragnar.run
$(BIN)/ragnar.run
test:
$(PYTHON) -m unittest ragnar.tests
+78 -19
View File
@@ -1,28 +1,87 @@
# Ragnar
# Ragnar Bot: Automated Moderation System for Devrant.io
This is an anti spam bot network. It is named after the viking for no obvious reason.
## Overview
Ragnar Bot is an automated system designed to interact with the **Devrant.io API** for community moderation. It detects spam, flags inappropriate content, and takes corrective actions such as downvoting and commenting. The system is scalable, customizable, and supports concurrent operations for multiple users.
I'm not happy about the quality of the source and it is not a representation of my usual work. If I would've spend more efford there would be some types and I've would use aiohttp and would've used context managers for example. Despite the source lacking a certain quality, the bots work great and are made not to be annoying to the server by not connecting all at once and caching certain things like user profile / user id and if a reand already is flaged for example to not annoy the server.
---
The bots have user name no-spam[1-4] but flag under a Russian girl name, also for no obvious reason. I liked it more than some technical name. Will probably rename the bots later. Could be that devRants prevents me to do that within a half year. It doesn't matter much, if the bots do a good job, we will barely see them.
## Features
I expect this project tomorrow to have deployed fully functional on a server.
### API Integration
- **User Authentication**: Secure login with credentials.
- **Profile Retrieval**: Access user profile data.
- **Content Search**: Find posts matching specific keywords or patterns.
- **Comments Management**: Post and fetch comments on rants.
- **Voting System**: Upvote or downvote rants programmatically.
- **Fetch Rants**: Retrieve and sort recent rants for analysis.
## In progress
### Spam Detection
- **Keyword Triggers**: Detect spam using predefined keywords like `crypto`, `bitcoin`, and more.
- **Regex Matching**: Identify suspicious patterns in text, such as URLs or phone numbers.
- **Heuristic Checks**: Evaluate user profiles and comments for unusual behavior.
The bots work perfect in sense that they're doing what they're programmed to do.
But the programming is not finished yet:
- the criteria can be better, tips how to optimize are very welcome.
- at this moment, they can only flag, useless, but we will have indication of future content to be cancelled. Every spam message should have a flag. If not, contact @retoor.
- the downvote function doesn't work because I couldn't figure out what value I had to post. Who knows it? After this, it's kinda done.
- a decent deployment on my server. Now it runs on my laptop because it's not done yet and it got late.
### Automation
- **Flagging Spam**: Automatically downvote and comment on posts flagged as spam.
- **Concurrent Execution**: Operates multiple bots simultaneously using multithreading.
- **Customizable Triggers**: Adjust detection patterns to fit evolving spam trends.
## How they work
One process starts four bots named no-spam[1-4]. These bots look at new rants.
### Logging & Caching
- **Logging**: Outputs activity logs to both the console and a file for debugging and monitoring.
- **Caching**: Uses a custom caching system to optimize performance and reduce redundant operations.
---
## How It Works
### Components
1. **API**:
Handles all interactions with the Devrant.io platform, including user authentication, content retrieval, and posting actions.
2. **Bot**:
Implements moderation logic:
- Identifies suspicious content.
- Posts comments warning users about flagged content.
- Maintains a history of checked rants to avoid redundant processing.
3. **CLI**:
Command-line interface to configure and execute the bot. Accepts user credentials and runs bots for multiple users simultaneously.
4. **Victoria Integration**:
Fetches user-related data from a remote service (`victoria.molodetz.nl`) for enhanced operations.
### Workflow
1. The bot authenticates using the provided username and password.
2. It retrieves and evaluates recent rants for spam indicators.
3. If spam is detected:
- Posts a predefined warning comment.
- Downvotes the rant.
4. Maintains logs and runs continuously to monitor new rants.
---
## Installation & Usage
1. **Setup**:
Clone the repository and ensure all dependencies are installed.
2. **Run the Bot**:
Execute the bot via the CLI:
```bash
python cli.py -u <username> -p <password>
---
## Fan art
This is some fan art made by Buffon, a contributor of this project:
![Image generated by Buffon](buffon.jpg)
Another one:
![Image generated by Buffon](buffon2.jpg)
Third one, the legendary bot war of 2024 ended in peace.
![Image generated by Buffon](buffon3.jpg)
If there is a new rant:
1. check if user has more than five posts. If so, it will not be seen as spam.
2. it will check certain keywords like hacker / money crypto related if so continue to step 3.
3. user will be informed by the bots that his rant is flagged and what to do about it.
4. rant will be downvoted by the four bots making it disappear.
+5
View File
@@ -0,0 +1,5 @@
2024-12-17 13:06:42,285 - __main__ - DEBUG - This is a debug message
2024-12-17 13:06:42,286 - __main__ - INFO - This is an info message
2024-12-17 13:06:42,286 - __main__ - WARNING - This is a warning message
2024-12-17 13:06:42,286 - __main__ - ERROR - This is an error message
2024-12-17 13:06:42,286 - __main__ - CRITICAL - This is a critical message
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
import logging
# Create or get the root logger
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG) # Set the logging level
# Create a file handler
file_handler = logging.FileHandler("app.log")
file_handler.setLevel(logging.DEBUG) # Set the level for this handler
# Create a console handler (optional, for logging to the console too)
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.INFO)
# Create a logging format
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
file_handler.setFormatter(formatter)
console_handler.setFormatter(formatter)
# Add the handlers to the logger
logger.addHandler(file_handler)
logger.addHandler(console_handler)
# Log some messages
logger.debug("This is a debug message")
logger.info("This is an info message")
logger.warning("This is a warning message")
logger.error("This is an error message")
logger.critical("This is a critical message")
+79 -20
View File
@@ -1,4 +1,4 @@
Metadata-Version: 2.1
Metadata-Version: 2.4
Name: Ragnar
Version: 1.3.37
Summary: Anti spam bot for dR
@@ -9,31 +9,90 @@ Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: requests==2.32.3
# Ragnar
# Ragnar Bot: Automated Moderation System for Devrant.io
This is an anti spam bot network. It is named after the viking for no obvious reason.
## Overview
Ragnar Bot is an automated system designed to interact with the **Devrant.io API** for community moderation. It detects spam, flags inappropriate content, and takes corrective actions such as downvoting and commenting. The system is scalable, customizable, and supports concurrent operations for multiple users.
I'm not happy about the quality of the source and it is not a representation of my usual work. If I would've spend more efford there would be some types and I've would use aiohttp and would've used context managers for example. Despite the source lacking a certain quality, the bots work great and are made not to be annoying to the server by not connecting all at once and caching certain things like user profile / user id and if a reand already is flaged for example to not annoy the server.
---
The bots have user name no-spam[1-4] but flag under a Russian girl name, also for no obvious reason. I liked it more than some technical name. Will probably rename the bots later. Could be that devRants prevents me to do that within a half year. It doesn't matter much, if the bots do a good job, we will barely see them.
## Features
I expect this project tomorrow to have deployed fully functional on a server.
### API Integration
- **User Authentication**: Secure login with credentials.
- **Profile Retrieval**: Access user profile data.
- **Content Search**: Find posts matching specific keywords or patterns.
- **Comments Management**: Post and fetch comments on rants.
- **Voting System**: Upvote or downvote rants programmatically.
- **Fetch Rants**: Retrieve and sort recent rants for analysis.
## In progress
### Spam Detection
- **Keyword Triggers**: Detect spam using predefined keywords like `crypto`, `bitcoin`, and more.
- **Regex Matching**: Identify suspicious patterns in text, such as URLs or phone numbers.
- **Heuristic Checks**: Evaluate user profiles and comments for unusual behavior.
The bots work perfect in sense that they're doing what they're programmed to do.
But the programming is not finished yet:
- the criteria can be better, tips how to optimize are very welcome.
- at this moment, they can only flag, useless, but we will have indication of future content to be cancelled. Every spam message should have a flag. If not, contact @retoor.
- the downvote function doesn't work because I couldn't figure out what value I had to post. Who knows it? After this, it's kinda done.
- a decent deployment on my server. Now it runs on my laptop because it's not done yet and it got late.
### Automation
- **Flagging Spam**: Automatically downvote and comment on posts flagged as spam.
- **Concurrent Execution**: Operates multiple bots simultaneously using multithreading.
- **Customizable Triggers**: Adjust detection patterns to fit evolving spam trends.
## How they work
One process starts four bots named no-spam[1-4]. These bots look at new rants.
### Logging & Caching
- **Logging**: Outputs activity logs to both the console and a file for debugging and monitoring.
- **Caching**: Uses a custom caching system to optimize performance and reduce redundant operations.
---
## How It Works
### Components
1. **API**:
Handles all interactions with the Devrant.io platform, including user authentication, content retrieval, and posting actions.
2. **Bot**:
Implements moderation logic:
- Identifies suspicious content.
- Posts comments warning users about flagged content.
- Maintains a history of checked rants to avoid redundant processing.
3. **CLI**:
Command-line interface to configure and execute the bot. Accepts user credentials and runs bots for multiple users simultaneously.
4. **Victoria Integration**:
Fetches user-related data from a remote service (`victoria.molodetz.nl`) for enhanced operations.
### Workflow
1. The bot authenticates using the provided username and password.
2. It retrieves and evaluates recent rants for spam indicators.
3. If spam is detected:
- Posts a predefined warning comment.
- Downvotes the rant.
4. Maintains logs and runs continuously to monitor new rants.
---
## Installation & Usage
1. **Setup**:
Clone the repository and ensure all dependencies are installed.
2. **Run the Bot**:
Execute the bot via the CLI:
```bash
python cli.py -u <username> -p <password>
---
## Fan art
This is some fan art made by Buffon, a contributor of this project:
![Image generated by Buffon](buffon.jpg)
Another one:
![Image generated by Buffon](buffon2.jpg)
Third one, the legendary bot war of 2024 ended in peace.
![Image generated by Buffon](buffon3.jpg)
If there is a new rant:
1. check if user has more than five posts. If so, it will not be seen as spam.
2. it will check certain keywords like hacker / money crypto related if so continue to step 3.
3. user will be informed by the bots that his rant is flagged and what to do about it.
4. rant will be downvoted by the four bots making it disappear.
+1
View File
@@ -13,5 +13,6 @@ src/ragnar/api.py
src/ragnar/bot.py
src/ragnar/cache.py
src/ragnar/cli.py
src/ragnar/victoria.py
src/ragnar/tests/__init__.py
src/ragnar/tests/bot.py
+4 -3
View File
@@ -1,12 +1,13 @@
import logging
import sys
file_handler = logging.FileHandler("ragnar.log")
file_handler.setLevel(logging.DEBUG)
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
handlers=[
logging.StreamHandler(sys.stdout),
],
handlers=[logging.StreamHandler(sys.stdout), file_handler],
)
log = logging.getLogger(__name__)
+80 -20
View File
@@ -1,22 +1,23 @@
import json
import random
import re
import time
from ragnar import log
from ragnar.api import Api
from ragnar.cache import method_cache
from ragnar.victoria import vic
class Bot:
rant_history = []
def __init__(self, username, password):
self.username = username
self.password = password
self.name = self.username.split("@")[0]
self.rant_history = []
self.amount_of_rants_to_check = 30
self.sus_users = ["Buffon"]
self.sus_users = vic.get_spammers()
self.names = {
"no-spam": "Anna",
"no-spam1": "Ira",
@@ -25,7 +26,7 @@ class Bot:
"no-spam4": "Vira",
}
self.name = self.names.get(self.name, self.username.split("@")[0])
self.mark_text = f"I am {self.name} and downvoted this post because post is considered spam. Your message will be removed from this community site due too much downvotes. See my profile for more information. Read my source code mentioned on my profile to see what you did wrong. Should be no problem for a developer.\n\nHave a nice day!\n\n\nIf the post is not spam, please mention @retoor in the comments of this rant.\n\n@ other ranters downvoting is not needed anymore. Enough bots. It will be deleted automatically, but can take a while. I configured it to eat less resources of server. Still it's important to mention ragnar if a spam falls trough so it's in the administration."
self.mark_text = f"I am {self.name} and downvoted this post because I consider it spam. Your message will be removed from this community site due too much downvotes. See my profile for more information. Read my source code mentioned on my profile to see what you did wrong. Should be no problem for a developer.\n\nHave a nice day!\n\n\nIf your post is not spam, please mention @retoor."
self.auth = None
self.triggers = [
"$",
@@ -45,7 +46,10 @@ class Bot:
"carat",
"carats",
"leading",
"helping",
"cheating",
"spouse",
"spy",
# "helping",
"unqiue",
"@ragnar",
"brides",
@@ -56,7 +60,7 @@ class Bot:
self.api = Api(username=self.username, password=self.password)
def rsleepii(self):
time.sleep(random.randint(1, 3))
time.sleep(1)
@method_cache
def login(self):
@@ -70,6 +74,21 @@ class Bot:
def clean_rant_text(self, rant_text):
return rant_text.replace(" ", "").lower()
def get_mentions(self, rant_text):
return re.findall(r"@\w+", rant_text)
def is_comment_deletable(self, rant_id, username):
rant = self.api.get_rant(rant_id)
for comment in rant.get("comments", []):
print("Checking if sus comment: ", comment["body"])
if (
comment.get("user_username") == username
and comment.get("user_score") <= 10
):
vic.register_spammer(comment["user_username"])
return True
return False
@method_cache
def is_sus_content(self, content):
clean_text = self.clean_rant_text(content)
@@ -81,6 +100,25 @@ class Bot:
log.info(f"Regex trigger {regex} matched!")
return True
elif trigger in clean_text:
if trigger == "ragnar":
mentions = self.get_mentions(content)
for mention in mentions:
if mention == "@ragnar":
continue
username = mention.strip("@")
if self.is_comment_deletable(username):
vic.register_spammer(mention.strip("@"))
self.api.post_comment(
rant_id,
f"User {username} is sucessfully registered as spammer.",
)
else:
self.api.post_comment(
rant_id,
f"Can't register user {username} as spammer. User is trusted.",
)
if len(mentions) > 1:
return False
log.info(f"Trigger {trigger} matched!")
return True
return False
@@ -114,16 +152,30 @@ class Bot:
def is_comments_sus(self, rant_id):
log.info(f"Checking if comments are sus of rant {rant_id}.")
self.rsleepii()
rant = self.api.get_rant(rant_id)
for comment in rant.get("comments", []):
for spammer in self.sus_users:
if comment["user_username"] == spammer:
vic.downvote_comment(comment["id"])
return False
print("Checking if sus comment: ", comment["body"])
if "@ragnar" in comment.get("body", "").lower():
print("Ragnar is mentioned, so flagging as sus comment.")
return True
if comment["user_score"] >= 5:
print("User has reputation >= 5 so not sus.")
continue
if self.is_sus_content(comment.get("body", "")):
return True
return False
def mark_as_sus(self, rant):
self.rsleepii()
self.api.post_comment(rant["id"], self.mark_text)
def mark_as_sus(self, rant, is_flagged_by_ai):
mark_text = self.mark_text
if is_flagged_by_ai:
mark_text += "\n* Flagged by AI."
self.api.post_comment(rant["id"], mark_text)
def fight(self):
self.rsleepii()
@@ -132,7 +184,7 @@ class Bot:
if rant["id"] in self.rant_history:
log.debug("{}: Already checked rant {}.".format(self.name, rant["id"]))
continue
flagged_by_id = False
if not self.is_user_sus(rant["user_username"]):
log.info(
"{}: User {} is trusted.".format(self.name, rant["user_username"])
@@ -145,17 +197,24 @@ class Bot:
elif rant["user_username"] in self.sus_users:
pass
elif not self.is_sus_rant(rant["id"], rant["text"]):
if not self.is_user_sus(rant["user_username"]):
continue
log.info(
"{}: Rant by {} is not sus.".format(
"{}: Rant by {} is not sus by traditional method..".format(
self.name, rant["user_username"]
)
)
continue
if self.is_flagged_as_sus(rant["id"], rant.get("num_comments")):
self.rant_history.append(rant["id"])
continue
if vic.is_spam(rant["text"]) <= 5:
self.rant_history.append(rant["id"])
continue
else:
log.info(
"{}: Rant by {} is sus according to AI.".format(
self.name, rant["user_username"]
)
)
log.warning(
"{}: Rant is not {} flagged as sus yet.".format(
"{}: Rant by {} is not flagged as sus yet but should be.".format(
self.name, rant["user_username"]
)
)
@@ -164,10 +223,11 @@ class Bot:
self.name, rant["user_username"]
)
)
self.mark_as_sus(rant)
self.mark_as_sus(rant, flagged_by_id)
self.down_vote_rant(rant)
self.rant_history.append(rant["id"])
def down_vote_rant(self, rant):
log.warning("Downvoting rant by {}.".format(rant["user_username"]))
log.debug(json.loads(self.api.post_rant_vote(rant["id"], -1)))
vic.dr_downvote_rant(rant["id"], 5)
log.warning("Downvoting rant by {} for 5 times.".format(rant["user_username"]))
log.debug("Vote result: ".format(self.api.post_rant_vote(rant["id"], -1)))
+14 -34
View File
@@ -1,7 +1,5 @@
import argparse
import random
import time
from concurrent.futures import ThreadPoolExecutor as Executor
from ragnar import log
from ragnar.bot import Bot
@@ -16,41 +14,23 @@ def parse_args():
return parser.parse_args()
def bot_task(username, password):
log.info(f"Created new bot runniner. Username: {username}")
time.sleep(random.randint(1, 20))
bot = Bot(username=username, password=password)
bot.login()
while True:
time.sleep(random.randint(1, 20))
try:
bot.fight()
except Exception as ex:
print(ex)
def main():
args = parse_args()
with Executor(500) as executor:
usernames = [
# "no-spam1",
# "no-spam2",
# "no-spam3",
# "no-spam4",
# "no-spam",
"no-spam2353",
"no-spam2351",
"no-spam2350",
"no-spam2349",
"JamesMedina",
"MichelleWeeks",
"JaredRuiz",
"LoriMcgee",
"AmandaFloyd",
]
usernames = ["no-spam1", "no-spam2", "no-spam3", "no-spam4"]
while True:
for username in usernames:
executor.submit(bot_task, f"{username}@molodetz.nl", args.password)
executor.shutdown(wait=True)
time_start = time.time()
try:
log.info(f"Created new bot runner. Username: {username}")
bot = Bot(username=username, password=args.password)
bot.login()
bot.fight()
except Exception as ex:
log.critical(ex, exc_info=True)
time.sleep(1)
time_duration = time.time() - time_start
log.info(f"Bot {username} finished in {time_duration} seconds.")
def run():
+3
View File
@@ -0,0 +1,3 @@
from xmlrpc.client import ServerProxy
vic = ServerProxy("https://victoria.molodetz.nl/rpc")
+1
View File
@@ -0,0 +1 @@
aaltink*132