From 3f00b1fc6b3cb46ec4c9418de9a6bb112bec5092 Mon Sep 17 00:00:00 2001 From: Rainer Mbongo Date: Mon, 8 Sep 2025 23:21:52 +0300 Subject: [PATCH 1/2] Initial commit - CS2 Float API with working Steam integration --- SETUP.md | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 SETUP.md diff --git a/SETUP.md b/SETUP.md new file mode 100644 index 00000000..8feeb8ad --- /dev/null +++ b/SETUP.md @@ -0,0 +1,143 @@ +# CS2 Float API Setup Guide + +This is your own float checking API based on the CSFloat inspect library. + +## Requirements + +1. **Steam Account(s) with CS2/CS:GO** + - You need at least 1 Steam account that owns CS2 + - Recommended: 2-3 accounts for better performance + - Accounts should have 2FA enabled + +2. **Server/Hosting** + - VPS with Node.js 14+ + - 1GB RAM minimum (2GB recommended) + - Stable internet connection + +## Setup Steps + +### 1. Configure Steam Accounts + +Edit `config.js` and add your Steam credentials: + +```javascript +'logins': [ + { + 'user': 'your_steam_username', + 'pass': 'your_steam_password', + // For 2FA: either email token or shared_secret from mobile authenticator + 'auth': 'your_2fa_token_or_shared_secret' + } +], +``` + +### 2. First Run (Local Testing) + +```bash +# Install dependencies (already done) +npm install + +# Start the API server +node index.js +``` + +The API will be available at `http://localhost:3002` + +### 3. Test the API + +```bash +# Test with a CS2 inspect link +curl "http://localhost:3002/?url=steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198084749846A698323590D7935523998312483177" +``` + +### 4. Deploy to Production + +#### Option A: Deploy to your existing server +- Upload this folder to your server +- Install Node.js and dependencies +- Run with PM2 or similar process manager +- Set up reverse proxy (nginx) to handle HTTPS + +#### Option B: Use a service like Railway, Heroku, etc. +- Push this code to a Git repository +- Deploy using your preferred platform +- Set environment variables for production + +## Production Configuration + +### Environment Variables +``` +NODE_ENV=production +PORT=3002 +TRUST_PROXY=true # If behind reverse proxy +``` + +### PM2 Configuration +```bash +# Install PM2 +npm install -g pm2 + +# Start the API +pm2 start index.js --name "cs2-float-api" + +# Save PM2 configuration +pm2 save +pm2 startup +``` + +### Nginx Reverse Proxy +```nginx +server { + listen 443 ssl; + server_name cs2floatchecker.com; + + location /api/ { + proxy_pass http://localhost:3002/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # Your website files + location / { + # Serve your static website + } +} +``` + +## Important Notes + +1. **Steam Account Security**: Keep your Steam credentials secure +2. **Rate Limits**: Each account can check ~1 float per second +3. **Monitoring**: Set up monitoring for the API health +4. **Backups**: Consider database backups if using PostgreSQL +5. **Updates**: Keep the library updated for Steam protocol changes + +## Troubleshooting + +### Common Issues: +- **Login failures**: Check Steam credentials and 2FA +- **API timeouts**: Adjust `request_ttl` in config +- **Rate limits**: Add more Steam accounts or increase delays +- **CORS errors**: Check `allowed_origins` in config + +### Logs: +The API logs all activities. Check for: +- Steam login status +- Request processing times +- Error messages + +## Architecture + +``` +Extension → cs2floatchecker.com/api → Your API Server → Steam Servers +``` + +Your API server: +1. Receives inspect links from extension +2. Logs into Steam with bot accounts +3. Requests float data from Steam +4. Returns structured JSON response + +This gives you complete control over the float checking service! \ No newline at end of file From 05c04c7cd413a897b159725960742648689a224e Mon Sep 17 00:00:00 2001 From: Rainer Mbongo Date: Mon, 8 Sep 2025 23:25:06 +0300 Subject: [PATCH 2/2] Add .gitignore and remove sensitive config from tracking --- .gitignore | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 18a53e72..ed020263 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1 @@ -node_modules -config.js -/config -sentry -game_files -.DS_Store -.idea +# Dependencies\nnode_modules/\n\n# Config files with credentials\nconfig.js\n\n# Steam authentication files\nsentry/\nservers.json\n\n# Game files\ngamefiles/\n\n# Logs\n*.log