Skip to content

Commit

Permalink
Cloudflare only
Browse files Browse the repository at this point in the history
  • Loading branch information
bbedward committed Feb 4, 2024
1 parent 1520c98 commit b17c147
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
7 changes: 5 additions & 2 deletions app/controllers/FaucetController.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def faucet_claim():
if not Captcha.verify_hcaptcha(json_data['hcaptchaResponse'], request.remote_addr):
return jsonify({"error": "Captcha verification failed"})
with db.database.connection_context():
payment, message = FaucetPayment.make_or_reject_payment(json_data['address'], request.remote_addr)
ip = request.headers.get('CF-Connecting-IP')
if ip is None:
return jsonify({"error": "An unknown error has occured"})
payment, message = FaucetPayment.make_or_reject_payment(json_data['address'], ip)
if payment is None:
return jsonify({"error": message})
return jsonify({"success":message})
return jsonify({"success":message})
28 changes: 14 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Flask
Flask
Flask-CORS
Flask==1.1.4
Flask-CORS==3.0.10
MarkupSafe==2.0.1
Werkzeug==0.16.0
Jinja2
itsdangerous
click
Jinja2==2.11.3
itsdangerous==1.1.0
click==7.1.2
python-dotenv

# Database
peewee
Psycopg2-binary
psycogreen
peewee==3.15.2
Psycopg2-binary==2.9.3
psycogreen==1.0.2

# Deployment
gunicorn
gunicorn==20.1.0

# Webpack
flask-webpack-fork
flask-webpack-fork==0.1.1

# SocketIO
flask-socketio<=4.3.2
gevent
gevent-websocket
gevent=21.12.0
gevent-websocket==0.10.1

# Latest JSON lib
simplejson
Expand All @@ -31,13 +31,13 @@ simplejson
pylint

# Redis
redis
redis==4.3.4

# HTTP requests
requests

# Task scheduler
flask-apscheduler
flask-apscheduler==1.12.4

# Tests
pytest
Expand Down

0 comments on commit b17c147

Please sign in to comment.