Compare commits

...

2 Commits

3 changed files with 9 additions and 9 deletions

View File

@@ -21,19 +21,14 @@ RUN mkdir -p /app/config /app/data/pdfs
# Crée le fichier projects.json
COPY config/projects.json.example /app/config/projects.json
# Crée un utilisateur non-root pour la sécurité
RUN addgroup -g 1001 -S nodejs && \
adduser -S botuser -u 1001
# Change la propriété des fichiers
RUN chown -R botuser:nodejs /app
USER botuser
# Ajuste les permissions pour être plus permissives
RUN chmod -R 777 /app/config
# Définit les variables d'environnement par défaut
ENV NODE_ENV=production
ENV LOG_LEVEL=info
# Commande de démarrage
# Commande de démarrage (en tant que root)
CMD ["node", "src/index.js"]
# Labels pour la documentation

View File

@@ -21,7 +21,7 @@ services:
# Volumes pour la configuration
volumes:
- ./config/projects.json:/app/config/projects.json:ro # Fichier projects.json en lecture seule
- ./config/projects.json:/app/config/projects.json
- pdf-data:/app/data/pdfs #
# Réseau

View File

@@ -26,6 +26,11 @@ class PdfHandler {
const urlOption = interaction.options.getString('url');
const isPublic = interaction.options.getBoolean('public') === true;
if (attachment && urlOption) {
await interaction.editReply({ content: '❌ Fournis soit un fichier PDF, soit une URL, mais pas les deux.' });
return;
}
const sourceUrl = attachment ? attachment.url : urlOption;
if (!attachment && !urlOption) {
await interaction.editReply({ content: '❌ Fournis un PDF (fichier) ou une URL https:// vers un PDF.' });