ernestmindres commited on
Commit
cb1bd8e
·
verified ·
1 Parent(s): eac0533

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -33,12 +33,20 @@ from user_routes import user_bp
33
  from billing_routes import billing_bp
34
  from embed_routes import embed_bp
35
 
36
- # Valeur par défaut pour la taille max de contenu
37
- DEFAULT_MAX_CONTENT_LENGTH = 16 * 1024 * 1024
 
 
 
38
 
 
 
 
 
 
39
 
40
  # --- Initialisation de l'Application Flask ---
41
- app = Flask(__name__)
42
 
43
  from werkzeug.middleware.proxy_fix import ProxyFix
44
  app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1)
@@ -67,8 +75,6 @@ app.register_blueprint(user_bp)
67
  app.register_blueprint(billing_bp)
68
  app.register_blueprint(embed_bp) # <-- NOUVEL ENREGISTREMENT
69
 
70
-
71
-
72
  # --- Décorateurs d'Authentification (Conservés) ---
73
  def login_required(f):
74
  @wraps(f)
@@ -346,4 +352,5 @@ def validate_email_realtime(client_user):
346
  "is_valid": is_valid,
347
  # Optionnel: l'ID de l'utilisateur qui fait la requête
348
  "client_user_id": client_user.get('user_id')
349
- }), 200 if is_valid else 400
 
 
33
  from billing_routes import billing_bp
34
  from embed_routes import embed_bp
35
 
36
+ # Dossier pour le stockage temporaire des fichiers HTML uploadés
37
+ # Nous utilisons un dossier 'temp_uploads' à la racine de l'application
38
+ UPLOAD_FOLDER = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'temp_uploads')
39
+ if not os.path.exists(UPLOAD_FOLDER):
40
+ os.makedirs(UPLOAD_FOLDER) # Créer le dossier s'il n'existe pas
41
 
42
+ # Extensions de fichiers autorisées (très important pour la sécurité)
43
+ ALLOWED_EXTENSIONS = {'html', 'htm'}
44
+
45
+ app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
46
+ app.config['ALLOWED_EXTENSIONS'] = ALLOWED_EXTENSIONS
47
 
48
  # --- Initialisation de l'Application Flask ---
49
+ app = Flask(__name__)
50
 
51
  from werkzeug.middleware.proxy_fix import ProxyFix
52
  app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1)
 
75
  app.register_blueprint(billing_bp)
76
  app.register_blueprint(embed_bp) # <-- NOUVEL ENREGISTREMENT
77
 
 
 
78
  # --- Décorateurs d'Authentification (Conservés) ---
79
  def login_required(f):
80
  @wraps(f)
 
352
  "is_valid": is_valid,
353
  # Optionnel: l'ID de l'utilisateur qui fait la requête
354
  "client_user_id": client_user.get('user_id')
355
+ }), 200 if is_valid else 400
356
+