{"id":32488509,"url":"https://github.com/ungdev/zammad-workflows","last_synced_at":"2026-07-14T14:33:40.934Z","repository":{"id":318179066,"uuid":"1070252727","full_name":"ungdev/zammad-workflows","owner":"ungdev","description":"Workflows serveur for ticketing application Zammad","archived":false,"fork":false,"pushed_at":"2025-10-05T15:35:17.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-27T07:57:13.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ungdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-05T15:18:53.000Z","updated_at":"2025-10-05T15:35:20.000Z","dependencies_parsed_at":"2025-10-05T17:40:24.665Z","dependency_job_id":"d99da3c4-9be3-44a2-88bc-9a67e61b133a","html_url":"https://github.com/ungdev/zammad-workflows","commit_stats":null,"previous_names":["ungdev/zammad-workflows"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ungdev/zammad-workflows","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungdev%2Fzammad-workflows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungdev%2Fzammad-workflows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungdev%2Fzammad-workflows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungdev%2Fzammad-workflows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ungdev","download_url":"https://codeload.github.com/ungdev/zammad-workflows/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungdev%2Fzammad-workflows/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35466541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-14T02:00:06.603Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-27T07:57:09.810Z","updated_at":"2026-07-14T14:33:40.918Z","avatar_url":"https://github.com/ungdev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zammad Workflows\n\nWebhook Flask pour générer automatiquement des PDFs à partir des tickets Zammad du BDE.\n\n## Structure du projet\n\n```\nbde-tickets-to-pdf/\n├── server.py                      # Point d'entrée Flask (endpoints, auth)\n├── wsgi.py                        # Entrée WSGI (exporte `application`) pour gunicorn/uWSGI\n├── config.py                      # Chargement/validation des variables d'environnement\n├── auth.py                        # Décorateur @requires_auth pour le webhook\n├── services/\n│   ├── pdf.py                     # Génération des PDFs (ReportLab)\n│   ├── zammad.py                  # Interaction avec l'API Zammad\n│   └── email.py                   # Envoi d'emails avec pièce jointe PDF (SMTP)\n├── requirements.txt               # Dépendances Python\n├── docker-compose.yaml            # Exemple de configuration Docker Compose\n├── .env.example                   # Exemple de variables d'environnement\n└── README.md                      # Documentation (ce fichier)\n```\n\n## Configuration\n\n1. Copiez `.env.example` vers `.env` :\n   ```bash\n   cp .env.example .env\n   ```\n\n2. Modifiez le fichier `.env` avec vos valeurs :\n   ```env\n   ZAMMAD_API_URL=https://votre-instance.zammad.com/api/v1/ticket_articles\n   ZAMMAD_API_TOKEN=votre_token_api_zammad\n   WEBHOOK_USERNAME=votre_nom_utilisateur\n   WEBHOOK_PASSWORD=votre_mot_de_passe_securise\n   FLASK_DEBUG=false\n   FLASK_PORT=5000\n   SMTP_HOST=smtp.example.com\n   SMTP_PORT=587\n   SMTP_USERNAME=...\n   SMTP_PASSWORD=...\n   MAIL_FROM=webhook@example.com\n   ```\n\n## Installation\n\n```bash\npip install -r requirements.txt\n```\n\n## Utilisation\n\n```bash\npython server.py\n```\n\nLe serveur démarre sur `http://localhost:5000` (ou le port configuré).\n\n### En production (WSGI)\n\nNe pas utiliser le serveur de développement Flask en production. Utilisez un serveur WSGI comme gunicorn ou waitress.\n\nExemple avec gunicorn :\n\n```bash\n# depuis le répertoire du projet\npip install gunicorn\n# lancer 4 workers et écouter sur le port 8080\ngunicorn --workers 4 --bind 0.0.0.0:8080 wsgi:application\n```\n\nExemple avec waitress (Windows / simplicité) :\n\n```bash\npip install waitress\npython -m waitress --port=8080 wsgi:application\n```\n\nRemarques :\n- Assurez-vous que FLASK_DEBUG=false dans vos variables d'environnement pour la production.\n- Vérifiez la configuration des variables d'environnement (voir .env.example) avant de démarrer.\n- Pour déploiements robustes, utilisez un process manager (systemd, supervisor) et configurez la rotation des logs et la supervision.\n\n## Endpoint\n\n- **POST** `/webhook` - Reçoit les données de ticket Zammad et génère un PDF\n\n### Authentification\n\nL'endpoint nécessite une authentification HTTP Basic avec les identifiants configurés dans le fichier `.env`.\n\n### Exemple de requête\n\nLe webhook attend un JSON avec la structure :\n```json\n{\n  \"ticket\": {\n    \"id\": 123,\n    \"number\": \"32087\",\n    \"title\": \"Titre du ticket\",\n    \"owner\": {\n      \"firstname\": \"Jean\",\n      \"lastname\": \"Dupont\"\n    },\n    // ... autres champs BDE\n  },\n  \"article\": {\n    \"body\": \"Contenu de l'article\",\n    \"from\": \"user@example.com\",\n    \"created_at\": \"2025-09-25T10:30:00Z\"\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fungdev%2Fzammad-workflows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fungdev%2Fzammad-workflows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fungdev%2Fzammad-workflows/lists"}