Commit Graph

22 Commits

Author SHA1 Message Date
dependabot[bot]
32485a0340 chore(deps): bump next from 14.2.33 to 14.2.35 in /dashboard
Bumps [next](https://github.com/vercel/next.js) from 14.2.33 to 14.2.35.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.2.33...v14.2.35)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 14.2.35
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-13 14:36:21 +00:00
Praveen Thirumurugan
cb817b4e6a Merge pull request #4 from praveentcom/claude/fix-bugs-01UKJXpHnQvA2U5FCUDptwMT 2025-11-23 13:10:43 +05:30
Claude
8b90fa2b9e Fix critical bugs for security and data accuracy
This commit addresses three important bugs:

1. SQL Injection Prevention (proxy.ts:70-75):
   - Added whitelist validation for DATABASE_TABLE environment variable
   - Table names are now validated against ALLOWED_TABLES before use
   - Prevents potential SQL injection through malicious table names

2. SQL Interval Parameter Bug (dashboard/app/api/metrics/route.ts):
   - Fixed incorrect INTERVAL syntax in PostgreSQL queries
   - Changed from INTERVAL '$1 hours' to INTERVAL '1 hour' * $1
   - Properly uses parameterized queries with interval multiplication
   - Affects all 4 queries: summary, recent, model breakdown, and trends

3. Incorrect Property Reference (proxy.ts:206):
   - Fixed usage.cached_tokens to usage.prompt_tokens_details?.cached_tokens
   - Aligns with OpenAI API response structure for cached tokens
   - Ensures accurate logging of cached token usage
2025-11-23 06:18:11 +00:00
Praveen Thirumurugan
aac2c3f224 Merge pull request #3 from praveentcom/claude/fix-small-bug-01AGtjhF3TtnBUMpwakQTrZM 2025-11-23 09:56:23 +05:30
Claude
2770745618 Fix multiple small bugs for security and robustness
- Add input validation for hours and limit query parameters to prevent NaN and DoS attacks
- Replace || with ?? for proper null coalescing in metrics summary
- Fix IPv6 normalization to prevent empty string when IP is malformed
- Fix stream parsing to skip empty JSON strings and avoid parse errors
- Remove redundant .toString() calls on authorization header
2025-11-23 04:24:46 +00:00
Praveen Thirumurugan
94155233e5 Merge pull request #1 from praveentcom/claude/add-nextjs-metrics-dashboard-01JNVCLSV6ryKGhHfnkzZSRh 2025-11-19 07:36:47 +05:30
Praveen Thirumurugan
ab15d9e001 Merge pull request #2 from praveentcom/copilot/sub-pr-1
Fix SQL injection vulnerabilities in metrics API route
2025-11-19 07:35:53 +05:30
copilot-swe-agent[bot]
6bd62cae27 Fix SQL injection vulnerabilities with parameterized queries and table name whitelist
Co-authored-by: praveentcom <82172535+praveentcom@users.noreply.github.com>
2025-11-19 01:56:44 +00:00
copilot-swe-agent[bot]
9f6906b423 Initial plan 2025-11-19 01:51:55 +00:00
Praveen Thirumurugan
90c7325213 Update route.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-19 07:21:21 +05:30
Claude
b88fc8ead7 feat: add Next.js metrics dashboard for real-time visualization
Add a lightweight Next.js dashboard to visualize OpenProxy metrics in real-time. The dashboard provides comprehensive insights into LLM API usage, costs, and performance.

Features:
- Real-time metrics overview (requests, tokens, costs, response times)
- Model breakdown with usage statistics
- Hourly trends visualization with charts
- Recent requests table with detailed information
- Auto-refresh every 30 seconds
- Configurable time ranges (1h, 6h, 24h, 7d)

Technical details:
- Built with Next.js 14 and React 18
- Uses Recharts for data visualization
- Connects directly to PostgreSQL database
- Runs on port 3008 by default
- TypeScript for type safety
- Minimal dependencies for lightweight deployment

The dashboard complements the proxy server by providing a user-friendly interface for monitoring and analyzing LLM API usage patterns.
2025-11-19 00:04:28 +00:00
Praveen Thirumurugan
dc0c4b8600 Update README.md 2025-10-18 03:29:12 +05:30
Praveen Thirumurugan
30e461f3c4 chore: rename project from llm-proxy-server to openproxy in documentation and configuration files 2025-10-18 03:25:16 +05:30
Praveen Thirumurugan
f592b4b029 feat: add IP normalization for IPv6-mapped addresses in proxy request logging 2025-10-18 02:33:42 +05:30
Praveen Thirumurugan
0a69232257 feat: add UUID generation for request tracking and update PostgreSQL schema 2025-10-18 02:22:52 +05:30
Praveen Thirumurugan
ee0e5033ec refactor: remove redundant provider information from log data in proxy request 2025-10-18 02:10:03 +05:30
Praveen Thirumurugan
4c6610eecc feat: add UPSTREAM_URL validation and error handling in proxy request 2025-10-18 01:57:44 +05:30
Praveen Thirumurugan
1b3ce75155 fix: normalize model names to lowercase in cost calculation and proxy request handling 2025-10-18 01:40:56 +05:30
Praveen Thirumurugan
ac59778c46 docs: clarify cost configuration details in README 2025-10-18 01:32:00 +05:30
Praveen Thirumurugan
07fad4ec4d feat: update package.json with project metadata and keywords 2025-10-18 01:30:54 +05:30
Praveen Thirumurugan
55e834161a feat: enhance documentation and add project description 2025-10-18 01:25:39 +05:30
Praveen Thirumurugan
6839ae6f6a feat: init llm-proxy 2025-10-18 01:22:02 +05:30