clearance

This commit is contained in:
teraflops 2025-06-02 23:34:10 +02:00
parent a2571d6e6f
commit 8c97b4f989
Signed by: teraflops
GPG Key ID: 2B77D97AF6F8968C
3 changed files with 0 additions and 168 deletions

View File

@ -1,40 +0,0 @@
document.addEventListener('DOMContentLoaded', () => {
console.log("favorites.js ejecutado correctamente");
const favoriteButton = document.getElementById('favorite-button');
if (!favoriteButton) {
console.warn("Botón de favoritos no encontrado. ¿El usuario está autenticado?");
return;
}
// Obtener el pasteId desde el atributo del <body>
const pasteId = document.body.dataset.pasteId;
if (!pasteId) {
console.error("Error: pasteId no está definido en el <body>.");
return;
}
favoriteButton.addEventListener('click', function () {
fetch(`/paste/${pasteId}/favorite`, {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + (document.body.dataset.authToken || '')
}
})
.then(response => {
if (!response.ok) {
throw new Error('Failed to toggle favorite');
}
return response.json();
})
.then(data => {
const message = data.message || 'Action completed!';
showToast(message, 'bg-success');
})
.catch(error => {
console.error('Error:', error);
showToast('Error adding to favorites.', 'bg-danger');
});
});
});

View File

@ -1,88 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: pastebin-app
spec:
replicas: 1
selector:
matchLabels:
app: pastebin
template:
metadata:
labels:
app: pastebin
spec:
# InitContainers para ajustar permisos de ambos volúmenes
initContainers:
- name: fix-permissions-database
image: busybox
command: ["sh", "-c", "chown -R 1000:1000 /app/database"]
volumeMounts:
- name: database
mountPath: /app/database
- name: fix-permissions-uploads
image: busybox
command: ["sh", "-c", "chown -R 1000:1000 /app/uploads"]
volumeMounts:
- name: uploads
mountPath: /app/uploads
# Contenedor principal
containers:
- name: pastebin-container
image: prietus/pastebin-app:1.4
ports:
- containerPort: 5000
securityContext:
runAsUser: 1000
runAsGroup: 1000
env:
# Variables de entorno para configuración SMTP
- name: SMTP_SERVER
valueFrom:
configMapKeyRef:
name: pastebin-config
key: SMTP_SERVER
- name: SMTP_PORT
valueFrom:
configMapKeyRef:
name: pastebin-config
key: SMTP_PORT
- name: SMTP_USERNAME
valueFrom:
secretKeyRef:
name: pastebin-secret
key: SMTP_USERNAME
- name: SMTP_PASSWORD
valueFrom:
secretKeyRef:
name: pastebin-secret
key: SMTP_PASSWORD
# Variables adicionales
- name: VALID_USER
value: "admin"
- name: VALID_PASS
value: "wasamasa123"
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: pastebin-secret
key: SECRET_KEY
- name: JWT_EXP_DELTA_SECONDS
valueFrom:
configMapKeyRef:
name: pastebin-config
key: JWT_EXP_DELTA_SECONDS
volumeMounts:
- name: database
mountPath: /app/database
- name: uploads
mountPath: /app/uploads
# Declaración de volúmenes
volumes:
- name: database
persistentVolumeClaim:
claimName: database-pvc
- name: uploads
persistentVolumeClaim:
claimName: uploads-pvc

View File

@ -1,40 +0,0 @@
document.addEventListener('DOMContentLoaded', () => {
console.log("favorites.js ejecutado correctamente");
const favoriteButton = document.getElementById('favorite-button');
if (!favoriteButton) {
console.warn("Botón de favoritos no encontrado. ¿El usuario está autenticado?");
return;
}
// Obtener el pasteId desde el atributo del <body>
const pasteId = document.body.dataset.pasteId;
if (!pasteId) {
console.error("Error: pasteId no está definido en el <body>.");
return;
}
favoriteButton.addEventListener('click', function () {
fetch(`/paste/${pasteId}/favorite`, {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + (document.body.dataset.authToken || '')
}
})
.then(response => {
if (!response.ok) {
throw new Error('Failed to toggle favorite');
}
return response.json();
})
.then(data => {
const message = data.message || 'Action completed!';
showToast(message, 'bg-success');
})
.catch(error => {
console.error('Error:', error);
showToast('Error adding to favorites.', 'bg-danger');
});
});
});