archivos de configuración de apache
This commit is contained in:
parent
485cc0684b
commit
f349d248bd
@ -2,9 +2,6 @@ https://www.metricser.com/segmentacion-del-electorado/
|
|||||||
https://htmlstream.com/preview/front-v3.2/documentation/aos.html
|
https://htmlstream.com/preview/front-v3.2/documentation/aos.html
|
||||||
|
|
||||||
|
|
||||||
|
psql -h 127.0.0.1 -U postgres -d formha -a -f forma_backup_24_04_2025.sql
|
||||||
pg_dump -U postgres -d forma -F c -f ./forma.backup
|
|
||||||
|
|
||||||
pg_dump -U postgres -d forma -F p -f .forma.sql
|
|
||||||
|
|
||||||
|
|
||||||
|
416
Documents_ref/forma_backup_24_04_2025.sql
Normal file
416
Documents_ref/forma_backup_24_04_2025.sql
Normal file
File diff suppressed because one or more lines are too long
48
formha.conf
Normal file
48
formha.conf
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<VirtualHost *:8085>
|
||||||
|
ServerAdmin davidix1991@gmail.com
|
||||||
|
ServerName formha.temporal.work
|
||||||
|
ServerAlias formha.temporal.work
|
||||||
|
DocumentRoot /var/www/formha
|
||||||
|
|
||||||
|
WSGIDaemonProcess app user=www-data group=www-data threads=4 python-home=/var/www/formha/.venv
|
||||||
|
WSGIScriptAlias / /var/www/formha/formha.wsgi
|
||||||
|
|
||||||
|
ErrorLog /var/www/formha/log/error.log
|
||||||
|
CustomLog /var/www/formha/log/access.log combined
|
||||||
|
|
||||||
|
<Directory /var/www/formha>
|
||||||
|
WSGIProcessGroup app
|
||||||
|
WSGIApplicationGroup %{GLOBAL}
|
||||||
|
# Order deny,allow
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
|
||||||
|
# Habilitar caché para todas las solicitudes
|
||||||
|
CacheEnable disk /
|
||||||
|
|
||||||
|
# Configuración de caché
|
||||||
|
<IfModule mod_cache_disk.c>
|
||||||
|
CacheRoot /var/cache/apache2/mod_cache_disk
|
||||||
|
CacheDirLevels 2
|
||||||
|
CacheDirLength 1
|
||||||
|
# [bytes] Tamaño máximo de archivo a almacenar en caché
|
||||||
|
CacheMaxFileSize 1000000
|
||||||
|
# CacheMinFileSize bytes
|
||||||
|
CacheMinFileSize 1
|
||||||
|
CacheIgnoreHeaders Set-Cookie
|
||||||
|
CacheIgnoreNoLastMod On
|
||||||
|
|
||||||
|
<FilesMatch "\.(jpg|jpeg|png|gif|css|js)$">
|
||||||
|
# Indica si el caché está funcionando
|
||||||
|
Header set X-Cache "HIT from Apache"
|
||||||
|
# Expiración por defecto (1 hora)
|
||||||
|
CacheDefaultExpire 3600
|
||||||
|
# Expiración máxima (1 día)
|
||||||
|
CacheMaxExpire 86400
|
||||||
|
CacheLastModifiedFactor 0.5
|
||||||
|
</FilesMatch>
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
</VirtualHost>
|
||||||
|
|
14
formha.wsgi
Normal file
14
formha.wsgi
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import sys
|
||||||
|
import logging
|
||||||
|
|
||||||
|
# ruta de linux al proyecto de flask
|
||||||
|
sys.path.insert(0, '/var/www/Formha')
|
||||||
|
|
||||||
|
# ruta de linux al ambiente virtual de flask
|
||||||
|
sys.path.insert(0, '/var/www/Formha/.venv/lib/python3.12/site-packages')
|
||||||
|
|
||||||
|
# Set up logging
|
||||||
|
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
|
||||||
|
|
||||||
|
# Import and run the Flask app
|
||||||
|
from main import app as application
|
0
log/access.log
Normal file
0
log/access.log
Normal file
0
log/error.log
Normal file
0
log/error.log
Normal file
4
main.py
4
main.py
@ -30,7 +30,7 @@ lst_email_to = ["davidix1991@gmail.com", "davicho1991@live.com"]
|
|||||||
|
|
||||||
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
||||||
# INICIO CONFIGURACIÓN JWT
|
# INICIO CONFIGURACIÓN JWT
|
||||||
app.config["JWT_SECRET_KEY"] = "k3y-$up3r-s3cret4" # Usa una clave segura en producción -> MOVER A VARIABLE DE ENTORNO
|
app.config["JWT_SECRET_KEY"] = os.getenv("jwt_secret_key") # Usa una clave segura en producción -> MOVER A VARIABLE DE ENTORNO
|
||||||
app.config['JWT_ACCESS_TOKEN_EXPIRES'] = timedelta(hours=1.5) # timedelta(hours=1) Token expira en 1 hora | timedelta(minutes=1) ` timedelta(seconds=60)`
|
app.config['JWT_ACCESS_TOKEN_EXPIRES'] = timedelta(hours=1.5) # timedelta(hours=1) Token expira en 1 hora | timedelta(minutes=1) ` timedelta(seconds=60)`
|
||||||
# EN LOCALHOST FALSE, EN PRODUCCIÓN TRUE
|
# EN LOCALHOST FALSE, EN PRODUCCIÓN TRUE
|
||||||
app.config['JWT_COOKIE_SECURE'] = False # True en producción con HTTPS
|
app.config['JWT_COOKIE_SECURE'] = False # True en producción con HTTPS
|
||||||
@ -53,7 +53,7 @@ app.config['MAIL_PORT'] = 465
|
|||||||
app.config['MAIL_USE_SSL'] = True
|
app.config['MAIL_USE_SSL'] = True
|
||||||
app.config['MAIL_USERNAME'] = email_sender # email en variable de entorno
|
app.config['MAIL_USERNAME'] = email_sender # email en variable de entorno
|
||||||
app.config['MAIL_PASSWORD'] = email_pswd # contraseña en variable de entorno
|
app.config['MAIL_PASSWORD'] = email_pswd # contraseña en variable de entorno
|
||||||
app.config['SECRET_KEY'] = 'FoRmHä$2025' # Necesario para CSRF y mensajes flash -> la debo colocar en variable de entono?
|
app.config['SECRET_KEY'] = os.getenv("email_secret_key")
|
||||||
mail = Mail(app)
|
mail = Mail(app)
|
||||||
|
|
||||||
def send_async_email(app, msg):
|
def send_async_email(app, msg):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user