V1.3 du système de gestions des rapports d'utilisateur
This commit is contained in:
parent
22b3c2a3c4
commit
813ddeb802
2 changed files with 13 additions and 6 deletions
|
|
@ -6,7 +6,7 @@ app = Flask(__name__)
|
|||
|
||||
# --- CONFIGURATION ---
|
||||
PROJECT_PATH = "/home/discord/Bot/Kuby_V2"
|
||||
WEBHOOK_SECRET = "Nois1"
|
||||
WEBHOOK_SECRET = "Nois2"
|
||||
PROCESS_NAME = "kuby-bot"
|
||||
DISCORD_LOG_URL = "https://discord.com/api/webhooks/1482148910888652910/IA9CcOWtjGswbuxMaOu_6uaclv5zojZo4ttxtV6RYyZzJ9gW7BF7xp_Zv3oPIjYEuh8o"
|
||||
|
||||
|
|
@ -78,8 +78,13 @@ def deploy():
|
|||
@app.route('/gitlab_webhook', methods=['POST'])
|
||||
def gitlab_webhook():
|
||||
# Protection par Token uniquement (anti-crawler géré par le secret)
|
||||
if request.headers.get('X-Gitlab-Token') != WEBHOOK_SECRET:
|
||||
abort(404)
|
||||
received_token = request.headers.get('X-Gitlab-Token')
|
||||
|
||||
# Log de debug pour voir ce que GitLab envoie vs ce qu'on attend
|
||||
print(f"[DEBUG] Webhook reçu. Token attendu: '{WEBHOOK_SECRET}', Token reçu: '{received_token}'")
|
||||
|
||||
if received_token != WEBHOOK_SECRET:
|
||||
abort(403) # Changé en 403 pour différencier une route non trouvée d'un accès refusé
|
||||
|
||||
# Transférer la payload au bot Discord localement sur le port 5001
|
||||
payload = request.json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue