diff --git a/JugarAlPadel/K8S/Makefile b/JugarAlPadel/K8S/Makefile index 0f94e96..225a580 100644 --- a/JugarAlPadel/K8S/Makefile +++ b/JugarAlPadel/K8S/Makefile @@ -2,7 +2,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') #export REGISTRY=localhost:5000 export REGISTRY=registry.reymota.es -export IMG_VERSION = 0.17 +export IMG_VERSION = 0.19 export IMG_NGINX_VERSION = 2.3 # limpia todo diff --git a/JugarAlPadel/K8S/Makefile.local b/JugarAlPadel/K8S/Makefile.local new file mode 100644 index 0000000..60fe2ef --- /dev/null +++ b/JugarAlPadel/K8S/Makefile.local @@ -0,0 +1,51 @@ +export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') +export REGISTRY=localhost:5000 +#export REGISTRY=registry.reymota.es + +export IMG_VERSION = 0.21 +export IMG_NGINX_VERSION = 2.4 + +# limpia todo +all: imagen clean install + +imagen: + cd ../; make + +install: + -kubectl create -f namespace.yaml + -kubectl create -f reg-secret.yaml + -kubectl create -f env-prod-configmap.yaml + -kubectl create -f env-prod-db-configmap.yaml + + -kubectl create -f pv-local-jugaralpadel.yaml + -kubectl create -f jugaralpadel-prod-persistentvolumeclaim.yaml + -kubectl create -f static-volume-persistentvolumeclaim.yaml + -kubectl create -f postgres-data-persistentvolumeclaim.yaml + + -kubectl create -f db-deployment.yaml + -kubectl create -f db-service.yaml + + -envsubst < jugaralpadel-deployment.yaml |kubectl create -f - + -envsubst < nginx-deployment.yaml |kubectl create -f - + -kubectl create -f nginx-service.yaml + +clean: + -envsubst < nginx-deployment.yaml |kubectl delete -f - + -kubectl delete -f nginx-service.yaml + -envsubst < jugaralpadel-deployment.yaml |kubectl delete -f - + + -kubectl delete -f db-deployment.yaml + -kubectl delete -f db-service.yaml + + -kubectl delete -f env-prod-configmap.yaml + -kubectl delete -f env-prod-db-configmap.yaml + + -kubectl delete -f postgres-data-persistentvolumeclaim.yaml + -kubectl delete -f static-volume-persistentvolumeclaim.yaml + -kubectl delete -f jugaralpadel-prod-persistentvolumeclaim.yaml + -kubectl delete -f pv-local-jugaralpadel.yaml + -kubectl delete -f reg-secret.yaml + -kubectl delete -f namespace.yaml + +nginx: + cd ../nginx; make diff --git a/JugarAlPadel/K8S/creaDirs.sh b/JugarAlPadel/K8S/creaDirs.sh new file mode 100644 index 0000000..fe06597 --- /dev/null +++ b/JugarAlPadel/K8S/creaDirs.sh @@ -0,0 +1,5 @@ +sudo mkdir -p /mnt/Externo/jugaralpadel/media +sudo mkdir -p /mnt/Externo/jugaralpadel/migrations/eventos +sudo mkdir -p /mnt/Externo/jugaralpadel/migrations/reymotausers +sudo mkdir -p /mnt/Externo/jugaralpadel/static +sudo mkdir -p /mnt/Externo/jugaralpadel/pg diff --git a/JugarAlPadel/K8S/env-prod-configmap.yaml b/JugarAlPadel/K8S/env-prod-configmap.yaml index 971a524..55ef783 100644 --- a/JugarAlPadel/K8S/env-prod-configmap.yaml +++ b/JugarAlPadel/K8S/env-prod-configmap.yaml @@ -1,8 +1,8 @@ apiVersion: v1 data: DEBUG: "False" - DJANGO_ALLOWED_HOSTS: "jugaralpadel.ddns.net reymota.es k8s-server localhost 127.0.0.1 [::1]" - CSRF_TRUSTED_ORIGINS: "https://jugaralpadel.ddns.net" + DJANGO_ALLOWED_HOSTS: "jugaralpadel.ddns.net vmcluster reymota.es k8s-server localhost 127.0.0.1 [::1]" + CSRF_TRUSTED_ORIGINS: "https://jugaralpadel.ddns.net http://vmcluster" SECRET_KEY: change_me SQL_DATABASE: jugaralpadel SQL_ENGINE: django.db.backends.postgresql diff --git a/JugarAlPadel/README.md b/JugarAlPadel/README.md index 445a7b2..012a447 100644 --- a/JugarAlPadel/README.md +++ b/JugarAlPadel/README.md @@ -2,7 +2,7 @@ Desde el directorio K8S ejecutar make (esto hace todo: la imagen, para los pods y los lanza otra vez) -La primera vez, hay que entrar en el pod de vehículos con 'entra.sh' y +La primera vez, hay que entrar en el pod con 'entra.sh' y python manage.py createsuperuser @@ -41,9 +41,8 @@ https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/ -## Cambiar la secuencia de lo sid +## Cambiar la secuencia de los id ALTER SEQUENCE tablename_id_seq RESTART WITH nn; esto se hace cuando restauro un volcado de la bd sobre una instalación nueva. Si hay índices ya creados, hay que reinciar a partir del último. - diff --git a/JugarAlPadel/gestion_reservas/templates/base.html b/JugarAlPadel/gestion_reservas/templates/base.html index 6b908c3..89e6091 100644 --- a/JugarAlPadel/gestion_reservas/templates/base.html +++ b/JugarAlPadel/gestion_reservas/templates/base.html @@ -34,6 +34,23 @@
  • {{ user.nombre }}
  • +
  • +
    + {% csrf_token %} + +
    +
  • {% csrf_token %} diff --git a/JugarAlPadel/gestion_reservas/templates/eventos/lista_eventos.html b/JugarAlPadel/gestion_reservas/templates/eventos/lista_eventos.html index e79233c..d5ed08d 100644 --- a/JugarAlPadel/gestion_reservas/templates/eventos/lista_eventos.html +++ b/JugarAlPadel/gestion_reservas/templates/eventos/lista_eventos.html @@ -67,7 +67,7 @@ {% else %} -

    No se han encontrado eventos para este autor

    +

    No se han encontrado eventos.

    {% endif %} diff --git a/JugarAlPadel/gestion_reservas/templates/registration/login.html b/JugarAlPadel/gestion_reservas/templates/registration/login.html index 870b4b6..01d9f8f 100644 --- a/JugarAlPadel/gestion_reservas/templates/registration/login.html +++ b/JugarAlPadel/gestion_reservas/templates/registration/login.html @@ -84,6 +84,5 @@ - diff --git a/JugarAlPadel/gestion_reservas/templates/registration/password_change_done.html b/JugarAlPadel/gestion_reservas/templates/registration/password_change_done.html new file mode 100644 index 0000000..784ab37 --- /dev/null +++ b/JugarAlPadel/gestion_reservas/templates/registration/password_change_done.html @@ -0,0 +1,20 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} +{% block userlinks %} + {% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}
    {% translate 'Documentation' %} / {% endif %}{% translate 'Change password' %} / + + {% csrf_token %} + +
    + {% include "admin/color_theme_toggle.html" %} +{% endblock %} +{% block breadcrumbs %} + +{% endblock %} + +{% block content %} +

    {% translate 'Your password was changed.' %}

    +{% endblock %} diff --git a/JugarAlPadel/gestion_reservas/templates/registration/password_change_form.html b/JugarAlPadel/gestion_reservas/templates/registration/password_change_form.html new file mode 100644 index 0000000..c6a9484 --- /dev/null +++ b/JugarAlPadel/gestion_reservas/templates/registration/password_change_form.html @@ -0,0 +1,75 @@ +{% load i18n static %} + +{% include "_head.html" %} + + +
    +
    +
    +
    + {% include "_branding.html" %} +

    Cambio de contraseña

    + + {% if form.errors and not form.non_field_errors %} +

    + {% blocktranslate count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktranslate %} +

    + {% endif %} + + +
    + +
    + {% if form.new_password2.help_text %} +
    {{ form.new_password2.help_text|safe }}
    + {% endif %} +
    + +
    + +
    + + +
    +
    +
    + + + +