Преглед изворни кода

Funcionando sin vulnerabilidades

Celestino Rey пре 6 месеци
родитељ
комит
e66797f5eb
7 измењених фајлова са 37 додато и 41 уклоњено
  1. 3 2
      Dockerfile
  2. 9 11
      K8S/Makefile
  3. 1 1
      K8S/finanzas-deployment.yaml
  4. 1 1
      K8S/reg-secret.yaml
  5. 3 3
      Makefile
  6. 0 3
      src/misfinanzas/settings.py
  7. 20 20
      src/requirements.txt

+ 3 - 2
Dockerfile

@@ -1,10 +1,11 @@
-# yup, python 3.11!
-FROM python:3.11-alpine 
+#FROM python:3.11-alpine 
+FROM python:3.14.2-alpine3.23
 
 # install nginx y otras cosas
 RUN apk add nginx netcat-openbsd curl vim jq rsync pango pango-dev cairo postgresql-client bash glib fontconfig font-noto
 
 COPY ./src/requirements.txt requirements.txt
+RUN python3 -m pip install --upgrade pip
 RUN pip install --user --no-cache-dir -r requirements.txt
 
 COPY ./nginx/default.conf /etc/nginx/http.d/nginx.conf

+ 9 - 11
K8S/Makefile

@@ -1,5 +1,5 @@
-export REGISTRY=registry.reymota.es
-export IMG_VERSION = alpine-17
+export REGISTRO=harbor.reymota.es\/finanzas
+export IMG_VERSION = alpine-21
 export NAMESPACE = finanzas
 
 # limpia todo
@@ -16,18 +16,16 @@ install:
 	-cat env-prod-configmap.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 	-cat secreto-db.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 
-	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | kubectl create -f -
+	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl create -f -
 	-cat finanzas-ingress.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 
 clean:
-	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | kubectl delete -f -
-
-	-cat env-prod-configmap.yaml  | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
+	-cat finanzas-ingress.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
+	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl delete -f -
 
-	
 	-cat secreto-db.yaml| sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
+	-cat env-prod-configmap.yaml  | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
 	-cat reg-secret.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
-	-cat finanzas-ingress.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl delete -f -
 
 nginx:
 	cd ../nginx; make
@@ -41,8 +39,8 @@ claims:
 	-cat pvc-static.yaml | sed -e "s/<NS>/${NAMESPACE}/" | kubectl create -f -
 
 app:
-	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | kubectl delete -f -
-	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | kubectl create -f -
+	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl delete -f -
+	-cat finanzas-deployment.yaml | sed -e "s/<NS>/${NAMESPACE}/" | sed -e "s/<TAG>/${IMG_VERSION}/" | sed -e "s/<REGISTRO>/${REGISTRO}/" | kubectl create -f -
 
 db:
-	-kubectl create -f finanzas-db.yaml
+	-kubectl create -f finanzas-db.yaml

+ 1 - 1
K8S/finanzas-deployment.yaml

@@ -34,7 +34,7 @@ spec:
     spec:
       containers:
       - name: finanzas
-        image: registry.reymota.es/finanzas:<TAG>
+        image: <REGISTRO>/finanzas:<TAG>
         env:
         - name: IMG_VERSION
           value: "<TAG>"

+ 1 - 1
K8S/reg-secret.yaml

@@ -4,5 +4,5 @@ metadata:
   name: myregistrykey
   namespace: <NS>
 data:
-  .dockerconfigjson: ewoJImF1dGhzIjogewoJCSJyZWdpc3RyeS5yZXltb3RhLmVzIjogewoJCQkiYXV0aCI6ICJZM0psZVd4dmNHVjZPbEpsZVMweE1UYzIiCgkJfQoJfQp9
+  .dockerconfigjson: ewoJImF1dGhzIjogewoJCSJoYXJib3IucmV5bW90YS5lcyI6IHsKCQkJImF1dGgiOiAiWTNKbGVXeHZjR1Y2T25obGRucHZiaTE0ZFhCb2Izb3RNVkoxZDNOdiIKCQl9LAoJCSJyZWdpc3RyeS5yZXltb3RhLmVzIjogewoJCQkiYXV0aCI6ICJZM0psZVd4dmNHVjZPbEpsZVMweE1UYzIiCgkJfQoJfQp9
 type: kubernetes.io/dockerconfigjson

+ 3 - 3
Makefile

@@ -1,8 +1,8 @@
 install:
 
-	echo "Creando imagen con version '${IMG_VERSION}' en el registry '${REGISTRY}'"
+	echo "Creando imagen con version '${IMG_VERSION}' en el registry '${REGISTRO}'"
 
-	docker build --no-cache -t ${REGISTRY}/finanzas:${IMG_VERSION} -f Dockerfile .
-	docker push ${REGISTRY}/finanzas:${IMG_VERSION}
+	docker build --no-cache -t ${REGISTRO}/finanzas:${IMG_VERSION} -f Dockerfile .
+	docker push ${REGISTRO}/finanzas:${IMG_VERSION}
 
 

+ 0 - 3
src/misfinanzas/settings.py

@@ -102,9 +102,6 @@ DATABASES = {
         "PASSWORD": "Dsa-0213",
         "HOST": os.environ.get('SQL_HOST','postgres-cluster-rw.reymota-pg-cluster.svc.cluster.local'),
         "PORT": "5432",
-        #"OPTIONS": {
-            #"options": "-c search_path=finanzas,public"
-        #}
     }
 }
 

+ 20 - 20
src/requirements.txt

@@ -1,25 +1,25 @@
-asgiref==3.8.1
-Django==4.2
+asgiref==3.11.1
+Django==6.0.2
 django-calculation==1.0.0
-djangorestframework==3.15.2
-flake8==7.1.1
-gunicorn==22.0.0
+djangorestframework==3.16.1
+flake8==7.3.0
+gunicorn==25.0.1
 mccabe==0.7.0
-numpy==2.2.2
-packaging==24.1
-pandas==2.2.3
-pillow==10.4.0
-psycopg==3.2.9
-psycopg-binary==3.2.9
-psycopg-pool==3.2.6
-pycodestyle==2.12.1
-pyflakes==3.2.0
+numpy==2.4.2
+packaging==26.0
+pandas==3.0.0
+pillow==12.1.0
+psycopg==3.3.2
+psycopg-binary==3.3.2
+psycopg-pool==3.3.0
+pycodestyle==2.14.0
+pyflakes==3.4.0
 python-dateutil==2.9.0.post0
-pytz==2025.1
+pytz==2025.2
 six==1.17.0
-sqlparse==0.5.1
-typing_extensions==4.12.2
-tzdata==2025.1
-weasyprint==65.1
+sqlparse==0.5.5
+typing_extensions==4.15.0
+tzdata==2025.3
+weasyprint==68.0
 webencodings==0.5.1
-zopfli==0.2.3.post1
+zopfli==0.4.0