isididiidid commited on
Commit
d558d52
·
verified ·
1 Parent(s): 3250bdb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +35 -0
README.md CHANGED
@@ -10,3 +10,38 @@ pinned: false
10
  ---
11
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
13
+
14
+ ## Cursor AI Proxy with Checksum
15
+
16
+ This is a modified version of the Cursor AI proxy that includes a checksum mechanism for enhanced security.
17
+
18
+ **Features:**
19
+
20
+ * Proxies requests from Cursor to OpenAI API.
21
+ * Fetches the latest checksum from `https://cc.wisdgod.com/get-checksum` every 3 hours.
22
+ * Verifies the checksum of incoming requests on the `/hf/v1/chat/completions` endpoint.
23
+
24
+ **How to Use:**
25
+
26
+ 1. **Set the `CURSOR_CHECKSUM` Environment Variable:**
27
+ * In your Hugging Face Space's Settings, go to "Repository secrets" and add a new secret:
28
+ * **Name:** `CURSOR_CHECKSUM`
29
+ * **Value:** You can set an initial checksum value here, or leave it blank to initially rely on the value fetched from `https://cc.wisdgod.com/get-checksum`.
30
+ 2. **Deploy to Hugging Face Spaces:**
31
+ * Commit and push the `hf.js` and `Dockerfile` to your Hugging Face Space's Git repository.
32
+ * Hugging Face will automatically build and deploy your application.
33
+
34
+ **Checksum Verification:**
35
+
36
+ * The application fetches the latest checksum from `https://cc.wisdgod.com/get-checksum` on startup and every 3 hours.
37
+ * Incoming requests to `/hf/v1/chat/completions` are checked against the current `checksumValue`.
38
+ * If the checksum doesn't match, a `400 Invalid checksum` error is returned.
39
+
40
+ **Important Notes:**
41
+
42
+ * The `verifyChecksum()` function in `hf.js` is a **placeholder**. You need to implement the actual checksum verification logic based on your security requirements and how Cursor sends data.
43
+ * The current example uses a simple string comparison for demonstration purposes. You should use a robust cryptographic algorithm like HMAC for production environments.
44
+
45
+ **Disclaimer:**
46
+
47
+ This modified proxy is provided as-is. Use it at your own risk. Always thoroughly test your code and security measures before deploying to production.