toaster update :3
Some checks failed
Build and push container image / build-and-push-image (push) Failing after 5m28s

This commit is contained in:
2025-08-06 00:41:26 +01:00
parent e66f7e0588
commit 1b2425a493
15 changed files with 1060 additions and 16 deletions

View File

@@ -36,7 +36,7 @@ def not_found(error=None):
log.warning("Page not found: %s", error)
scores = snake.get_leaderboard()
token = snake.generate_start_token()
return render_template('errors/404.html', scores=scores, token=token), 404 if error is not None else 200
return render_template('errors/404.html', scores=scores, token=token, cap_key=env('CAP_KEY', default='')), 404 if error is not None else 200
# Route for 400 error

View File

@@ -46,7 +46,7 @@ def valid_score(score, game_token):
current_time = datetime.datetime.now()
elapsed_time = (current_time - start_time).total_seconds()
if elapsed_time < score / 10 * 5 + 15: # assuming that each point takes 5 seconds to achieve and 15 seconds to start the game and do captcha
if elapsed_time < score / 10 * 3 + 10: # assuming that each point takes 3 seconds to achieve and 10 seconds to start the game and do captcha
log.error("Score is too high for the elapsed time.")
return False

View File

@@ -23,7 +23,7 @@ def verify_captcha(token: str) -> bool:
try:
response = requests.post(
env('CAP_VERIFY_URL', default='https://<instance_url>/<key_id>/siteverify'),
f"https://cap.alfieking.dev/{env('CAP_KEY', default='')}/siteverify",
json={
'secret': env('CAP_SECRET', default=''),
'response': token,

View File

@@ -1,5 +1,5 @@
# Imports
from flask import Flask, request, render_template, send_from_directory, abort
from flask import Flask
from flask_session import Session
from dotenv import load_dotenv