diff --git a/# TP DevOps Corrigé par DeepSeek Original pourrit: https:/cloud.bonisco.fr/s/Cb2bFdLXeFEFcLm # 🚀 TP DevOps Windows - Stack Complète Locale (Corrigé & Optimisé) ## 📋 PRÉ-REQUIS WINDOWS - Installation Pas à Pas ### 🔧 1. Préparation du systèReadme.md b/# TP DevOps Corrigé par DeepSeek Original pourrit: https:/cloud.bonisco.fr/s/Cb2bFdLXeFEFcLm # 🚀 TP DevOps Windows - Stack Complète Locale (Corrigé & Optimisé) ## 📋 PRÉ-REQUIS WINDOWS - Installation Pas à Pas ### 🔧 1. Préparation du systèReadme.md deleted file mode 100644 index 6100d35..0000000 --- a/# TP DevOps Corrigé par DeepSeek Original pourrit: https:/cloud.bonisco.fr/s/Cb2bFdLXeFEFcLm # 🚀 TP DevOps Windows - Stack Complète Locale (Corrigé & Optimisé) ## 📋 PRÉ-REQUIS WINDOWS - Installation Pas à Pas ### 🔧 1. Préparation du systèReadme.md +++ /dev/null @@ -1,1533 +0,0 @@ -# TP DevOps Corrigé par DeepSeek - -Original pourrit: https://cloud.bonisco.fr/s/Cb2bFdLXeFEFcLm - -# 🚀 TP DevOps Windows - Stack Complète Locale (Corrigé & Optimisé) - -## 📋 PRÉ-REQUIS WINDOWS - Installation Pas à Pas - -### 🔧 1. Préparation du système (PowerShell Administrateur) - -```powershell -# Ouvrir PowerShell en tant qu'ADMINISTRATEUR (clic droit → Exécuter en tant qu'administrateur) - -# 1. Activer les fonctionnalités Windows nécessaires -Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform - -# 2. Installer WSL2 et Ubuntu -wsl --install -d Ubuntu-22.04 - -# 3. Définir WSL2 comme version par défaut -wsl --set-default-version 2 - -# 4. Redémarrer l'ordinateur (OBLIGATOIRE) -Restart-Computer -``` - -### 📥 2. Installation des outils (après redémarrage) - -```powershell -# 1. Installer Chocolatey (package manager Windows) -Set-ExecutionPolicy Bypass -Scope Process -Force -[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 -iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - -# 2. Installer tous les outils -choco install -y git docker-desktop vscode kubernetes-cli minikube terraform helm postman -``` - -### 🐧 3. Configuration WSL2 et Ubuntu - -```powershell -# Vérifier l'installation WSL -wsl --list --verbose -# Doit afficher : Ubuntu-22.04 Running 2 - -# Entrer dans WSL pour configurer -wsl - -# Dans le terminal Ubuntu WSL : -sudo apt update -sudo apt upgrade -y -sudo apt install -y python3 python3-pip python3-venv nodejs npm curl wget - -# Créer un alias pratique -echo "alias k=kubectl" >> ~/.bashrc -source ~/.bashrc -exit # Retour à PowerShell -``` - ---- - -## 🐋 ÉTAPE 1 : CONFIGURATION DOCKER DESKTOP - -### ⚙️ Configuration manuelle obligatoire : - -1. Ouvrir Docker Desktop après installation -2. Settings → General : - - ✅ Use WSL 2 based engine - - ✅ Expose daemon on tcp://localhost:2375 without TLS -3. Settings → Resources → WSL Integration : - - ✅ Enable integration with my default WSL distro - - ✅ Ubuntu-22.04 -4. Settings → Kubernetes : - - ✅ Enable Kubernetes - - ✅ Deploy Docker Stacks to Kubernetes by default -5. Settings → Advanced : - - CPUs : 4 (ou 50% de vos CPUs) - - Memory : 4.0 GB (ou 50% de votre RAM) - - Swap : 1.0 GB -6. Appliquer et redémarrer Docker Desktop - -### ✅ Vérification Docker/WSL2 : - -```powershell -# Dans PowerShell -docker --version -# Doit afficher : Docker version 24.0.x - -docker run hello-world -# Doit afficher "Hello from Docker!" - -# Vérifier l'intégration WSL2 -wsl -d Ubuntu-22.04 -e docker version -# Doit fonctionner sans erreur -``` - ---- - -## 📁 ÉTAPE 2 : STRUCTURE DU PROJET OPTIMISÉE - -### 🗂️ Création de la structure : - -```powershell -# Créer le dossier principal -mkdir C:\DevOpsProject -cd C:\DevOpsProject - -# Structure ORGANISÉE et LOGIQUE -New-Item -ItemType Directory -Path @( - "src\app", - "src\app\tests", - "docker", - "kubernetes\manifests", - "kubernetes\helm", - "terraform", - ".github\workflows", - "monitoring", - "scripts", - "docs", - "config" -) - -# Structure finale : -C:\DevOpsProject\ -├── src\ # Code source -│ ├── app\ # Application Python -│ └── app\tests\ # Tests unitaires -├── docker\ # Dockerfiles & Compose -├── kubernetes\ # K8s manifests -├── terraform\ # Infrastructure as Code -├── monitoring\ # Prometheus, Grafana -├── scripts\ # Scripts PowerShell -├── .github\workflows\ # CI/CD -├── config\ # Fichiers de config -└── docs\ # Documentation -``` - ---- - -## 🐍 ÉTAPE 3 : APPLICATION PYTHON CORRIGÉE - -### 3.1 Fichier : src\\app\\requirements.txt - -```txt -fastapi==0.104.1 -uvicorn[standard]==0.24.0 -pydantic==2.5.0 -prometheus-client==0.19.0 -python-dotenv==1.0.0 -pytest==7.4.3 -httpx==0.25.1 -``` - -### 3.2 Fichier : src\\app\\main.py (CORRIGÉ) - -```python -from fastapi import FastAPI, Request, Response, HTTPException -from prometheus_client import Counter, Histogram, generate_latest, CONTENT_TYPE_LATEST -import time -import os -import logging -from typing import Dict - -# Configuration du logging -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger(__name__) - -app = FastAPI( - title="DevOps Windows API", - description="Application de démonstration DevOps sous Windows", - version="1.0.0" -) - -# Métriques Prometheus - CORRIGÉ -REQUEST_COUNT = Counter( - 'http_requests_total', - 'Total HTTP Requests', - ['method', 'endpoint', 'status'] -) -REQUEST_LATENCY = Histogram( - 'http_request_duration_seconds', - 'HTTP Request latency', - ['method', 'endpoint'] -) - -@app.middleware("http") -async def monitor_requests(request: Request, call_next): - """Middleware pour monitorer les requêtes""" - start_time = time.time() - - try: - response = await call_next(request) - status_code = str(response.status_code) - except Exception as e: - status_code = "500" - response = Response( - content=f"Internal Server Error: {str(e)}", - status_code=500 - ) - - process_time = time.time() - start_time - - # Enregistrement des métriques - CORRIGÉ - REQUEST_COUNT.labels( - method=request.method, - endpoint=request.url.path, - status=status_code - ).inc() - - REQUEST_LATENCY.labels( - method=request.method, - endpoint=request.url.path - ).observe(process_time) - - # Ajouter le temps de traitement dans les headers - response.headers["X-Process-Time"] = f"{process_time:.3f}s" - - return response - -@app.get("/") -async def home(): - """Endpoint principal""" - return { - "message": "🚀 DevOps Stack Windows - Fonctionnel !", - "environment": os.getenv("ENV", "development"), - "status": "running", - "hostname": os.getenv("HOSTNAME", "windows-devops"), - "version": "1.0.0" - } - -@app.get("/health") -async def health(): - """Health check pour Kubernetes et load balancers""" - return { - "status": "healthy", - "timestamp": time.time(), - "service": "devops-app" - } - -@app.get("/metrics") -async def metrics(): - """Endpoint Prometheus - CORRIGÉ""" - try: - data = generate_latest() - return Response( - content=data, - media_type=CONTENT_TYPE_LATEST, - headers={"Cache-Control": "no-cache"} - ) - except Exception as e: - logger.error(f"Error generating metrics: {e}") - raise HTTPException(status_code=500, detail="Metrics generation failed") - -@app.get("/info") -async def info(): - """Informations système""" - return { - "python_version": "3.11", - "platform": "windows", - "service": "FastAPI DevOps", - "features": ["docker", "kubernetes", "monitoring", "ci-cd"] - } - -@app.get("/env") -async def show_env(): - """Afficher les variables d'environnement (sécurisé)""" - safe_env = { - "ENV": os.getenv("ENV", "not-set"), - "HOSTNAME": os.getenv("HOSTNAME", "not-set"), - "PYTHON_VERSION": os.getenv("PYTHON_VERSION", "not-set") - } - return safe_env - -# Pour le développement local -if __name__ == "__main__": - import uvicorn - logger.info("Starting FastAPI server...") - uvicorn.run( - app, - host="0.0.0.0", - port=8000, - log_level="info", - reload=True # Auto-reload en développement - ) -``` - -### 3.3 Fichier : src\\app\\tests\\test_main.py (NOUVEAU) - -```python -import pytest -from fastapi.testclient import TestClient -from main import app - -client = TestClient(app) - -def test_home_endpoint(): - """Test de l'endpoint principal""" - response = client.get("/") - assert response.status_code == 200 - data = response.json() - assert "message" in data - assert "status" in data - assert data["status"] == "running" - -def test_health_endpoint(): - """Test du health check""" - response = client.get("/health") - assert response.status_code == 200 - data = response.json() - assert data["status"] == "healthy" - assert "service" in data - -def test_metrics_endpoint(): - """Test des métriques Prometheus""" - response = client.get("/metrics") - assert response.status_code == 200 - assert "text/plain" in response.headers["content-type"] - assert "http_requests_total" in response.text - -def test_info_endpoint(): - """Test des informations""" - response = client.get("/info") - assert response.status_code == 200 - data = response.json() - assert "python_version" in data - assert "platform" in data - -def test_env_endpoint(): - """Test des variables d'environnement""" - response = client.get("/env") - assert response.status_code == 200 - data = response.json() - assert "ENV" in data -``` - -### 3.4 Fichier : src\\app\\Dockerfile (OPTIMISÉ) - -```dockerfile -# Étape 1 : Build -FROM python:3.11-slim AS builder - -WORKDIR /app - -# Copier les requirements d'abord (cache Docker) -COPY requirements.txt . -RUN pip install --user --no-cache-dir -r requirements.txt - -# Étape 2 : Runtime -FROM python:3.11-slim - -WORKDIR /app - -# Copier les packages depuis le builder -COPY --from=builder /root/.local /root/.local -COPY . . - -# Ajouter au PATH -ENV PATH=/root/.local/bin:$PATH -ENV PYTHONDONTWRITEBYTECODE=1 -ENV PYTHONUNBUFFERED=1 -ENV ENV=production -ENV HOSTNAME=devops-container - -# Exposer le port -EXPOSE 8000 - -# Utiliser un user non-root pour la sécurité -RUN useradd -m -u 1000 devopsuser && chown -R devopsuser:devopsuser /app -USER devopsuser - -# Commande de démarrage -CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--no-access-log"] -``` - ---- - -## 🐳 ÉTAPE 4 : DOCKER COMPOSE CORRIGÉ - -### 4.1 Fichier : docker\\docker-compose.yml (RECOMMENCÉ) - -```yaml -version: '3.8' - -services: - # Application principale - app: - build: - context: ../src/app - dockerfile: Dockerfile - container_name: devops-app - ports: - - "8000:8000" - environment: - - ENV=development - - HOSTNAME=devops-local - volumes: - - ../src/app:/app - - app-logs:/app/logs - networks: - - devops-network - restart: unless-stopped - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8000/health"] - interval: 30s - timeout: 10s - retries: 3 - start_period: 40s - labels: - - "com.devops.description=Application FastAPI" - - "prometheus.scrape=true" - - "prometheus.port=8000" - - "prometheus.path=/metrics" - - # Prometheus pour le monitoring - prometheus: - image: prom/prometheus:v2.47.2 - container_name: devops-prometheus - ports: - - "9090:9090" - volumes: - - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - - prometheus-data:/prometheus - command: - - '--config.file=/etc/prometheus/prometheus.yml' - - '--storage.tsdb.path=/prometheus' - - '--web.console.libraries=/etc/prometheus/console_libraries' - - '--web.console.templates=/etc/prometheus/consoles' - - '--storage.tsdb.retention.time=200h' - - '--web.enable-lifecycle' - networks: - - devops-network - restart: unless-stopped - depends_on: - - app - - # Grafana pour les dashboards - grafana: - image: grafana/grafana:10.2.0 - container_name: devops-grafana - ports: - - "3000:3000" - environment: - - GF_SECURITY_ADMIN_PASSWORD=admin123 - - GF_SECURITY_ADMIN_USER=admin - - GF_INSTALL_PLUGINS=grafana-piechart-panel,grafana-clock-panel - - GF_USERS_ALLOW_SIGN_UP=false - - GF_SERVER_DOMAIN=localhost - volumes: - - grafana-data:/var/lib/grafana - - ./grafana-dashboards:/etc/grafana/provisioning/dashboards - - ./grafana-datasources:/etc/grafana/provisioning/datasources - networks: - - devops-network - restart: unless-stopped - depends_on: - - prometheus - - # Portainer pour gérer Docker - portainer: - image: portainer/portainer-ce:2.19.3 - container_name: devops-portainer - ports: - - "9000:9000" - - "9443:9443" - volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro - - portainer-data:/data - networks: - - devops-network - restart: unless-stopped - command: -H unix:///var/run/docker.sock - - # Nginx comme reverse proxy (optionnel) - nginx: - image: nginx:alpine - container_name: devops-nginx - ports: - - "8080:80" - volumes: - - ./nginx.conf:/etc/nginx/nginx.conf:ro - networks: - - devops-network - restart: unless-stopped - depends_on: - - app - -networks: - devops-network: - driver: bridge - name: devops-network - -volumes: - prometheus-data: - name: prometheus-data - grafana-data: - name: grafana-data - portainer-data: - name: portainer-data - app-logs: - name: app-logs -``` - -### 4.2 Fichier : docker\\prometheus.yml (À CRÉER) - -```yaml -global: - scrape_interval: 15s - evaluation_interval: 15s - external_labels: - cluster: 'windows-devops' - environment: 'development' - -# Règles d'alerte -rule_files: - # - "alerts.yml" - -# Configuration de scraping -scrape_configs: - # Scraper l'application FastAPI - - job_name: 'fastapi-app' - static_configs: - - targets: ['app:8000'] - labels: - app: 'devops-app' - component: 'backend' - tier: 'application' - - # Scraper Prometheus lui-même - - job_name: 'prometheus' - static_configs: - - targets: ['localhost:9090'] - labels: - component: 'monitoring' - - # Découverte de service Docker - - job_name: 'docker' - static_configs: - - targets: ['host.docker.internal:9323'] - metrics_path: /metrics - scheme: http - -# Alerting (exemple) -# alerting: -# alertmanagers: -# - static_configs: -# - targets: [] -``` - -### 4.3 Exécution Docker Compose : - -```powershell -# Se placer dans le dossier docker -cd C:\DevOpsProject\docker - -# Lancer en arrière-plan -docker-compose up -d - -# Vérifier que tout fonctionne -docker-compose ps - -# Voir les logs de l'application -docker-compose logs app - -# Tester l'application -curl http://localhost:8000 -# ou dans PowerShell -Invoke-WebRequest -Uri "http://localhost:8000" -UseBasicParsing -``` - ---- - -## ☸️ ÉTAPE 5 : KUBERNETES SIMPLIFIÉ POUR WINDOWS - -### 5.1 Activer Kubernetes dans Docker Desktop : - -``` -1. Docker Desktop → Settings (roue crantée) -2. Onglet Kubernetes -3. ✅ Enable Kubernetes -4. ✅ Show system containers (optional) -5. Apply & Restart (patienter 2-3 minutes) -``` - -### 5.2 Vérification : - -```powershell -# Vérifier que Kubernetes fonctionne -kubectl cluster-info -# Doit afficher : Kubernetes control plane is running at https://... - -kubectl get nodes -# Doit afficher : docker-desktop Ready - -kubectl get pods --all-namespaces -# Doit montrer les pods système -``` - -### 5.3 Fichier : kubernetes\\manifests\\namespace.yaml - -```yaml -apiVersion: v1 -kind: Namespace -metadata: - name: devops-demo - labels: - name: devops-demo - environment: development -``` - -### 5.4 Fichier : kubernetes\\manifests\\configmap.yaml (NOUVEAU) - -```yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: app-config - namespace: devops-demo -data: - ENV: "production" - APP_NAME: "devops-windows-app" - LOG_LEVEL: "INFO" - PYTHONUNBUFFERED: "1" -``` - -### 5.5 Fichier : kubernetes\\manifests\\deployment.yaml (SIMPLIFIÉ) - -```yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: devops-app - namespace: devops-demo - labels: - app: devops-app - version: v1 -spec: - replicas: 2 - selector: - matchLabels: - app: devops-app - template: - metadata: - labels: - app: devops-app - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "8000" - prometheus.io/path: "/metrics" - spec: - containers: - - name: app - image: devops-app:local # IMPORTANT : Utiliser l'image locale - imagePullPolicy: IfNotPresent # Ne pas pull depuis Docker Hub - ports: - - containerPort: 8000 - name: http - envFrom: - - configMapRef: - name: app-config - env: - - name: HOSTNAME - valueFrom: - fieldRef: - fieldPath: metadata.name - resources: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "256Mi" - cpu: "200m" - readinessProbe: - httpGet: - path: /health - port: 8000 - initialDelaySeconds: 10 - periodSeconds: 15 - livenessProbe: - httpGet: - path: /health - port: 8000 - initialDelaySeconds: 30 - periodSeconds: 30 ---- -apiVersion: v1 -kind: Service -metadata: - name: devops-app-service - namespace: devops-demo -spec: - selector: - app: devops-app - ports: - - port: 80 - targetPort: 8000 - protocol: TCP - name: http - type: NodePort # CORRIGÉ : NodePort au lieu de LoadBalancer pour Windows -``` - -### 5.6 Déploiement Kubernetes : - -```powershell -# 1. Build l'image Docker avec un tag spécifique -cd C:\DevOpsProject\src\app -docker build -t devops-app:local . - -# 2. Appliquer les manifests Kubernetes -cd C:\DevOpsProject\kubernetes\manifests - -# Dans l'ordre : -kubectl apply -f namespace.yaml -kubectl apply -f configmap.yaml -kubectl apply -f deployment.yaml - -# 3. Vérifier le déploiement -kubectl get all -n devops-demo - -# 4. Obtenir l'URL d'accès -kubectl get svc -n devops-demo devops-app-service -o jsonpath='{.spec.ports[0].nodePort}' -# Notez le numéro de port (ex: 30456) - -# 5. Accéder à l'application -# http://localhost:[PORT] (ex: http://localhost:30456) -``` - ---- - -## 🏗️ ÉTAPE 6 : TERRAFORM SIMPLIFIÉ (OPTIONNEL) - -### ⚠️ IMPORTANT : Terraform + Docker sur Windows/WSL2 est complexe. - -### Je recommande de SAUTER cette étape pour les débutants. - -Si vous voulez quand même essayer : - -### 6.1 Fichier : terraform\\main.tf (VERSION SIMPLIFIÉE) - -```hcl -# Terraform minimal pour Windows - KUBERNETES UNIQUEMENT -terraform { - required_version = ">= 1.5.0" - - required_providers { - kubernetes = { - source = "hashicorp/kubernetes" - version = "~> 2.23" - } - } -} - -# Provider Kubernetes avec Docker Desktop -provider "kubernetes" { - config_path = "~/.kube/config" - config_context = "docker-desktop" -} - -# Namespace -resource "kubernetes_namespace" "devops" { - metadata { - name = "terraform-ns" - - labels = { - created-by = "terraform" - environment = "development" - } - } -} - -# Déploiement simple -resource "kubernetes_deployment" "app" { - metadata { - name = "terraform-app" - namespace = kubernetes_namespace.devops.metadata[0].name - - labels = { - app = "terraform-app" - } - } - - spec { - replicas = 1 - - selector { - match_labels = { - app = "terraform-app" - } - } - - template { - metadata { - labels = { - app = "terraform-app" - } - } - - spec { - container { - name = "app" - image = "nginx:alpine" # Image simple pour test - - port { - container_port = 80 - } - - resources { - limits = { - cpu = "100m" - memory = "128Mi" - } - requests = { - cpu = "50m" - memory = "64Mi" - } - } - } - } - } - } - - depends_on = [kubernetes_namespace.devops] -} - -# Service -resource "kubernetes_service" "app" { - metadata { - name = "terraform-service" - namespace = kubernetes_namespace.devops.metadata[0].name - } - - spec { - selector = { - app = kubernetes_deployment.app.spec[0].template[0].metadata[0].labels.app - } - - port { - port = 8080 - target_port = 80 - } - - type = "NodePort" - } -} - -# Output utile -output "application_url" { - value = "http://localhost:${kubernetes_service.app.spec[0].port[0].node_port}" -} - -output "namespace" { - value = kubernetes_namespace.devops.metadata[0].name -} -``` - -### 6.2 Utilisation Terraform : - -```powershell -cd C:\DevOpsProject\terraform - -# Initialiser -terraform init - -# Voir ce qui va être créé -terraform plan - -# Appliquer (tapez 'yes' quand demandé) -terraform apply - -# Pour détruire -terraform destroy -``` - ---- - -## 📦 ÉTAPE 7 : HELM SIMPLE POUR WINDOWS - -### 7.1 Création d'un chart Helm simple : - -```powershell -cd C:\DevOpsProject\kubernetes\helm - -# Créer un chart Helm -helm create devops-chart - -# Supprimer les fichiers inutiles créés par défaut -Remove-Item devops-chart\templates\* -Recurse -Force - -# Créer une structure propre -New-Item -ItemType Directory -Path @( - "devops-chart\templates", - "devops-chart\charts" -) -``` - -### 7.2 Fichier : kubernetes\\helm\\devops-chart\\Chart.yaml - -```yaml -apiVersion: v2 -name: devops-chart -description: Chart Helm pour DevOps Windows -type: application -version: 0.1.0 -appVersion: "1.0.0" -``` - -### 7.3 Fichier : kubernetes\\helm\\devops-chart\\values.yaml - -```yaml -# Configuration de l'application -app: - name: "devops-helm-app" - image: - repository: "devops-app" - tag: "local" - pullPolicy: "IfNotPresent" - - replicaCount: 2 - - service: - type: NodePort - port: 80 - targetPort: 8000 - - resources: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "256Mi" - cpu: "200m" - - env: - ENV: "production" - LOG_LEVEL: "INFO" - -# Monitoring -monitoring: - enabled: true - prometheusScrape: true -``` - -### 7.4 Fichier : kubernetes\\helm\\devops-chart\\templates\\deployment.yaml - -```yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Values.app.name }} - labels: - app: {{ .Values.app.name }} - chart: {{ .Chart.Name }} - version: {{ .Chart.Version }} -spec: - replicas: {{ .Values.app.replicaCount }} - selector: - matchLabels: - app: {{ .Values.app.name }} - template: - metadata: - labels: - app: {{ .Values.app.name }} - {{- if .Values.monitoring.enabled }} - annotations: - prometheus.io/scrape: "{{ .Values.monitoring.prometheusScrape }}" - prometheus.io/port: "{{ .Values.app.service.targetPort }}" - prometheus.io/path: "/metrics" - {{- end }} - spec: - containers: - - name: {{ .Values.app.name }} - image: "{{ .Values.app.image.repository }}:{{ .Values.app.image.tag }}" - imagePullPolicy: {{ .Values.app.image.pullPolicy }} - ports: - - containerPort: {{ .Values.app.service.targetPort }} - name: http - env: - {{- range $key, $value := .Values.app.env }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} - resources: - {{- toYaml .Values.app.resources | nindent 10 }} - readinessProbe: - httpGet: - path: /health - port: {{ .Values.app.service.targetPort }} - initialDelaySeconds: 10 - periodSeconds: 15 -``` - -### 7.5 Installation avec Helm : - -```powershell -cd C:\DevOpsProject\kubernetes\helm - -# Installer le chart -helm install devops-release ./devops-chart -n devops-demo --create-namespace - -# Vérifier l'installation -helm list -n devops-demo - -# Mettre à jour -helm upgrade devops-release ./devops-chart -n devops-demo - -# Désinstaller -helm uninstall devops-release -n devops-demo -``` - ---- - -## 🔄 ÉTAPE 8 : GITHUB ACTIONS CORRIGÉ - -### 8.1 Fichier : .github\\workflows\\ci-cd.yml (PRATIQUE) - -```yaml -name: CI/CD DevOps Windows - -on: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] - workflow_dispatch: # Permet de déclencher manuellement - -jobs: - # Job 1 : Tests de l'application - test: - runs-on: windows-latest - - steps: - - name: Checkout du code - uses: actions/checkout@v3 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r src/app/requirements.txt - - - name: Run tests - run: | - cd src/app - python -m pytest tests/ -v --cov=. --cov-report=xml - - - name: Upload coverage - uses: codecov/codecov-action@v3 - with: - file: ./src/app/coverage.xml - flags: unittests - - # Job 2 : Build Docker - build: - needs: test - runs-on: windows-latest - - steps: - - uses: actions/checkout@v3 - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub (seulement sur main) - if: github.ref == 'refs/heads/main' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Docker image - uses: docker/build-push-action@v4 - with: - context: ./src/app - push: ${{ github.ref == 'refs/heads/main' }} - tags: | - ${{ secrets.DOCKER_USERNAME }}/devops-app:latest - ${{ secrets.DOCKER_USERNAME }}/devops-app:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max - - # Job 3 : Déploiement (optionnel pour Windows) - deploy: - needs: build - runs-on: windows-latest - if: github.ref == 'refs/heads/main' - - steps: - - uses: actions/checkout@v3 - - - name: Setup kubectl - uses: azure/setup-kubectl@v3 - with: - version: 'latest' - - - name: Configure kubeconfig - run: | - # Pour une vraie installation, configurez votre kubeconfig ici - # Pour la démo, on affiche juste un message - echo "Dans un environnement réel, vous configureriez kubeconfig ici" - echo "Utilisez des secrets GitHub pour stocker votre configuration" - - - name: Deploy to Kubernetes - run: | - echo "Déploiement simulé" - echo "En production, vous utiliseriez :" - echo "kubectl apply -f kubernetes/manifests/" - echo "ou" - echo "helm upgrade --install ..." -``` - ---- - -## 📊 ÉTAPE 9 : MONITORING FONCTIONNEL - -### 9.1 Dashboard Grafana prêt à l'emploi : - -```powershell -# Créer un dossier pour les dashboards Grafana -mkdir C:\DevOpsProject\docker\grafana-dashboards - -# Créer un fichier de dashboard simple -@' -{ - "dashboard": { - "title": "DevOps Windows Dashboard", - "panels": [ - { - "title": "Requêtes HTTP", - "type": "graph", - "targets": [{ - "expr": "rate(http_requests_total[5m])", - "legendFormat": "{{method}} {{endpoint}}" - }] - }, - { - "title": "Latence", - "type": "graph", - "targets": [{ - "expr": "histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))", - "legendFormat": "p95" - }] - } - ] - } -} -'@ | Out-File -FilePath "C:\DevOpsProject\docker\grafana-dashboards\dashboard.json" -Encoding UTF8 -``` - -### 9.2 Accès aux interfaces : - -``` -✅ Après docker-compose up -d : - -1. Application FastAPI : http://localhost:8000 -2. Documentation API : http://localhost:8000/docs (Swagger UI) -3. Métriques Prometheus : http://localhost:9090 -4. Grafana Dashboard : http://localhost:3000 - → Login : admin / admin123 -5. Portainer : http://localhost:9000 - -✅ Après déploiement Kubernetes : - -1. Application K8s : http://localhost:[NODE_PORT] - (trouvez le port avec : kubectl get svc -n devops-demo) -``` - ---- - -## 🛠️ ÉTAPE 10 : SCRIPTS PRATIQUES - -### 10.1 Script : scripts\\setup.ps1 (AMÉLIORÉ) - -```powershell -# DevOps Windows Setup Script -# PowerShell 5.1+ requis - -param( - [switch]$SkipDocker = $false, - [switch]$SkipK8s = $false, - [switch]$Help = $false -) - -if ($Help) { - Write-Host "Usage: .\setup.ps1 [-SkipDocker] [-SkipK8s] [-Help]" -ForegroundColor Cyan - Write-Host " -SkipDocker : Ne pas démarrer Docker Compose" -ForegroundColor Gray - Write-Host " -SkipK8s : Ne pas déployer sur Kubernetes" -ForegroundColor Gray - Write-Host " -Help : Afficher cette aide" -ForegroundColor Gray - exit 0 -} - -Write-Host "========================================" -ForegroundColor Green -Write-Host " DEVOPS WINDOWS SETUP" -ForegroundColor Green -Write-Host "========================================" -ForegroundColor Green -Write-Host "" - -# 1. Vérification des outils -Write-Host "[1/5] Vérification des outils..." -ForegroundColor Yellow - -$tools = @( - @{Name="Docker"; Cmd="docker --version"}, - @{Name="kubectl"; Cmd="kubectl version --client"}, - @{Name="helm"; Cmd="helm version"}, - @{Name="python"; Cmd="python --version"} -) - -foreach ($tool in $tools) { - try { - $output = Invoke-Expression $tool.Cmd 2>&1 - Write-Host " ✅ $($tool.Name) : OK" -ForegroundColor Green - } catch { - Write-Host " ❌ $($tool.Name) : MANQUANT" -ForegroundColor Red - Write-Host " Installez avec: choco install $($tool.Name.ToLower())" -ForegroundColor Gray - } -} - -Write-Host "" - -# 2. Build de l'application -Write-Host "[2/5] Build de l'application Docker..." -ForegroundColor Yellow -try { - Set-Location "$PSScriptRoot\..\src\app" - docker build -t devops-app:local . - Write-Host " ✅ Image Docker construite" -ForegroundColor Green - Set-Location $PSScriptRoot -} catch { - Write-Host " ❌ Erreur lors du build Docker" -ForegroundColor Red - Write-Host $_.Exception.Message - exit 1 -} - -# 3. Docker Compose -if (-not $SkipDocker) { - Write-Host "[3/5] Démarrage Docker Compose..." -ForegroundColor Yellow - try { - Set-Location "$PSScriptRoot\..\docker" - - # Arrêter si déjà en cours - docker-compose down 2>$null - - # Démarrer - docker-compose up -d - - # Attendre que les services soient prêts - Start-Sleep -Seconds 10 - - Write-Host " ✅ Docker Compose démarré" -ForegroundColor Green - Write-Host " Attente supplémentaire pour les services..." -ForegroundColor Gray - - # Vérifier l'application - $attempts = 0 - $maxAttempts = 6 - while ($attempts -lt $maxAttempts) { - try { - $response = Invoke-WebRequest -Uri "http://localhost:8000/health" -UseBasicParsing -TimeoutSec 5 - if ($response.StatusCode -eq 200) { - Write-Host " ✅ Application accessible" -ForegroundColor Green - break - } - } catch { - $attempts++ - Write-Host " ⏳ Tentative $attempts/$maxAttempts..." -ForegroundColor Yellow - Start-Sleep -Seconds 10 - - if ($attempts -eq $maxAttempts) { - Write-Host " ⚠️ Application lente à démarrer" -ForegroundColor Yellow - } - } - } - - Set-Location $PSScriptRoot - } catch { - Write-Host " ⚠️ Erreur Docker Compose : $($_.Exception.Message)" -ForegroundColor Yellow - Set-Location $PSScriptRoot - } -} - -# 4. Kubernetes -if (-not $SkipK8s) { - Write-Host "[4/5] Déploiement Kubernetes..." -ForegroundColor Yellow - try { - Set-Location "$PSScriptRoot\..\kubernetes\manifests" - - # Vérifier que Kubernetes est activé - $k8sContext = kubectl config current-context 2>$null - if ($LASTEXITCODE -ne 0) { - Write-Host " ℹ️ Kubernetes non configuré, passage au mode Docker uniquement" -ForegroundColor Yellow - } else { - # Appliquer les manifests - kubectl apply -f namespace.yaml - kubectl apply -f configmap.yaml - kubectl apply -f deployment.yaml - - Write-Host " ✅ Déploiement Kubernetes terminé" -ForegroundColor Green - - # Obtenir les infos - $service = kubectl get svc -n devops-demo devops-app-service -o json | ConvertFrom-Json - $nodePort = $service.spec.ports[0].nodePort - Write-Host " Accès K8s : http://localhost:$nodePort" -ForegroundColor Cyan - } - - Set-Location $PSScriptRoot - } catch { - Write-Host " ⚠️ Erreur Kubernetes : $($_.Exception.Message)" -ForegroundColor Yellow - Set-Location $PSScriptRoot - } -} - -Write-Host "[5/5] Récapitulatif..." -ForegroundColor Yellow -Write-Host "" -Write-Host "========================================" -ForegroundColor Green -Write-Host " SETUP TERMINÉ !" -ForegroundColor Green -Write-Host "========================================" -ForegroundColor Green -Write-Host "" -Write-Host "🌐 ACCèS AUX SERVICES :" -ForegroundColor White -Write-Host "" -Write-Host " 📊 Application FastAPI :" -ForegroundColor Cyan -Write-Host " • Interface : http://localhost:8000" -ForegroundColor Gray -Write-Host " • Health : http://localhost:8000/health" -ForegroundColor Gray -Write-Host " • Docs : http://localhost:8000/docs" -ForegroundColor Gray -Write-Host " • Métriques : http://localhost:8000/metrics" -ForegroundColor Gray -Write-Host "" -Write-Host " 📈 Monitoring :" -ForegroundColor Cyan -Write-Host " • Prometheus : http://localhost:9090" -ForegroundColor Gray -Write-Host " • Grafana : http://localhost:3000" -ForegroundColor Gray -Write-Host " Login : admin / admin123" -ForegroundColor DarkGray -Write-Host "" -Write-Host " 🐳 Gestion Docker :" -ForegroundColor Cyan -Write-Host " • Portainer : http://localhost:9000" -ForegroundColor Gray -Write-Host "" -if (-not $SkipK8s) { - Write-Host " ☸️ Kubernetes :" -ForegroundColor Cyan - Write-Host " • Vérifier : kubectl get pods -n devops-demo" -ForegroundColor Gray - Write-Host " • Logs : kubectl logs -f -n devops-demo -l app=devops-app" -ForegroundColor Gray -} -Write-Host "" -Write-Host "🔧 COMMANDES UTILES :" -ForegroundColor White -Write-Host " * Voir les logs : docker-compose logs -f [app|prometheus|grafana]" -ForegroundColor DarkGray -Write-Host " * Arrêter tout : docker-compose down" -ForegroundColor DarkGray -Write-Host " * Nettoyer : docker system prune -a -f --volumes" -ForegroundColor DarkGray -Write-Host "" -Write-Host "💡 CONSEIL :" -ForegroundColor Yellow -Write-Host " Testez avec : curl http://localhost:8000 ou dans PowerShell :" -ForegroundColor Gray -Write-Host " Invoke-WebRequest -Uri 'http://localhost:8000' -UseBasicParsing" -ForegroundColor DarkGray -Write-Host "" - -# Test automatique -try { - $test = Invoke-WebRequest -Uri "http://localhost:8000/health" -UseBasicParsing -TimeoutSec 5 - if ($test.StatusCode -eq 200) { - Write-Host "✅ Test de santé réussi !" -ForegroundColor Green - } -} catch { - Write-Host "⚠️ L'application n'est pas encore accessible, patientez..." -ForegroundColor Yellow -} -``` - -### 10.2 Script : scripts\\cleanup.ps1 (COMPLET) - -```powershell -# Nettoyage complet DevOps Stack -Write-Host "🧹 NETTOYAGE DEVOPS STACK" -ForegroundColor Yellow -Write-Host "==========================" -ForegroundColor Yellow -Write-Host "" - -# 1. Arrêter Docker Compose -Write-Host "[1/4] Arrêt Docker Compose..." -ForegroundColor Yellow -try { - if (Test-Path "..\docker\docker-compose.yml") { - Set-Location "..\docker" - docker-compose down -v # -v pour supprimer les volumes - Write-Host " ✅ Docker Compose arrêté" -ForegroundColor Green - Set-Location $PSScriptRoot - } -} catch { - Write-Host " ⚠️ Aucun service Docker Compose en cours" -ForegroundColor Gray -} - -# 2. Nettoyer Kubernetes -Write-Host "[2/4] Nettoyage Kubernetes..." -ForegroundColor Yellow -try { - # Supprimer le namespace (supprime tout à l'intérieur) - kubectl delete namespace devops-demo --ignore-not-found=true - kubectl delete namespace terraform-ns --ignore-not-found=true - - # Désinstaller Helm - helm uninstall devops-release --namespace devops-demo --ignore-not-found=true - - Write-Host " ✅ Kubernetes nettoyé" -ForegroundColor Green -} catch { - Write-Host " ⚠️ Kubernetes non configuré ou déjà nettoyé" -ForegroundColor Gray -} - -# 3. Nettoyer Docker -Write-Host "[3/4] Nettoyage Docker..." -ForegroundColor Yellow -try { - # Arrêter tous les conteneurs - docker stop $(docker ps -aq) 2>$null - - # Supprimer tous les conteneurs - docker rm $(docker ps -aq) 2>$null - - # Supprimer toutes les images - docker rmi $(docker images -q) -f 2>$null - - # Nettoyer le système - docker system prune -a -f --volumes - - Write-Host " ✅ Docker nettoyé" -ForegroundColor Green -} catch { - Write-Host " ℹ️ Aucune ressource Docker à nettoyer" -ForegroundColor Gray -} - -# 4. Nettoyer Terraform -Write-Host "[4/4] Nettoyage Terraform..." -ForegroundColor Yellow -try { - if (Test-Path "..\terraform") { - Set-Location "..\terraform" - - # Détruire l'infrastructure si terraform.tfstate existe - if (Test-Path "terraform.tfstate") { - terraform destroy -auto-approve 2>$null - } - - # Supprimer les fichiers temporaires - Remove-Item -Path "*.tfstate*", ".terraform*", "terraform.tfstate.backup" -Force -ErrorAction SilentlyContinue - - Write-Host " ✅ Terraform nettoyé" -ForegroundColor Green - Set-Location $PSScriptRoot - } -} catch { - Write-Host " ℹ️ Terraform non configuré" -ForegroundColor Gray -} - -Write-Host "" -Write-Host "========================================" -ForegroundColor Green -Write-Host " NETTOYAGE TERMINÉ !" -ForegroundColor Green -Write-Host "========================================" -ForegroundColor Green -Write-Host "" -Write-Host "✅ Toutes les ressources ont été nettoyées" -ForegroundColor Green -Write-Host "" -Write-Host "Pour recommencer :" -ForegroundColor Cyan -Write-Host " .\setup.ps1" -ForegroundColor Gray -``` - ---- - -## 🎯 VALIDATION FINALE - -### Testez votre installation : - -```powershell -# 1. Lancer le setup -cd C:\DevOpsProject\scripts -.\setup.ps1 - -# 2. Tester chaque service -# Application -curl http://localhost:8000 -# ou -Invoke-WebRequest -Uri "http://localhost:8000" -UseBasicParsing | Select-Object -ExpandProperty Content - -# Health check -curl http://localhost:8000/health - -# Métriques Prometheus -curl http://localhost:8000/metrics - -# 3. Vérifier Docker -docker ps -docker-compose ps - -# 4. Vérifier Kubernetes -kubectl get pods --all-namespaces -kubectl get svc -n devops-demo - -# 5. Accéder aux interfaces web -# Ouvrez votre navigateur et allez sur : -# - http://localhost:8000 (App) -# - http://localhost:8000/docs (Documentation API) -# - http://localhost:9090 (Prometheus) -# - http://localhost:3000 (Grafana - admin/admin123) -# - http://localhost:9000 (Portainer) -``` - -### Problèmes courants et solutions : - -| Problème | Solution | -|-------------------------------|-------------------------------------------------| -| WSL2 ne démarre pas | wsl --shutdown puis redémarrer Docker Desktop | -| Docker Desktop ne démarre pas | Vérifier Hyper-V dans "Fonctionnalités Windows" | -| Port déjà utilisé | \`netstat -ano | -| kubectl non reconnu | Réinstaller : choco install kubernetes-cli -y | -| Prometheus ne scrape pas | Vérifier docker\\prometheus.yml et les labels | -| Application inaccessible | Vérifier les logs : docker-compose logs app | - ---- - -## 📚 RÉCAPITULATIF DES CORRECTIONS APPORTÉES - -### ✅ Corrections majeures : - -1. Python : Ajout de Response dans les imports FastAPI -2. Docker Compose : Chemins corrigés, versions spécifiées -3. Kubernetes : Changé LoadBalancer → NodePort pour Windows -4. Image Docker : Tag :local au lieu de :latest pour K8s -5. Terraform : Suppression du provider Docker problématique -6. Scripts : Ajout de gestion d'erreurs robuste -7. Tests : Ajout de tests unitaires Python -8. Health checks : Ajout dans Docker Compose et K8s - -### 🎯 Améliorations : - -- Structure de projet logique et organisée -- Scripts PowerShell avec paramètres et gestion d'erreurs -- Configuration monitoring fonctionnelle -- Documentation claire étape par étape -- Solutions de dépannage incluses -- Versionning spécifique des images Docker - -### 🚀 Pour aller plus loin : - -1. Ajouter une base de données (PostgreSQL/MySQL) -2. Configurer HTTPS avec un reverse proxy -3. Implémenter un vrai pipeline CI/CD avec déploiement automatique -4. Ajouter du logging centralisé (ELK Stack) -5. Configurer des alertes Prometheus -6. Mettre en place du GitOps avec ArgoCD - -Votre stack DevOps Windows est maintenant fonctionnelle et prête à l'emploi ! 🎉 \ No newline at end of file diff --git a/docker/prometheus.yml b/config/prometheus.yml similarity index 95% rename from docker/prometheus.yml rename to config/prometheus.yml index 881090c..6fd1ad1 100644 --- a/docker/prometheus.yml +++ b/config/prometheus.yml @@ -1,41 +1,41 @@ -global: - scrape_interval: 15s - evaluation_interval: 15s - external_labels: - cluster: 'windows-devops' - environment: 'development' - -# Règles d'alerte -rule_files: - # - "alerts.yml" - -# Configuration de scraping -scrape_configs: - # Scraper l'application FastAPI - - job_name: 'fastapi-app' - static_configs: - - targets: ['app:8000'] - labels: - app: 'devops-app' - component: 'backend' - tier: 'application' - - # Scraper Prometheus lui-même - - job_name: 'prometheus' - static_configs: - - targets: ['localhost:9090'] - labels: - component: 'monitoring' - - # Découverte de service Docker - - job_name: 'docker' - static_configs: - - targets: ['host.docker.internal:9323'] - metrics_path: /metrics - scheme: http - -# Alerting (exemple) -# alerting: -# alertmanagers: -# - static_configs: -# - targets: [] +global: + scrape_interval: 15s + evaluation_interval: 15s + external_labels: + cluster: 'windows-devops' + environment: 'development' + +# Règles d'alerte +rule_files: + # - "alerts.yml" + +# Configuration de scraping +scrape_configs: + # Scraper l'application FastAPI + - job_name: 'fastapi-app' + static_configs: + - targets: ['app:8000'] + labels: + app: 'devops-app' + component: 'backend' + tier: 'application' + + # Scraper Prometheus lui-même + - job_name: 'prometheus' + static_configs: + - targets: ['localhost:9090'] + labels: + component: 'monitoring' + + # Découverte de service Docker + - job_name: 'docker' + static_configs: + - targets: ['host.docker.internal:9323'] + metrics_path: /metrics + scheme: http + +# Alerting (exemple) +# alerting: +# alertmanagers: +# - static_configs: +# - targets: [] diff --git a/docker/cd b/docker/cd new file mode 100644 index 0000000..e69de29 diff --git a/docker/docker-compose b/docker/docker-compose new file mode 100644 index 0000000..e69de29 diff --git a/docker/docker-compose-db.yml b/docker/docker-compose-db.yml index 53a2545..a2159dd 100644 --- a/docker/docker-compose-db.yml +++ b/docker/docker-compose-db.yml @@ -1,32 +1,39 @@ -services: - db: - image: postgres:15-alpine - container_name: devops-db - restart: unless-stopped - environment: - POSTGRES_DB: devopsdb - POSTGRES_USER: devopsuser - POSTGRES_PASSWORD: devopspass - volumes: - - db-data:/var/lib/postgresql/data - - ./init:/docker-entrypoint-initdb.d - ports: - - "5432:5432" - healthcheck: - test: ["CMD-SHELL", "pg_isready -U devopsuser -d devopsdb"] - interval: 10s - timeout: 5s - retries: 5 - networks: - - devops-network - labels: - - "com.devops.description=PostgreSQL Database" - - "com.devops.type=database" - -volumes: - db-data: - driver: local - -networks: - devops-network: +x-logging: &default-logging + driver: fluentd + options: + fluentd-address: localhost:24224 + tag: devops.* + +services: + db: + image: postgres:15-alpine + container_name: devops-db + restart: unless-stopped + environment: + POSTGRES_DB: devopsdb + POSTGRES_USER: devopsuser + POSTGRES_PASSWORD: devopspass + volumes: + - db-data:/var/lib/postgresql/data + - ./postgresql:/docker-entrypoint-initdb.d + ports: + - "5432:5432" + healthcheck: + test: ["CMD-SHELL", "pg_isready -U devopsuser -d devopsdb"] + interval: 10s + timeout: 5s + retries: 5 + networks: + - devops-network + labels: + - "com.devops.description=PostgreSQL Database" + - "com.devops.type=database" + logging: *default-logging + +volumes: + db-data: + driver: local + +networks: + devops-network: external: true \ No newline at end of file diff --git a/docker/docker-compose-elk.yml b/docker/docker-compose-elk.yml new file mode 100644 index 0000000..7fdf937 --- /dev/null +++ b/docker/docker-compose-elk.yml @@ -0,0 +1,69 @@ +services: + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:8.17.0 + container_name: elasticsearch + environment: + - node.name=elasticsearch + - discovery.type=single-node + - bootstrap.memory_lock=true + - xpack.security.enabled=false + ulimits: + memlock: + soft: -1 + hard: -1 + volumes: + - elasticsearch-data:/usr/share/elasticsearch/data + ports: + - "9200:9200" + networks: + - elk + + kibana: + image: docker.elastic.co/kibana/kibana:8.17.0 + container_name: kibana + environment: + - SERVER_HOST=0.0.0.0 + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 + ports: + - "5601:5601" + networks: + - elk + depends_on: + - elasticsearch + + logstash: + image: docker.elastic.co/logstash/logstash:8.17.0 + container_name: logstash + environment: + - LS_JAVA_OPTS=-Xms512m -Xmx512m + volumes: + - /mnt/c/DevOpsProject/monitoring/elklogs/logstash/config:/usr/share/logstash/pipeline:ro + - /mnt/c/DevOpsProject/monitoring/elklogs/logstash/config/jvm.options:/usr/share/logstash/config/jvm.options:ro + ports: + - "5044:5044" + networks: + - elk + depends_on: + - elasticsearch + + filebeat: + image: docker.elastic.co/beats/filebeat:8.17.0 + container_name: filebeat + user: root + command: filebeat -e --strict.perms=false + volumes: + - /var/lib/docker/containers:/var/lib/docker/containers:ro + - /var/run/docker.sock:/var/run/docker.sock:ro + - ../monitoring/elklogs/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro + networks: + - elk + depends_on: + - elasticsearch + +volumes: + elasticsearch-data: + driver: local + +networks: + elk: + driver: bridge \ No newline at end of file diff --git a/docker/docker-compose-gitea.yml b/docker/docker-compose-gitea.yml new file mode 100644 index 0000000..7696b6a --- /dev/null +++ b/docker/docker-compose-gitea.yml @@ -0,0 +1,25 @@ +x-logging: &default-logging + driver: fluentd + options: + fluentd-address: localhost:24224 + tag: devops.* + +services: + gitea: + image: gitea/gitea:latest + container_name: gitea + ports: + - "3001:3000" + - "2222:22" + volumes: + - ../gitea/gitea-data:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + restart: unless-stopped + networks: + - devops-network + logging: *default-logging + +networks: + devops-network: + external: true \ No newline at end of file diff --git a/docker/docker-compose-nginx.yml b/docker/docker-compose-nginx.yml index afc2e54..7cfd89b 100644 --- a/docker/docker-compose-nginx.yml +++ b/docker/docker-compose-nginx.yml @@ -1,19 +1,25 @@ -services: - nginx: - image: nginx:latest - restart: unless-stopped - ports: - - "80:80" - - "443:443" - volumes: - - C:\DevOpsProject\kubernetes\manifests\nginx\nginx.conf:/etc/nginx/nginx.conf:ro - - C:\DevOpsProject\kubernetes\manifests\nginx\certs:/etc/nginx/certs:ro - depends_on: - - app - networks: - - devops-network - command: nginx -g "daemon off;" - -networks: - devops-network: - external: true \ No newline at end of file +x-logging: &default-logging + driver: fluentd + options: + fluentd-address: localhost:24224 + tag: devops.* + +services: + nginx: + image: nginx:latest + restart: unless-stopped + ports: + - "80:80" + - "443:443" + volumes: + - C:\DevOpsProject\kubernetes\manifests\nginx\nginx.conf:/etc/nginx/nginx.conf:ro + - C:\DevOpsProject\kubernetes\manifests\nginx\certs:/etc/nginx/certs:ro + + networks: + - devops-network + command: nginx -g "daemon off;" + logging: *default-logging + +networks: + devops-network: + external: true \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 89c7718..c583741 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,113 +1,112 @@ -services: - # Application principale - app: - build: - context: .. - dockerfile: src/app/Dockerfile - container_name: devops-app - ports: - - "8000:8000" - environment: - - ENV=development - - HOSTNAME=devops-local - volumes: - - ../src/app:/app - - app-logs:/app/logs - networks: - - devops-network - restart: unless-stopped - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8000/health"] - interval: 30s - timeout: 10s - retries: 3 - start_period: 40s - labels: - - "com.devops.description=Application FastAPI" - - "prometheus.scrape=true" - - "prometheus.port=8000" - - "prometheus.path=/metrics" - - # Prometheus pour le monitoring - prometheus: - image: prom/prometheus:v2.47.2 - container_name: devops-prometheus - ports: - - "9090:9090" - volumes: - - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - - prometheus-data:/prometheus - command: - - '--config.file=/etc/prometheus/prometheus.yml' - - '--storage.tsdb.path=/prometheus' - - '--web.console.libraries=/etc/prometheus/console_libraries' - - '--web.console.templates=/etc/prometheus/consoles' - - '--storage.tsdb.retention.time=200h' - - '--web.enable-lifecycle' - networks: - - devops-network - restart: unless-stopped - depends_on: - - app - - # Grafana pour les dashboards - grafana: - image: grafana/grafana:10.2.0 - container_name: devops-grafana - ports: - - "3000:3000" - environment: - - GF_SECURITY_ADMIN_PASSWORD=admin123 - - GF_SECURITY_ADMIN_USER=admin - - GF_INSTALL_PLUGINS=grafana-piechart-panel,grafana-clock-panel - - GF_USERS_ALLOW_SIGN_UP=false - - GF_SERVER_DOMAIN=localhost - - TZ=Europe/Paris - volumes: - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - - grafana-data:/var/lib/grafana - - ./grafana-dashboards:/etc/grafana/provisioning/dashboards - - ./grafana-datasources:/etc/grafana/provisioning/datasources - networks: - - devops-network - restart: unless-stopped - depends_on: - - prometheus - - # Portainer pour gérer Docker - portainer: - image: portainer/portainer-ce:latest - container_name: devops-portainer - ports: - - "9000:9000" - - "9443:9443" - volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro - - portainer-data:/data - networks: - - devops-network - restart: unless-stopped - command: -H unix:///var/run/docker.sock - - # Inclusion du service Nginx à partir du fichier docker-compose-nginx.yml - nginx: - depends_on: - - app - networks: - - devops-network - -networks: - devops-network: - driver: bridge - name: devops-network - -volumes: - prometheus-data: - name: prometheus-data - grafana-data: - name: grafana-data - portainer-data: - name: portainer-data - app-logs: - name: app-logs \ No newline at end of file +x-logging: &default-logging + driver: fluentd + options: + fluentd-address: localhost:24224 + tag: devops.* + +services: + app: + build: + context: .. + dockerfile: src/app/Dockerfile + container_name: devops-app + ports: + - "8000:8000" + environment: + - ENV=development + - HOSTNAME=devops-local + volumes: + - ../src/app:/app + - app-logs:/app/logs + networks: + - devops-network + restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + labels: + - "com.devops.description=Application FastAPI" + - "prometheus.scrape=true" + - "prometheus.port=8000" + - "prometheus.path=/metrics" + logging: *default-logging + + prometheus: + image: prom/prometheus:v2.47.2 + container_name: devops-prometheus + ports: + - "9090:9090" + volumes: + - ../config/prometheus.yml:/etc/prometheus/prometheus.yml:ro + - prometheus-data:/prometheus + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.path=/prometheus' + - '--web.console.libraries=/etc/prometheus/console_libraries' + - '--web.console.templates=/etc/prometheus/consoles' + - '--storage.tsdb.retention.time=200h' + - '--web.enable-lifecycle' + networks: + - devops-network + restart: unless-stopped + depends_on: + - app + logging: *default-logging + + grafana: + image: grafana/grafana:10.2.0 + container_name: devops-grafana + ports: + - "3000:3000" + environment: + - GF_SECURITY_ADMIN_PASSWORD=admin123 + - GF_SECURITY_ADMIN_USER=admin + - GF_INSTALL_PLUGINS=grafana-piechart-panel,grafana-clock-panel + - GF_USERS_ALLOW_SIGN_UP=false + - GF_SERVER_DOMAIN=localhost + - TZ=Europe/Paris + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - grafana-data:/var/lib/grafana + - ../monitoring/grafana-dashboards:/etc/grafana/provisioning/dashboards + - ../monitoring/grafana-datasources:/etc/grafana/provisioning/datasources + networks: + - devops-network + restart: unless-stopped + depends_on: + - prometheus + logging: *default-logging + + portainer: + image: portainer/portainer-ce:latest + container_name: devops-portainer + ports: + - "9000:9000" + - "9443:9443" + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - portainer-data:/data + networks: + - devops-network + restart: unless-stopped + command: -H unix:///var/run/docker.sock + logging: *default-logging + +networks: + devops-network: + driver: bridge + name: devops-network + +volumes: + prometheus-data: + name: prometheus-data + grafana-data: + name: grafana-data + portainer-data: + name: portainer-data + app-logs: + name: app-logs \ No newline at end of file diff --git a/gitea/gitea-data/git/.ssh/authorized_keys b/gitea/gitea-data/git/.ssh/authorized_keys new file mode 100644 index 0000000..e69de29 diff --git a/gitea/gitea-data/git/.ssh/environment b/gitea/gitea-data/git/.ssh/environment new file mode 100644 index 0000000..f86169b --- /dev/null +++ b/gitea/gitea-data/git/.ssh/environment @@ -0,0 +1 @@ +GITEA_CUSTOM=/data/gitea diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/HEAD b/gitea/gitea-data/git/repositories/oualim/devops-config.git/HEAD new file mode 100644 index 0000000..b870d82 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/main diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/config b/gitea/gitea-data/git/repositories/oualim/devops-config.git/config new file mode 100644 index 0000000..47fb1f0 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/config @@ -0,0 +1,5 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = true + ignorecase = true diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/description b/gitea/gitea-data/git/repositories/oualim/devops-config.git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/applypatch-msg.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/applypatch-msg.sample new file mode 100644 index 0000000..a5d7b84 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/commit-msg.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/commit-msg.sample new file mode 100644 index 0000000..b58d118 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/post-receive b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/post-receive new file mode 100644 index 0000000..80ae570 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/post-receive @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +data=$(cat) +exitcodes="" +hookname=$(basename $0) +GIT_DIR=${GIT_DIR:-$(dirname $0)/..} + +for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do + test -x "${hook}" && test -f "${hook}" || continue + echo "${data}" | "${hook}" + exitcodes="${exitcodes} $?" +done + +for i in ${exitcodes}; do + [ ${i} -eq 0 ] || exit ${i} +done diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/post-receive.d/gitea b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/post-receive.d/gitea new file mode 100644 index 0000000..2a84d52 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/post-receive.d/gitea @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +/usr/local/bin/gitea hook --config=/data/gitea/conf/app.ini post-receive diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/post-update.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/post-update.sample new file mode 100644 index 0000000..ec17ec1 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-applypatch.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-applypatch.sample new file mode 100644 index 0000000..4142082 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-commit.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-commit.sample new file mode 100644 index 0000000..29ed5ee --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff-index --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-merge-commit.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-merge-commit.sample new file mode 100644 index 0000000..399eab1 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-push.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-push.sample new file mode 100644 index 0000000..4ce688d --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-rebase.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-rebase.sample new file mode 100644 index 0000000..6cbef5c --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-receive b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-receive new file mode 100644 index 0000000..80ae570 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-receive @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +data=$(cat) +exitcodes="" +hookname=$(basename $0) +GIT_DIR=${GIT_DIR:-$(dirname $0)/..} + +for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do + test -x "${hook}" && test -f "${hook}" || continue + echo "${data}" | "${hook}" + exitcodes="${exitcodes} $?" +done + +for i in ${exitcodes}; do + [ ${i} -eq 0 ] || exit ${i} +done diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-receive.d/gitea b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-receive.d/gitea new file mode 100644 index 0000000..00db788 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-receive.d/gitea @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +/usr/local/bin/gitea hook --config=/data/gitea/conf/app.ini pre-receive diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-receive.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-receive.sample new file mode 100644 index 0000000..a1fd29e --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/prepare-commit-msg.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/prepare-commit-msg.sample new file mode 100644 index 0000000..10fa14c --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/proc-receive b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/proc-receive new file mode 100644 index 0000000..1974627 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/proc-receive @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +/usr/local/bin/gitea hook --config=/data/gitea/conf/app.ini proc-receive diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/proc-receive.d/gitea b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/proc-receive.d/gitea new file mode 100644 index 0000000..e69de29 diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/push-to-checkout.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/push-to-checkout.sample new file mode 100644 index 0000000..af5a0c0 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + exit 1 +} + +unset GIT_DIR GIT_WORK_TREE +cd "$worktree" && + +if grep -q "^diff --git " "$1" +then + validate_patch "$1" +else + validate_cover_letter "$1" +fi && + +if test "$GIT_SENDEMAIL_FILE_COUNTER" = "$GIT_SENDEMAIL_FILE_TOTAL" +then + git config --unset-all sendemail.validateWorktree && + trap 'git worktree remove -ff "$worktree"' EXIT && + validate_series +fi diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/update b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/update new file mode 100644 index 0000000..b3570b0 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/update @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +exitcodes="" +hookname=$(basename $0) +GIT_DIR=${GIT_DIR:-$(dirname $0/..)} + +for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do + test -x "${hook}" && test -f "${hook}" || continue + "${hook}" $1 $2 $3 + exitcodes="${exitcodes} $?" +done + +for i in ${exitcodes}; do + [ ${i} -eq 0 ] || exit ${i} +done diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/update.d/gitea b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/update.d/gitea new file mode 100644 index 0000000..3f58296 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/update.d/gitea @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +/usr/local/bin/gitea hook --config=/data/gitea/conf/app.ini update $1 $2 $3 diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/update.sample b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/update.sample new file mode 100644 index 0000000..c4d426b --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to block unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/info/exclude b/gitea/gitea-data/git/repositories/oualim/devops-config.git/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/info/refs b/gitea/gitea-data/git/repositories/oualim/devops-config.git/info/refs new file mode 100644 index 0000000..397fed8 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/info/refs @@ -0,0 +1 @@ +672be34cefad4bdba5ff5c71fe0842fc57cc5175 refs/heads/main diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/logs/HEAD b/gitea/gitea-data/git/repositories/oualim/devops-config.git/logs/HEAD new file mode 100644 index 0000000..fd66258 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/logs/HEAD @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 e89acde953a4d752fe27df7314be7c0957988d30 Gitea 1769439893 +0100 push +e89acde953a4d752fe27df7314be7c0957988d30 f6721936791d0189fa3843c8c703984878a3bd9b Gitea 1769440011 +0100 push +f6721936791d0189fa3843c8c703984878a3bd9b 672be34cefad4bdba5ff5c71fe0842fc57cc5175 Gitea 1769440373 +0100 push diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/logs/refs/heads/main b/gitea/gitea-data/git/repositories/oualim/devops-config.git/logs/refs/heads/main new file mode 100644 index 0000000..fd66258 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/logs/refs/heads/main @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 e89acde953a4d752fe27df7314be7c0957988d30 Gitea 1769439893 +0100 push +e89acde953a4d752fe27df7314be7c0957988d30 f6721936791d0189fa3843c8c703984878a3bd9b Gitea 1769440011 +0100 push +f6721936791d0189fa3843c8c703984878a3bd9b 672be34cefad4bdba5ff5c71fe0842fc57cc5175 Gitea 1769440373 +0100 push diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/0e/8a0eb36f4ca2c939201c0d54b5d82a1ea34778 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/0e/8a0eb36f4ca2c939201c0d54b5d82a1ea34778 new file mode 100644 index 0000000..f99109a --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/0e/8a0eb36f4ca2c939201c0d54b5d82a1ea34778 @@ -0,0 +1,4 @@ +xMO1N1+ +h +*Eyc/-wMxfvlcpxWT v=d3Ǫ +USΩ456QAh(0zyM 7>B J@$FtMG mzpTҞZws}wBB/{YߔaOZdAkm3lj2gzKńL +j9o]'`RfQki+zK]Dzj;*+]Phts`pU}eͷ~_ʝO*xe*4&l\4g&4Tv›#y&_3H.NcLҢETׅ?ʑP~V,ySKtsz-b$ҫ=m;Wmol \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/16/d1b1938be73be186aeb6a8be761eb80dbb2b22 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/16/d1b1938be73be186aeb6a8be761eb80dbb2b22 new file mode 100644 index 0000000..343c409 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/16/d1b1938be73be186aeb6a8be761eb80dbb2b22 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/19/38b19c5427476528148f00cbdef59a9f23f8c7 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/19/38b19c5427476528148f00cbdef59a9f23f8c7 new file mode 100644 index 0000000..0a337cd Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/19/38b19c5427476528148f00cbdef59a9f23f8c7 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/1b/0e46c0effaac1b2f38969e14ca1798f9c3eb9f b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/1b/0e46c0effaac1b2f38969e14ca1798f9c3eb9f new file mode 100644 index 0000000..4b86885 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/1b/0e46c0effaac1b2f38969e14ca1798f9c3eb9f differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/1d/ab1ac99da414f1a0e6159e05aa05c5e688f2ff b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/1d/ab1ac99da414f1a0e6159e05aa05c5e688f2ff new file mode 100644 index 0000000..5936d04 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/1d/ab1ac99da414f1a0e6159e05aa05c5e688f2ff differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/23/9324617ab2f236a2e026b460f6050d7b03cca0 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/23/9324617ab2f236a2e026b460f6050d7b03cca0 new file mode 100644 index 0000000..85269c6 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/23/9324617ab2f236a2e026b460f6050d7b03cca0 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/23/e3473ed2fbfb03103099272d6147be5e3bcd0f b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/23/e3473ed2fbfb03103099272d6147be5e3bcd0f new file mode 100644 index 0000000..efc3de9 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/23/e3473ed2fbfb03103099272d6147be5e3bcd0f differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/2b/9cb27de94eead8a525b0e9166f2534ff89c784 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/2b/9cb27de94eead8a525b0e9166f2534ff89c784 new file mode 100644 index 0000000..b3efcd8 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/2b/9cb27de94eead8a525b0e9166f2534ff89c784 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/2f/3782c968be19971778e76a741262e83df61844 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/2f/3782c968be19971778e76a741262e83df61844 new file mode 100644 index 0000000..0edf51b Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/2f/3782c968be19971778e76a741262e83df61844 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/2f/6c54feed68819f8629e721e4c26c81502fe5aa b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/2f/6c54feed68819f8629e721e4c26c81502fe5aa new file mode 100644 index 0000000..44d5fa5 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/2f/6c54feed68819f8629e721e4c26c81502fe5aa differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/33/c0133226ed2bd710582389e9db6ced52a60a52 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/33/c0133226ed2bd710582389e9db6ced52a60a52 new file mode 100644 index 0000000..3a5b7f5 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/33/c0133226ed2bd710582389e9db6ced52a60a52 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/36/0646acee158005fc59ca21f42bd3467aa89824 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/36/0646acee158005fc59ca21f42bd3467aa89824 new file mode 100644 index 0000000..29b63f2 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/36/0646acee158005fc59ca21f42bd3467aa89824 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/36/bfb84b4103f50f60b2abd9817014571a15d434 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/36/bfb84b4103f50f60b2abd9817014571a15d434 new file mode 100644 index 0000000..5c2500b Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/36/bfb84b4103f50f60b2abd9817014571a15d434 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/37/994e0598ca9e408fef459132fff53758b8ef48 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/37/994e0598ca9e408fef459132fff53758b8ef48 new file mode 100644 index 0000000..b4205a7 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/37/994e0598ca9e408fef459132fff53758b8ef48 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/3a/5c72cd3944dc143bd51d797c424fe9ef011744 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/3a/5c72cd3944dc143bd51d797c424fe9ef011744 new file mode 100644 index 0000000..94d6d7c Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/3a/5c72cd3944dc143bd51d797c424fe9ef011744 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/3f/8443fa9f78d8437f611e73d35e7d105f8ee95d b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/3f/8443fa9f78d8437f611e73d35e7d105f8ee95d new file mode 100644 index 0000000..d1ac4b8 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/3f/8443fa9f78d8437f611e73d35e7d105f8ee95d differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/40/4803b378b6dd55fbe67b620c9c8583e440738a b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/40/4803b378b6dd55fbe67b620c9c8583e440738a new file mode 100644 index 0000000..2581e5c Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/40/4803b378b6dd55fbe67b620c9c8583e440738a differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/42/3ceb373c370deeb128ab8cd9558309cd12e021 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/42/3ceb373c370deeb128ab8cd9558309cd12e021 new file mode 100644 index 0000000..165e8ab Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/42/3ceb373c370deeb128ab8cd9558309cd12e021 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/43/51b3249f31806ed87d15c0029828b152bc5e46 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/43/51b3249f31806ed87d15c0029828b152bc5e46 new file mode 100644 index 0000000..504c51e Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/43/51b3249f31806ed87d15c0029828b152bc5e46 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/47/7307817f2df6b33ef5bed76af84c42789481a4 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/47/7307817f2df6b33ef5bed76af84c42789481a4 new file mode 100644 index 0000000..58900e8 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/47/7307817f2df6b33ef5bed76af84c42789481a4 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/47/c72bec21dae0eafc637e36b8ba67ae4e4d6d8f b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/47/c72bec21dae0eafc637e36b8ba67ae4e4d6d8f new file mode 100644 index 0000000..547cfc4 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/47/c72bec21dae0eafc637e36b8ba67ae4e4d6d8f @@ -0,0 +1 @@ +xUM@ ])Vʄ )HI;s{.65(MA^BS_.灅X)54+g*Kޣ-|{R0VrSF̙lZNGmh㝂A柽EnIgN) \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/49/0a228dca0f865dc8e4e2fad54d8810dbae8798 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/49/0a228dca0f865dc8e4e2fad54d8810dbae8798 new file mode 100644 index 0000000..7d7b5e7 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/49/0a228dca0f865dc8e4e2fad54d8810dbae8798 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/49/15399ed2a75c0e990368fa3d53f947e54948b6 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/49/15399ed2a75c0e990368fa3d53f947e54948b6 new file mode 100644 index 0000000..c1f69a2 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/49/15399ed2a75c0e990368fa3d53f947e54948b6 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/56/f4d9d3f3a0d99b558a8604b7f38f83cb39a355 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/56/f4d9d3f3a0d99b558a8604b7f38f83cb39a355 new file mode 100644 index 0000000..45b5c5f Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/56/f4d9d3f3a0d99b558a8604b7f38f83cb39a355 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/5b/390a259fe5efb6671e25f2ae04297d7f36f38d b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/5b/390a259fe5efb6671e25f2ae04297d7f36f38d new file mode 100644 index 0000000..6d741e2 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/5b/390a259fe5efb6671e25f2ae04297d7f36f38d differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/5b/a73fd867c2a801c6f228c8929a68e9b69a66e5 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/5b/a73fd867c2a801c6f228c8929a68e9b69a66e5 new file mode 100644 index 0000000..c14b908 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/5b/a73fd867c2a801c6f228c8929a68e9b69a66e5 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/5d/c34056de49c015f50e3e41b5460d3f2b4ce41e b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/5d/c34056de49c015f50e3e41b5460d3f2b4ce41e new file mode 100644 index 0000000..1ea5a6c Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/5d/c34056de49c015f50e3e41b5460d3f2b4ce41e differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/66/371e0bf0baf877de28cabeac461ae3730c8fdb b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/66/371e0bf0baf877de28cabeac461ae3730c8fdb new file mode 100644 index 0000000..457f002 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/66/371e0bf0baf877de28cabeac461ae3730c8fdb differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/66/fd6bf47009b656e784b887188c16d86debf560 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/66/fd6bf47009b656e784b887188c16d86debf560 new file mode 100644 index 0000000..7cdbe98 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/66/fd6bf47009b656e784b887188c16d86debf560 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/67/2be34cefad4bdba5ff5c71fe0842fc57cc5175 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/67/2be34cefad4bdba5ff5c71fe0842fc57cc5175 new file mode 100644 index 0000000..4586f44 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/67/2be34cefad4bdba5ff5c71fe0842fc57cc5175 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6a/b8fa4a688029922994bb3deed1877a5b0570e7 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6a/b8fa4a688029922994bb3deed1877a5b0570e7 new file mode 100644 index 0000000..074ba27 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6a/b8fa4a688029922994bb3deed1877a5b0570e7 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6b/9e529f210c474d46c7c951c02798facd1eaa91 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6b/9e529f210c474d46c7c951c02798facd1eaa91 new file mode 100644 index 0000000..f51b618 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6b/9e529f210c474d46c7c951c02798facd1eaa91 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6c/50e5c63daa42c6578ab12fa6e969d28749075b b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6c/50e5c63daa42c6578ab12fa6e969d28749075b new file mode 100644 index 0000000..21482a5 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6c/50e5c63daa42c6578ab12fa6e969d28749075b differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6c/8696b8fcc2bd36b0c9424274a02075c91e77d7 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6c/8696b8fcc2bd36b0c9424274a02075c91e77d7 new file mode 100644 index 0000000..f99908c --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6c/8696b8fcc2bd36b0c9424274a02075c91e77d7 @@ -0,0 +1,2 @@ +xUn0D9+fG*IjqrU7 V3;o53iNf왑on: H \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6e/11283ecd9800777a6d9c0591e9468a4c0e1793 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6e/11283ecd9800777a6d9c0591e9468a4c0e1793 new file mode 100644 index 0000000..8622363 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6e/11283ecd9800777a6d9c0591e9468a4c0e1793 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6f/d1ad1258e0f12d59a0fb35347ebbe185bfe2f8 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6f/d1ad1258e0f12d59a0fb35347ebbe185bfe2f8 new file mode 100644 index 0000000..0343151 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/6f/d1ad1258e0f12d59a0fb35347ebbe185bfe2f8 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/74/1cd5336b2321a0697cfbfbb300c8b342d39302 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/74/1cd5336b2321a0697cfbfbb300c8b342d39302 new file mode 100644 index 0000000..cfeb528 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/74/1cd5336b2321a0697cfbfbb300c8b342d39302 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/78/9269c262f09c1c74c5c4eb24f69b56248c6fde b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/78/9269c262f09c1c74c5c4eb24f69b56248c6fde new file mode 100644 index 0000000..84e8c17 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/78/9269c262f09c1c74c5c4eb24f69b56248c6fde differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/78/9a547df3c468b0bc2fe7e47db8f4dec85ac985 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/78/9a547df3c468b0bc2fe7e47db8f4dec85ac985 new file mode 100644 index 0000000..732c905 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/78/9a547df3c468b0bc2fe7e47db8f4dec85ac985 @@ -0,0 +1,4 @@ +xTˎ0e. +-Bu7;un3m萿<y^d^`9&ݑ.+z>R;ݩ&=}fӸC8:ΜjCVNLlrǑتJP{֜vSW>'RqZ{kYu-eU ܩL3]PI!㲧d Kug.P!|7I$n5ـ +F is_5=tbE +"/箐w \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a3/730e1af166a399c6bd9bccedb18a6ddba00c32 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a3/730e1af166a399c6bd9bccedb18a6ddba00c32 new file mode 100644 index 0000000..295a9c8 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a3/730e1af166a399c6bd9bccedb18a6ddba00c32 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a4/b360fb1c80c2d412a6cb634e937596f60e9a58 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a4/b360fb1c80c2d412a6cb634e937596f60e9a58 new file mode 100644 index 0000000..dcefa65 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a4/b360fb1c80c2d412a6cb634e937596f60e9a58 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a4/d7ab439340dd3020eca8c38822289cf8648908 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a4/d7ab439340dd3020eca8c38822289cf8648908 new file mode 100644 index 0000000..35dd27f Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a4/d7ab439340dd3020eca8c38822289cf8648908 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a5/c0f03c70432e9e170d4547a224df8a499e3263 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a5/c0f03c70432e9e170d4547a224df8a499e3263 new file mode 100644 index 0000000..e63d217 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a5/c0f03c70432e9e170d4547a224df8a499e3263 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a8/606200c9180882ff0a64f1421acb05702c0494 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a8/606200c9180882ff0a64f1421acb05702c0494 new file mode 100644 index 0000000..7e2b7d8 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/a8/606200c9180882ff0a64f1421acb05702c0494 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ae/770a515aee99a25869066c27732b2d7575a730 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ae/770a515aee99a25869066c27732b2d7575a730 new file mode 100644 index 0000000..e6c390f --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ae/770a515aee99a25869066c27732b2d7575a730 @@ -0,0 +1 @@ +xm1 yE>`%r#$ 0_Yԓ=%^-8? \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/e9/d1447f87df8c2b2b70e33e67cac7543488c02b b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/e9/d1447f87df8c2b2b70e33e67cac7543488c02b new file mode 100644 index 0000000..dedd5f8 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/e9/d1447f87df8c2b2b70e33e67cac7543488c02b differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/e9/e1861ce9753526852358e6aeeba8c7b20aeb3d b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/e9/e1861ce9753526852358e6aeeba8c7b20aeb3d new file mode 100644 index 0000000..02f57f0 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/e9/e1861ce9753526852358e6aeeba8c7b20aeb3d @@ -0,0 +1 @@ +xQN0䜯C) jn'nlITK(ޝ[my-pHR;kQYiqS..j HG䙆=Z^&j`VvS¬ByD䄯{d/ 0:}Y3`6I|i',>^k9CSoZr50k  \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ec/57bef857e62dfbb0a371320910b77cbc950a5a b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ec/57bef857e62dfbb0a371320910b77cbc950a5a new file mode 100644 index 0000000..2cbbb97 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ec/57bef857e62dfbb0a371320910b77cbc950a5a differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ed/33e7242aec3d126b99822403998b6667ba2f91 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ed/33e7242aec3d126b99822403998b6667ba2f91 new file mode 100644 index 0000000..9fb03cd --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ed/33e7242aec3d126b99822403998b6667ba2f91 @@ -0,0 +1,2 @@ +xU +0 EWߝ 3#jږ4>u=In[߃z>.x5E]LF8.J[tBQ24pe3s$rՇ|J!vh5/nnR \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/f1/32ecb2808af5293c61254fbe1bc8af327afe2e b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/f1/32ecb2808af5293c61254fbe1bc8af327afe2e new file mode 100644 index 0000000..f890b14 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/f1/32ecb2808af5293c61254fbe1bc8af327afe2e differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/f6/721936791d0189fa3843c8c703984878a3bd9b b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/f6/721936791d0189fa3843c8c703984878a3bd9b new file mode 100644 index 0000000..a496f4c --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/f6/721936791d0189fa3843c8c703984878a3bd9b @@ -0,0 +1,3 @@ +xM +0F] %?M'"+Wn4@HHo>x_(9&ѧV%+r +C_#A{ȢsكPIB gztwyЖ;nk 0hYiD`?Ri]{y/jE \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/f8/6169bdabcfb05b89672326c31385073dd83b72 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/f8/6169bdabcfb05b89672326c31385073dd83b72 new file mode 100644 index 0000000..1378ed5 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/f8/6169bdabcfb05b89672326c31385073dd83b72 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/fe/da7d6b2481efc683caa30e9d8dfc8553b524a9 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/fe/da7d6b2481efc683caa30e9d8dfc8553b524a9 new file mode 100644 index 0000000..5350363 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/fe/da7d6b2481efc683caa30e9d8dfc8553b524a9 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ff/50dacdf22485a40950809f8ce27a3b326cccf3 b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ff/50dacdf22485a40950809f8ce27a3b326cccf3 new file mode 100644 index 0000000..fa91f43 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ff/50dacdf22485a40950809f8ce27a3b326cccf3 differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ff/7c98a0e92af969989ba9ab4ba3fee9b29597cf b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ff/7c98a0e92af969989ba9ab4ba3fee9b29597cf new file mode 100644 index 0000000..27183eb Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/ff/7c98a0e92af969989ba9ab4ba3fee9b29597cf differ diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/info/packs b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/info/packs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/objects/info/packs @@ -0,0 +1 @@ + diff --git a/gitea/gitea-data/git/repositories/oualim/devops-config.git/refs/heads/main b/gitea/gitea-data/git/repositories/oualim/devops-config.git/refs/heads/main new file mode 100644 index 0000000..67bd654 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/devops-config.git/refs/heads/main @@ -0,0 +1 @@ +672be34cefad4bdba5ff5c71fe0842fc57cc5175 diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/HEAD b/gitea/gitea-data/git/repositories/oualim/test.git/HEAD new file mode 100644 index 0000000..b870d82 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/main diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/config b/gitea/gitea-data/git/repositories/oualim/test.git/config new file mode 100644 index 0000000..47fb1f0 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/config @@ -0,0 +1,5 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = true + ignorecase = true diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/description b/gitea/gitea-data/git/repositories/oualim/test.git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/git-daemon-export-ok b/gitea/gitea-data/git/repositories/oualim/test.git/git-daemon-export-ok new file mode 100644 index 0000000..e69de29 diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/applypatch-msg.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/applypatch-msg.sample new file mode 100644 index 0000000..a5d7b84 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/commit-msg.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/commit-msg.sample new file mode 100644 index 0000000..b58d118 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/post-receive b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/post-receive new file mode 100644 index 0000000..80ae570 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/post-receive @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +data=$(cat) +exitcodes="" +hookname=$(basename $0) +GIT_DIR=${GIT_DIR:-$(dirname $0)/..} + +for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do + test -x "${hook}" && test -f "${hook}" || continue + echo "${data}" | "${hook}" + exitcodes="${exitcodes} $?" +done + +for i in ${exitcodes}; do + [ ${i} -eq 0 ] || exit ${i} +done diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/post-receive.d/gitea b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/post-receive.d/gitea new file mode 100644 index 0000000..2a84d52 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/post-receive.d/gitea @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +/usr/local/bin/gitea hook --config=/data/gitea/conf/app.ini post-receive diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/post-update.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/post-update.sample new file mode 100644 index 0000000..ec17ec1 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-applypatch.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-applypatch.sample new file mode 100644 index 0000000..4142082 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-commit.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-commit.sample new file mode 100644 index 0000000..29ed5ee --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff-index --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-merge-commit.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-merge-commit.sample new file mode 100644 index 0000000..399eab1 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-push.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-push.sample new file mode 100644 index 0000000..4ce688d --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-rebase.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-rebase.sample new file mode 100644 index 0000000..6cbef5c --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-receive b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-receive new file mode 100644 index 0000000..80ae570 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-receive @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +data=$(cat) +exitcodes="" +hookname=$(basename $0) +GIT_DIR=${GIT_DIR:-$(dirname $0)/..} + +for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do + test -x "${hook}" && test -f "${hook}" || continue + echo "${data}" | "${hook}" + exitcodes="${exitcodes} $?" +done + +for i in ${exitcodes}; do + [ ${i} -eq 0 ] || exit ${i} +done diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-receive.d/gitea b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-receive.d/gitea new file mode 100644 index 0000000..00db788 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-receive.d/gitea @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +/usr/local/bin/gitea hook --config=/data/gitea/conf/app.ini pre-receive diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-receive.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-receive.sample new file mode 100644 index 0000000..a1fd29e --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/prepare-commit-msg.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/prepare-commit-msg.sample new file mode 100644 index 0000000..10fa14c --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/proc-receive b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/proc-receive new file mode 100644 index 0000000..1974627 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/proc-receive @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +/usr/local/bin/gitea hook --config=/data/gitea/conf/app.ini proc-receive diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/proc-receive.d/gitea b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/proc-receive.d/gitea new file mode 100644 index 0000000..e69de29 diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/push-to-checkout.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/push-to-checkout.sample new file mode 100644 index 0000000..af5a0c0 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + exit 1 +} + +unset GIT_DIR GIT_WORK_TREE +cd "$worktree" && + +if grep -q "^diff --git " "$1" +then + validate_patch "$1" +else + validate_cover_letter "$1" +fi && + +if test "$GIT_SENDEMAIL_FILE_COUNTER" = "$GIT_SENDEMAIL_FILE_TOTAL" +then + git config --unset-all sendemail.validateWorktree && + trap 'git worktree remove -ff "$worktree"' EXIT && + validate_series +fi diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/update b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/update new file mode 100644 index 0000000..b3570b0 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/update @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +exitcodes="" +hookname=$(basename $0) +GIT_DIR=${GIT_DIR:-$(dirname $0/..)} + +for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do + test -x "${hook}" && test -f "${hook}" || continue + "${hook}" $1 $2 $3 + exitcodes="${exitcodes} $?" +done + +for i in ${exitcodes}; do + [ ${i} -eq 0 ] || exit ${i} +done diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/update.d/gitea b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/update.d/gitea new file mode 100644 index 0000000..3f58296 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/update.d/gitea @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# AUTO GENERATED BY GITEA, DO NOT MODIFY +/usr/local/bin/gitea hook --config=/data/gitea/conf/app.ini update $1 $2 $3 diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/hooks/update.sample b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/update.sample new file mode 100644 index 0000000..c4d426b --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to block unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/info/exclude b/gitea/gitea-data/git/repositories/oualim/test.git/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/info/refs b/gitea/gitea-data/git/repositories/oualim/test.git/info/refs new file mode 100644 index 0000000..fae50c1 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/info/refs @@ -0,0 +1 @@ +9267f814310e96b2e1cd5c8d59075346fed85b89 refs/heads/main diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/logs/HEAD b/gitea/gitea-data/git/repositories/oualim/test.git/logs/HEAD new file mode 100644 index 0000000..52bfe54 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/logs/HEAD @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 098af2e648f58aa67c135a8cb15e503b46945887 Gitea 1769432205 +0100 +098af2e648f58aa67c135a8cb15e503b46945887 9267f814310e96b2e1cd5c8d59075346fed85b89 Gitea 1769433159 +0100 push diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/logs/refs/heads/main b/gitea/gitea-data/git/repositories/oualim/test.git/logs/refs/heads/main new file mode 100644 index 0000000..795bf45 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/logs/refs/heads/main @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 098af2e648f58aa67c135a8cb15e503b46945887 Oualim 1769432204 +0100 push +098af2e648f58aa67c135a8cb15e503b46945887 9267f814310e96b2e1cd5c8d59075346fed85b89 Gitea 1769433159 +0100 push diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/01/0980907c092602a5b75cae614a35b9332feb22 b/gitea/gitea-data/git/repositories/oualim/test.git/objects/01/0980907c092602a5b75cae614a35b9332feb22 new file mode 100644 index 0000000..e1dd2a7 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/objects/01/0980907c092602a5b75cae614a35b9332feb22 @@ -0,0 +1,3 @@ +xA + =B5J)tU7TsJՃ>xZ,MJQ)s0ƧMɄ5i4qL,B(N$ hAk.R;lK-:ZR9GEy zAk! +F5 \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/03/7328de8cd4341d66128dd64ca4b9f26f8965e7 b/gitea/gitea-data/git/repositories/oualim/test.git/objects/03/7328de8cd4341d66128dd64ca4b9f26f8965e7 new file mode 100644 index 0000000..7d54b0c Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/03/7328de8cd4341d66128dd64ca4b9f26f8965e7 differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/09/8af2e648f58aa67c135a8cb15e503b46945887 b/gitea/gitea-data/git/repositories/oualim/test.git/objects/09/8af2e648f58aa67c135a8cb15e503b46945887 new file mode 100644 index 0000000..b4d388e --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/objects/09/8af2e648f58aa67c135a8cb15e503b46945887 @@ -0,0 +1,2 @@ +xA + E qcnF@+ ཟZ5F,\ZgKa9<yb@G]?^KT*:V#gƨAaI^>69Q \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/2b/a56ae963f530cb3d3b95ebc96ce939ff30dbff b/gitea/gitea-data/git/repositories/oualim/test.git/objects/2b/a56ae963f530cb3d3b95ebc96ce939ff30dbff new file mode 100644 index 0000000..67fd476 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/objects/2b/a56ae963f530cb3d3b95ebc96ce939ff30dbff @@ -0,0 +1,2 @@ +xM0D#F#@r]m;㍲^w ծ̺* |q +#Ő8*C]SW 4I[uf\(@2rxϬ%HeTH ρ]7/}X p!c@~`4_<7}~xMCdJ[ \ No newline at end of file diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/30/6cbfe4e0f722452607350ac2b7f173004c9a59 b/gitea/gitea-data/git/repositories/oualim/test.git/objects/30/6cbfe4e0f722452607350ac2b7f173004c9a59 new file mode 100644 index 0000000..3f42811 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/30/6cbfe4e0f722452607350ac2b7f173004c9a59 differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/33/b672771cf44c98108b56bffa35a8d4a1767a13 b/gitea/gitea-data/git/repositories/oualim/test.git/objects/33/b672771cf44c98108b56bffa35a8d4a1767a13 new file mode 100644 index 0000000..7354a5e Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/33/b672771cf44c98108b56bffa35a8d4a1767a13 differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/3d/0adc9241190fb35539dc79602aeed3bf506f85 b/gitea/gitea-data/git/repositories/oualim/test.git/objects/3d/0adc9241190fb35539dc79602aeed3bf506f85 new file mode 100644 index 0000000..1493934 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/3d/0adc9241190fb35539dc79602aeed3bf506f85 differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/67/acd4e9b17ecda765ba55660d01ed8e513bfb9b b/gitea/gitea-data/git/repositories/oualim/test.git/objects/67/acd4e9b17ecda765ba55660d01ed8e513bfb9b new file mode 100644 index 0000000..77f88d2 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/67/acd4e9b17ecda765ba55660d01ed8e513bfb9b differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/83/0453315611dc7dd90c1fa50c8748a78764231b b/gitea/gitea-data/git/repositories/oualim/test.git/objects/83/0453315611dc7dd90c1fa50c8748a78764231b new file mode 100644 index 0000000..c747274 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/83/0453315611dc7dd90c1fa50c8748a78764231b differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/92/67f814310e96b2e1cd5c8d59075346fed85b89 b/gitea/gitea-data/git/repositories/oualim/test.git/objects/92/67f814310e96b2e1cd5c8d59075346fed85b89 new file mode 100644 index 0000000..962424b Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/92/67f814310e96b2e1cd5c8d59075346fed85b89 differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/cc/10e4c7b05bbb6569a95c1595a35ef62dfa498b b/gitea/gitea-data/git/repositories/oualim/test.git/objects/cc/10e4c7b05bbb6569a95c1595a35ef62dfa498b new file mode 100644 index 0000000..f58723d Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/cc/10e4c7b05bbb6569a95c1595a35ef62dfa498b differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/cc/86ef28b2a736fdb96cb78cba4e7568b5f97615 b/gitea/gitea-data/git/repositories/oualim/test.git/objects/cc/86ef28b2a736fdb96cb78cba4e7568b5f97615 new file mode 100644 index 0000000..d18271d Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/cc/86ef28b2a736fdb96cb78cba4e7568b5f97615 differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/df/b5fc34740752b03106651da81f3961f2cf46e7 b/gitea/gitea-data/git/repositories/oualim/test.git/objects/df/b5fc34740752b03106651da81f3961f2cf46e7 new file mode 100644 index 0000000..2aa5949 Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/df/b5fc34740752b03106651da81f3961f2cf46e7 differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/e6/ed5f3c93fe6412adc9f208671b7bedf36e6808 b/gitea/gitea-data/git/repositories/oualim/test.git/objects/e6/ed5f3c93fe6412adc9f208671b7bedf36e6808 new file mode 100644 index 0000000..84a613f Binary files /dev/null and b/gitea/gitea-data/git/repositories/oualim/test.git/objects/e6/ed5f3c93fe6412adc9f208671b7bedf36e6808 differ diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/objects/info/packs b/gitea/gitea-data/git/repositories/oualim/test.git/objects/info/packs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/objects/info/packs @@ -0,0 +1 @@ + diff --git a/gitea/gitea-data/git/repositories/oualim/test.git/refs/heads/main b/gitea/gitea-data/git/repositories/oualim/test.git/refs/heads/main new file mode 100644 index 0000000..940361e --- /dev/null +++ b/gitea/gitea-data/git/repositories/oualim/test.git/refs/heads/main @@ -0,0 +1 @@ +9267f814310e96b2e1cd5c8d59075346fed85b89 diff --git a/gitea/gitea-data/gitea/actions_log/Oualim/test/01/1.log.zst b/gitea/gitea-data/gitea/actions_log/Oualim/test/01/1.log.zst new file mode 100644 index 0000000..1d42bd5 Binary files /dev/null and b/gitea/gitea-data/gitea/actions_log/Oualim/test/01/1.log.zst differ diff --git a/gitea/gitea-data/gitea/avatars/8252a8e564970786253160dd17ff5c42 b/gitea/gitea-data/gitea/avatars/8252a8e564970786253160dd17ff5c42 new file mode 100644 index 0000000..e5e40a2 Binary files /dev/null and b/gitea/gitea-data/gitea/avatars/8252a8e564970786253160dd17ff5c42 differ diff --git a/gitea/gitea-data/gitea/conf/app.ini b/gitea/gitea-data/gitea/conf/app.ini new file mode 100644 index 0000000..34a7264 --- /dev/null +++ b/gitea/gitea-data/gitea/conf/app.ini @@ -0,0 +1,103 @@ +APP_NAME = Gitea: Git with a cup of tea +RUN_MODE = prod +RUN_USER = git +WORK_PATH = /data/gitea + +[repository] +ROOT = /data/git/repositories +ENABLE_PUSH_CREATE_USER = true + +[repository.local] +LOCAL_COPY_PATH = /data/gitea/tmp/local-repo + +[repository.upload] +TEMP_PATH = /data/gitea/uploads + +[server] +APP_DATA_PATH = /data/gitea +DOMAIN = localhost +SSH_DOMAIN = localhost +HTTP_PORT = 3000 +ROOT_URL = http://localhost:3001/ +DISABLE_SSH = false +SSH_PORT = 22 +SSH_LISTEN_PORT = 22 +LFS_START_SERVER = true +LFS_JWT_SECRET = CSqft6dn9N1rna4WvHObypQ5veLERw0_SjmGKNdCquc +OFFLINE_MODE = true + +[database] +PATH = /data/gitea/gitea.db +DB_TYPE = sqlite3 +HOST = localhost:3306 +NAME = gitea +USER = root +PASSWD = +LOG_SQL = false +SCHEMA = +SSL_MODE = disable + +[indexer] +ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve + +[session] +PROVIDER_CONFIG = /data/gitea/sessions +PROVIDER = file + +[picture] +AVATAR_UPLOAD_PATH = /data/gitea/avatars +REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars + +[attachment] +PATH = /data/gitea/attachments + +[log] +MODE = console +LEVEL = info +ROOT_PATH = /data/gitea/log + +[security] +INSTALL_LOCK = true +SECRET_KEY = +REVERSE_PROXY_LIMIT = 1 +REVERSE_PROXY_TRUSTED_PROXIES = * +INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE3NjkxODkwMzN9.7X3_ceq7hiu2imf9624NCzFj6WfWlmafhNdGjJYKF6Y +PASSWORD_HASH_ALGO = pbkdf2 + +[service] +DISABLE_REGISTRATION = false +REQUIRE_SIGNIN_VIEW = false +REGISTER_EMAIL_CONFIRM = false +ENABLE_NOTIFY_MAIL = false +ALLOW_ONLY_EXTERNAL_REGISTRATION = false +ENABLE_CAPTCHA = false +DEFAULT_KEEP_EMAIL_PRIVATE = false +DEFAULT_ALLOW_CREATE_ORGANIZATION = true +DEFAULT_ENABLE_TIMETRACKING = true +NO_REPLY_ADDRESS = noreply.localhost + +[lfs] +PATH = /data/git/lfs + +[mailer] +ENABLED = false + +[openid] +ENABLE_OPENID_SIGNIN = true +ENABLE_OPENID_SIGNUP = true + +[cron.update_checker] +ENABLED = false + +[repository.pull-request] +DEFAULT_MERGE_STYLE = merge + +[repository.signing] +DEFAULT_TRUST_MODEL = committer + +[oauth2] +JWT_SECRET = wCqn02i_UWDLS1lid-1i416rxq4RENhZqpIJW8QVY9A + +[actions] +ENABLED = true +LOCAL_RUNNER_ENABLED = true diff --git a/gitea/gitea-data/gitea/gitea.db b/gitea/gitea-data/gitea/gitea.db new file mode 100644 index 0000000..7f5406c Binary files /dev/null and b/gitea/gitea-data/gitea/gitea.db differ diff --git a/gitea/gitea-data/gitea/home/.gitconfig b/gitea/gitea-data/gitea/home/.gitconfig new file mode 100644 index 0000000..ec57bef --- /dev/null +++ b/gitea/gitea-data/gitea/home/.gitconfig @@ -0,0 +1,22 @@ +[diff] + algorithm = histogram +[core] + logallrefupdates = true + quotePath = false + commitGraph = true +[gc] + reflogexpire = 90 + writeCommitGraph = true +[user] + name = Gitea + email = gitea@fake.local +[receive] + advertisePushOptions = true + procReceiveRefs = refs/for +[fetch] + writeCommitGraph = true +[safe] + directory = * +[uploadpack] + allowfilter = true + allowAnySHA1InWant = true diff --git a/gitea/gitea-data/gitea/indexers/issues.bleve/index_meta.json b/gitea/gitea-data/gitea/indexers/issues.bleve/index_meta.json new file mode 100644 index 0000000..5dc3405 --- /dev/null +++ b/gitea/gitea-data/gitea/indexers/issues.bleve/index_meta.json @@ -0,0 +1 @@ +{"storage":"boltdb","index_type":"scorch"} \ No newline at end of file diff --git a/gitea/gitea-data/gitea/indexers/issues.bleve/rupture_meta.json b/gitea/gitea-data/gitea/indexers/issues.bleve/rupture_meta.json new file mode 100644 index 0000000..978d526 --- /dev/null +++ b/gitea/gitea-data/gitea/indexers/issues.bleve/rupture_meta.json @@ -0,0 +1 @@ +{"version":5} \ No newline at end of file diff --git a/gitea/gitea-data/gitea/indexers/issues.bleve/store/root.bolt b/gitea/gitea-data/gitea/indexers/issues.bleve/store/root.bolt new file mode 100644 index 0000000..10d08ae Binary files /dev/null and b/gitea/gitea-data/gitea/indexers/issues.bleve/store/root.bolt differ diff --git a/gitea/gitea-data/gitea/jwt/private.pem b/gitea/gitea-data/gitea/jwt/private.pem new file mode 100644 index 0000000..bb1d8c3 --- /dev/null +++ b/gitea/gitea-data/gitea/jwt/private.pem @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDFjNXGfOiFNqAn +u/PxYJWM34QKhW2YwxySykwJN6A+Bmkmo7+aXu/L5Kr0l2qVpmtPNfi75v0KO2Kg +BO9IMnIGBzj0qXQSjJfOIyeaMAzxS/dwAxWHw+0MjN4qfWSdR1eRkdhoOATdTCJr +ePrD3rGnc1ZjThpSecahuIQidW5N/+F7ISD66J5sflSTO7sYFdzx4vN32oblCeTg +KMgWTGsoMxz/FOZOAKJZvgiQ1xTLo76UftLcCsdTVD1TFoA9D7jgsOWZIUWJhmTH +/DCBf1xHTlTvLqjkke7QjcEVCHWvWvEoL7QkTkosuHd786or4jN2c70s60YWe3XV +qD7MXylKtr+DN1FM/m2vYMhzxb/jHEqyq5rqhm3bauiHqOt8eSWUuMqBxCwgZRqg +FJldhenjr+/t3ZPlTwgycmowVJJYROvtaZC6deA2tcSIxHAsr0Q0scFoHZA9v0uW +Cij9B/tEYpAQCS6EnLLmlA072zsjeSB7VGwbjREdrDRCAFoVi8g+ezTBC8Rp5hjU +/IUmaQNipdvzTipa0UacnrGEBssIjRNlzSqI5zMP6wA1AB8xLu1trMBeyM7fWmYP ++qXrlIwABUw/hJN2P8azc4MpcRM4kq9yUrnt4G6d+m1ns/pAl7C1SIkdlUgWsGSK +rEPOgldBKJbxhlUoaW7x29K0Gws7rwIDAQABAoICAF/KFHZ0ZsMBY9Mgff7S2HFA +iGQZorTqFtbOpOPrRxYMQbxstiGCW0BAluyW5yW9VldIUl26eYQWm5IAEo6td0CZ +C/MGn7PG3G0l+rP3DK+MKGT1+eClDjKBs9BikQD6cOmzEH4oe6NaoW3/cYi8WORb +Ns5cNsM7LSeJsviKfHvx0UHFJJrFZNwyvYvO8L+TCll3tJqvKa2xiHtxCuRVFbie +YDcHyUyVXiOp07l3sSu1MFoMzO3JhDFRrZK2XGQ/VWQOIqaHzZILyp52GIcSXIpu +3xxDQb3jTStvMOqj+XyX2kukJfNcyva4U6eU1TUGL/IF2PsI8ilAoDiDpj+u/PPT +xOAXeek0muMSZ++KnOTu5ooO8HW/GfO8eAZF9n6oYwJmt/yE1M4hoSLcbWIl0zE2 +eRGqZi46ZTEjvYJVAdhpX7gwU0TvwFa1BsLAqbdlP3+F2DFupm3juDUKUzkDQn+u +75zokkjbo6dKvLz00HjaDOsKoWA+lihGav14A1J9ZPSu0bJqKl+gLK5TeTias93d +d+Fa8xC2r3NuuZMnykvlw6jIsWRedO17qP+dy+kHlEleL6irBVsIacOGeXqYQnyN +g8H6vFiPxb2rEupkCtGy4jIGdDKt7hGDrflDh/GarbXN43AEu0lZ6GP0zdHo9Z2C +Rd1kzp9/P7MQOMAwGVSxAoIBAQDHBEALh/ZeAE+eKISKEXxtACOaSIl3B+PixzIu +AYTfxwO3rQwadIHIGSL9pM7py1/xi4BWn71Kn/5zwKuUu0YxXq2Wl17N0QXowhCl +LrBDfVFFOBCzxjIcKi5Q7fUbud7xadtq3OkruIsMLsOtY79beI/oZP5t3YdmIXT2 +i5XVX1RQwmPzUIHu17fD8j1XzaHjNXFDaeoDbuJjfJKT8G0ioOxFGoqlB4BNw+eA +RWx4msTL7ewgH9P+qbET5J0+F5Z6MJvujEW50zpYIgzfYSSxIUYz8HmtjPW3pIn4 +D08m7r6b0p5ZBwplxmwZVjWUB9mmLq2MKWkeqO+I6vYpO2vdAoIBAQD+HRgeF2ka +S8R7DFGfkhzMO3RTiXnT1eOAXcNg74EvwmediorgJfYc5BCIM/foG47MkYHpsBx5 +/tX5nS0lPwdJq48gPACVoiBW9oQdKFGnD6B3/oc55/oO3oDByKimajMlRLj1ha9f +SHndtlqFWVnx8lCjyYsqZV2OPnb6K/3QSjBd2zmqtYfzi9IGrenCucjONGGy8GyZ +1SHs3P1swIIvLO6QiS1rOoeBV5oWoOMehfOyjo/ldQqimug0OoGbhGecJtc8hkju +f3kJM1ekroDAMFBd1Jw4KP0TRm8Itn16n6RAA0lXEdcADe+t1ipE2bAcJqD8L0oU +d5cuYZ/PB8L7AoIBAHZ0sSor4xhQVxNsSndjsQuv6YELa8bNi3aP2e5IOS545l2N +Qob8kcLoM0uFrSK7SoAa6Gim66RfVrTPGVGNpln8YJYhwuv+XeYMnJu1DnUdQiJR +HJ/keC8LbEX/XMUD/Q70UwVoN+EuFpVJwG6T0HJBcGaCtm3uTYkcoOGec7Bs7WKk +UZmhcbUX8OlQZfK9En6KcMAPappghZ9xpk0n7c2OuxLmmV9g951R3ZkbuVSPylMX +alQ0nZoWpq+Qg4dRwt83z5hNJbNVZoTOv5q114EWrRJ9L+9810RXS0e61QH3WLym +wFl9N1Mcp3rtNTbG9WVUozep7kexheGY+KvSEoECggEBAIRh59SVYZ3fZwarjkJR +PktvldSHRD6FqTWQo152p5iX8J70NBE99Y9riOlMGZSD9sq/6ywxIUS07AhUR9al +lUhd5fxnBe7uPWbQmlcOUCt2SqT4pr4WCgGBDRbnUGUR4n9B5BGUiZ5cBZDplRLv +T5pqIHSTZLq7gBfAlv8Rt/KxE61xrgMu+xp39vyf0a4uV1yFkXhFJG6nyDq7jhL/ +31JwWABYVp8MKNfLKW0sd+XI5wJYnsJtTRMVHG9JI4g/XDLPUUYotwn4wrd2Vexn +NI/rG5MmVhQz1lQaV3H0kD43uLvYenavxpAysnCfp/miZsrjnO6EPFWZT9tL5JNY +ec0CggEAfQgxM4JyXcaE2+RCCTGNNTVmjkYMMHxpKs5Q5/xC9EIqCuR71XJ5JuM5 ++gqhqESE7NYXTSlQt6kKAKQPHFHbj9dlHz8dGfAKFn67bWS1QWTYdSc4hnabtD91 +iUq0LSJ98tzqor0Sgapm2VjBd1RyZbOypO1zU61h+zG3uXj+aO6Pv9/pzoHFDvV7 +/P0eVYZn18bIuaLqX4kQRcEW77brl1HRPMiOyXPwGV5yabke1i5exXKp/LY59ual +/8l6bcas22CFBxRHy9wtLfORyGL4m2wdtiI5zC6sLl4L9nwgFDd+3pKAYpFwWK2e +sYP5VUZl6RqZRmgWoW52HPK0x1HXdQ== +-----END PRIVATE KEY----- diff --git a/gitea/gitea-data/gitea/queues/common/000018.ldb b/gitea/gitea-data/gitea/queues/common/000018.ldb new file mode 100644 index 0000000..ffb5a39 Binary files /dev/null and b/gitea/gitea-data/gitea/queues/common/000018.ldb differ diff --git a/gitea/gitea-data/gitea/queues/common/000023.log b/gitea/gitea-data/gitea/queues/common/000023.log new file mode 100644 index 0000000..e69de29 diff --git a/gitea/gitea-data/gitea/queues/common/CURRENT b/gitea/gitea-data/gitea/queues/common/CURRENT new file mode 100644 index 0000000..1e21b78 --- /dev/null +++ b/gitea/gitea-data/gitea/queues/common/CURRENT @@ -0,0 +1 @@ +MANIFEST-000024 diff --git a/gitea/gitea-data/gitea/queues/common/CURRENT.bak b/gitea/gitea-data/gitea/queues/common/CURRENT.bak new file mode 100644 index 0000000..5af92b2 --- /dev/null +++ b/gitea/gitea-data/gitea/queues/common/CURRENT.bak @@ -0,0 +1 @@ +MANIFEST-000022 diff --git a/gitea/gitea-data/gitea/queues/common/LOCK b/gitea/gitea-data/gitea/queues/common/LOCK new file mode 100644 index 0000000..e69de29 diff --git a/gitea/gitea-data/gitea/queues/common/LOG b/gitea/gitea-data/gitea/queues/common/LOG new file mode 100644 index 0000000..73ae5b6 --- /dev/null +++ b/gitea/gitea-data/gitea/queues/common/LOG @@ -0,0 +1,102 @@ +=============== Jan 23, 2026 (UTC) =============== +17:23:56.867308 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +17:23:56.883026 db@open opening +17:23:56.883381 version@stat F·[] S·0B[] Sc·[] +17:23:56.890194 db@janitor F·2 G·0 +17:23:56.890238 db@open done T·7.182014ms +=============== Jan 23, 2026 (UTC) =============== +17:46:49.733402 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +17:46:49.733586 version@stat F·[] S·0B[] Sc·[] +17:46:49.733594 db@open opening +17:46:49.733630 journal@recovery F·1 +17:46:49.733700 journal@recovery recovering @1 +17:46:49.742301 memdb@flush created L0@2 N·28 S·574B "act..igh,v28":"web..low,v19" +17:46:49.743069 version@stat F·[1] S·574B[574B] Sc·[0.25] +17:46:49.785558 db@janitor F·3 G·0 +17:46:49.785610 db@open done T·52.003836ms +=============== Jan 26, 2026 (UTC) =============== +10:11:01.005727 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +10:11:01.010510 version@stat F·[1] S·574B[574B] Sc·[0.25] +10:11:01.010539 db@open opening +10:11:01.012136 journal@recovery F·1 +10:11:01.012236 journal@recovery recovering @3 +10:11:01.012395 version@stat F·[1] S·574B[574B] Sc·[0.25] +10:11:01.031969 db@janitor F·3 G·0 +10:11:01.031996 db@open done T·21.4481ms +=============== Jan 26, 2026 (CET) =============== +12:45:14.589555 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:45:14.594595 version@stat F·[1] S·574B[574B] Sc·[0.25] +12:45:14.594988 db@open opening +12:45:14.596072 journal@recovery F·1 +12:45:14.597325 journal@recovery recovering @5 +12:45:14.599561 version@stat F·[1] S·574B[574B] Sc·[0.25] +12:45:14.623677 db@janitor F·3 G·0 +12:45:14.623868 db@open done T·28.719827ms +=============== Jan 26, 2026 (UTC) =============== +13:21:43.106566 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +13:21:43.110919 version@stat F·[1] S·574B[574B] Sc·[0.25] +13:21:43.111264 db@open opening +13:21:43.112339 journal@recovery F·1 +13:21:43.112619 journal@recovery recovering @7 +13:21:43.121535 memdb@flush created L0@9 N·16 S·528B "pus..\x00\x00\x00,d39":"rep..e-1,v40" +13:21:43.123678 version@stat F·[2] S·1KiB[1KiB] Sc·[0.50] +13:21:43.153080 db@janitor F·4 G·0 +13:21:43.153580 db@open done T·42.180469ms +13:22:22.501538 table@compaction L0·2 -> L1·0 S·1KiB Q·46 +13:22:22.519601 table@build created L1@12 N·28 S·575B "act..igh,v28":"web..low,v19" +13:22:22.519788 version@stat F·[0 1] S·575B[0B 575B] Sc·[0.00 0.00] +13:22:22.531134 table@compaction committed F-1 S-527B Ke·0 D·16 T·28.843815ms +13:22:22.535210 table@remove removed @9 +13:22:22.540103 table@remove removed @2 +=============== Jan 26, 2026 (CET) =============== +16:04:24.842549 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +16:04:24.847748 version@stat F·[0 1] S·575B[0B 575B] Sc·[0.00 0.00] +16:04:24.848578 db@open opening +16:04:24.849889 journal@recovery F·1 +16:04:24.850120 journal@recovery recovering @10 +16:04:24.852672 version@stat F·[0 1] S·575B[0B 575B] Sc·[0.00 0.00] +16:04:24.880809 db@janitor F·3 G·0 +16:04:24.881176 db@open done T·32.382437ms +=============== Jan 26, 2026 (UTC) =============== +15:47:31.562206 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:47:31.567015 version@stat F·[0 1] S·575B[0B 575B] Sc·[0.00 0.00] +15:47:31.567426 db@open opening +15:47:31.568519 journal@recovery F·1 +15:47:31.568953 journal@recovery recovering @13 +15:47:31.577820 memdb@flush created L0@15 N·42 S·839B "pus..\x00\x00\x00,d50":"rep..e-2,v51" +15:47:31.579788 version@stat F·[1 1] S·1KiB[839B 575B] Sc·[0.25 0.00] +15:47:31.617648 db@janitor F·4 G·0 +15:47:31.618094 db@open done T·50.519567ms +15:48:13.114448 table@compaction L0·1 -> L1·1 S·1KiB Q·89 +15:48:13.146103 table@build created L1@18 N·28 S·577B "act..igh,v28":"web..low,v19" +15:48:13.147592 version@stat F·[0 1] S·577B[0B 577B] Sc·[0.00 0.00] +15:48:13.184932 table@compaction committed F-1 S-837B Ke·0 D·42 T·67.184823ms +15:48:13.188444 table@remove removed @15 +15:48:13.198037 table@remove removed @12 +=============== Jan 26, 2026 (UTC) =============== +18:03:33.961144 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +18:03:34.337700 version@stat F·[0 1] S·577B[0B 577B] Sc·[0.00 0.00] +18:03:34.364427 db@open opening +18:03:34.388854 journal@recovery F·1 +18:03:34.412771 journal@recovery recovering @16 +18:03:34.467145 version@stat F·[0 1] S·577B[0B 577B] Sc·[0.00 0.00] +18:03:34.640893 db@janitor F·3 G·0 +18:03:34.641851 db@open done T·274.874ms +=============== Jan 26, 2026 (UTC) =============== +18:28:26.169839 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +18:28:26.182650 version@stat F·[0 1] S·577B[0B 577B] Sc·[0.00 0.00] +18:28:26.183045 db@open opening +18:28:26.184089 journal@recovery F·1 +18:28:26.184782 journal@recovery recovering @19 +18:28:26.192321 version@stat F·[0 1] S·577B[0B 577B] Sc·[0.00 0.00] +18:28:26.228733 db@janitor F·3 G·0 +18:28:26.228932 db@open done T·45.740108ms +=============== Jan 27, 2026 (UTC) =============== +07:31:18.884403 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +07:31:18.914629 version@stat F·[0 1] S·577B[0B 577B] Sc·[0.00 0.00] +07:31:18.915137 db@open opening +07:31:18.917468 journal@recovery F·1 +07:31:18.917740 journal@recovery recovering @21 +07:31:18.922596 version@stat F·[0 1] S·577B[0B 577B] Sc·[0.00 0.00] +07:31:18.962518 db@janitor F·3 G·0 +07:31:18.962774 db@open done T·47.494468ms diff --git a/gitea/gitea-data/gitea/queues/common/MANIFEST-000024 b/gitea/gitea-data/gitea/queues/common/MANIFEST-000024 new file mode 100644 index 0000000..b2c184d Binary files /dev/null and b/gitea/gitea-data/gitea/queues/common/MANIFEST-000024 differ diff --git a/gitea/gitea-data/gitea/sessions/3/f/3fb760b8668882c2 b/gitea/gitea-data/gitea/sessions/3/f/3fb760b8668882c2 new file mode 100644 index 0000000..9433983 Binary files /dev/null and b/gitea/gitea-data/gitea/sessions/3/f/3fb760b8668882c2 differ diff --git a/gitea/gitea-data/ssh/ssh_host_ecdsa_key b/gitea/gitea-data/ssh/ssh_host_ecdsa_key new file mode 100644 index 0000000..19562a5 --- /dev/null +++ b/gitea/gitea-data/ssh/ssh_host_ecdsa_key @@ -0,0 +1,9 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS +1zaGEyLW5pc3RwMjU2AAAACG5pc3RwMjU2AAAAQQT6DXIbaItTR+HbCTrWi2MO04BXyY9m +SAu3rRVkVlJ+vZvTDHHv08wo5df4I6r1Ym9M1peV/gqauoJTWyYzGuZMAAAAsMI6N+fCOj +fnAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPoNchtoi1NH4dsJ +OtaLYw7TgFfJj2ZIC7etFWRWUn69m9MMce/TzCjl1/gjqvVib0zWl5X+Cpq6glNbJjMa5k +wAAAAhAN9Rb4e1SIRac1UBdaj3eNaU45FHV+kXMRzsPwOveKEMAAAAEXJvb3RANzc1YjQ0 +NjAzYjY5AQIDBAUG +-----END OPENSSH PRIVATE KEY----- diff --git a/gitea/gitea-data/ssh/ssh_host_ecdsa_key.pub b/gitea/gitea-data/ssh/ssh_host_ecdsa_key.pub new file mode 100644 index 0000000..ba9859e --- /dev/null +++ b/gitea/gitea-data/ssh/ssh_host_ecdsa_key.pub @@ -0,0 +1 @@ +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPoNchtoi1NH4dsJOtaLYw7TgFfJj2ZIC7etFWRWUn69m9MMce/TzCjl1/gjqvVib0zWl5X+Cpq6glNbJjMa5kw= root@775b44603b69 diff --git a/gitea/gitea-data/ssh/ssh_host_ed25519_key b/gitea/gitea-data/ssh/ssh_host_ed25519_key new file mode 100644 index 0000000..fe5dbde --- /dev/null +++ b/gitea/gitea-data/ssh/ssh_host_ed25519_key @@ -0,0 +1,7 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW +QyNTUxOQAAACARHQJ/mYPRF0mVjGa1/yyzY8AiUaTNQQyC1Vcm5F5zdAAAAJhvwnpub8J6 +bgAAAAtzc2gtZWQyNTUxOQAAACARHQJ/mYPRF0mVjGa1/yyzY8AiUaTNQQyC1Vcm5F5zdA +AAAEBKWS6UTAmfIzCl61PJqu7Suux0hjuL655QJ5OftoWjFREdAn+Zg9EXSZWMZrX/LLNj +wCJRpM1BDILVVybkXnN0AAAAEXJvb3RANzc1YjQ0NjAzYjY5AQIDBA== +-----END OPENSSH PRIVATE KEY----- diff --git a/gitea/gitea-data/ssh/ssh_host_ed25519_key.pub b/gitea/gitea-data/ssh/ssh_host_ed25519_key.pub new file mode 100644 index 0000000..b801bb9 --- /dev/null +++ b/gitea/gitea-data/ssh/ssh_host_ed25519_key.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBEdAn+Zg9EXSZWMZrX/LLNjwCJRpM1BDILVVybkXnN0 root@775b44603b69 diff --git a/gitea/gitea-data/ssh/ssh_host_rsa_key b/gitea/gitea-data/ssh/ssh_host_rsa_key new file mode 100644 index 0000000..cc5cf99 --- /dev/null +++ b/gitea/gitea-data/ssh/ssh_host_rsa_key @@ -0,0 +1,38 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn +NhAAAAAwEAAQAAAYEAwtDqmPHq6sAZqOgasBy3tMBpuJfVJRI3BxqVmr6FoQ+5krS+L9o+ +XOMoeLI/iz9tEULShlKMCNFlab9VZBF+XPmteoZ7gRRO7J3QnS7H+56vcl/N6Hq5pTlGSx +E0QGDUCEwbmIp09JOcZpeaQIasbOeWC6UUtS5U0EFf3XY7cNn0EW4/hdVn3LJo4hJYAbeh +hjJc0Y2tYjdsl4McEf9s6iYYl/zS1ho3++0Lr5KNP+olaFxBTiphA15/BA5b+kEWyecYkq +rwr3fG9sYkOPjnIkXY0Xgy94sk7z0IRPIIjFX6wCo7EBtt56L90kzOkk5OOe+F6jTb9Mwk +osbfFDqi1bGd1/LsLEpVBylOBfnHiAH9aI4hTPYccFOEAw3Kg641V/QqEBezz6KL7vEMNu +hcbJg2Hm4B7U2zZd+gQO5EqDpEHag5wy0KyPjI4vnOrhuhv5Apdx6EHf5PgyAso0mo+7Xc +BuqKs6iwkOAKP6xdDf6O/ibuWa41TxsbS4jdL0nDAAAFiD4py7E+KcuxAAAAB3NzaC1yc2 +EAAAGBAMLQ6pjx6urAGajoGrAct7TAabiX1SUSNwcalZq+haEPuZK0vi/aPlzjKHiyP4s/ +bRFC0oZSjAjRZWm/VWQRflz5rXqGe4EUTuyd0J0ux/uer3Jfzeh6uaU5RksRNEBg1AhMG5 +iKdPSTnGaXmkCGrGznlgulFLUuVNBBX912O3DZ9BFuP4XVZ9yyaOISWAG3oYYyXNGNrWI3 +bJeDHBH/bOomGJf80tYaN/vtC6+SjT/qJWhcQU4qYQNefwQOW/pBFsnnGJKq8K93xvbGJD +j45yJF2NF4MveLJO89CETyCIxV+sAqOxAbbeei/dJMzpJOTjnvheo02/TMJKLG3xQ6otWx +ndfy7CxKVQcpTgX5x4gB/WiOIUz2HHBThAMNyoOuNVf0KhAXs8+ii+7xDDboXGyYNh5uAe +1Ns2XfoEDuRKg6RB2oOcMtCsj4yOL5zq4bob+QKXcehB3+T4MgLKNJqPu13AbqirOosJDg +Cj+sXQ3+jv4m7lmuNU8bG0uI3S9JwwAAAAMBAAEAAAGAFuaoLUKC8wWR/qEKQhmeHslfpC +t1Ct6RSWx+mao72ysWDYDhuo5VNmYdo9KQVbYnBBhu1wttGrxCx6OOTi0gRZ20HusgKZRR +ks8abt/I8nM8/Jz2f5WtrRaGhNyI3+iCBFeuBsh/5yBTClxX7a3nJwYyRTwqqwG/RpvowQ +fdBO8aGdJz9S+Y/gCbA7hUUB9eBYB2GMwmzZzmTwlCi3sTOpMv4O3/etuqKRs8fG8l25WS +wCnYI3An51V8aOWnOkvcRS/lVQYpc+z9+GlUjjbRz9GVVmI3BOJUSOsCUDvqii8ry0Mayv +pF7O9KfYkaL/gsCIKRUFjr4kknTXXtb7ouByY1SxabmoGyirAS5ZumlenWbie0Aza6+4/x +nS8J8EXZCxPdqapMQ2RqYFqKUILY7L1TP2htox8vYmmoybAh4cM7vR7TEk7CCKGGaGRXa8 +lassZSBRx/WymQtcZQfaEHerrBoG4kEJi3Q2ERk2rJ+AMDAO5V93ND4nQXY6qn1DTBAAAA +wBE2uzZNI2O/S3Q+y5bPho5hI1BuGMhhvvXgM96fwDgEJTvwgQmZzrB4RxVGxKyJ22Lkcw +/VmNEJm5kuaAK0qDFESxJmx2x2xARIU7ci8Sbr8GFFuP3/ws0+4673AaABi7Xs7EKf0uxn +vBm4O4lYlXSwZrvECY5QlILDCfERutR157/yRlBvimSDv34wrWL6qJcwdp0UDwHwMFrIVv +cYxbb9FPREdw3jGZtCe32cbCQJ4yAoaEoTpsm+cbr659ohYgAAAMEA9fINQwvaNgJinKUy +Ablj02Y2stj5NURvnF1sJbWS2A6wGfgc5sOKWcDSgtdSqqxzYsoZX4NtWvaoH0Qykf71TL +jeyKApR3NeGpjzukoGDYSp55k+STKHdenuB70AQXzyW/+yWDxnq+U1xx57lPWlEq/kP5VX +sIdNLafQv1lg5N9d8PQUgqhs8b3eIYYsT8mbjbhXdU47VAOMV1HXgfrWdSe7qIt+hDmD2P +MVJyrOc1UBD6Re9lPxsjneA0H6dX89AAAAwQDKx8SzdasB4lJci2Gdv6UdULVCymCZ0wfk +Cxl9IpTewWCh+p9r5ljQb1jfsD4x/OdP4ddPmm32cXqy69k/QVXD2LLJz3tY1Xe1cuzZKN +ZtcxSAOJpYNWtufEnIQN58Jtmuswwi/WSsW1E2R7W/jNp0jJtZildxyC1HEfScqpHSmoRV +0rXUQxOgWYUkhGNcbwz4H2/MshivGXh+P17Vwo6cz6SmJ5q3HhlxM8Vcrk3pt0cWm1HJqJ +MsbppVPCLUfP8AAAARcm9vdEA3NzViNDQ2MDNiNjkBAg== +-----END OPENSSH PRIVATE KEY----- diff --git a/gitea/gitea-data/ssh/ssh_host_rsa_key.pub b/gitea/gitea-data/ssh/ssh_host_rsa_key.pub new file mode 100644 index 0000000..ae7f661 --- /dev/null +++ b/gitea/gitea-data/ssh/ssh_host_rsa_key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDC0OqY8erqwBmo6BqwHLe0wGm4l9UlEjcHGpWavoWhD7mStL4v2j5c4yh4sj+LP20RQtKGUowI0WVpv1VkEX5c+a16hnuBFE7sndCdLsf7nq9yX83oermlOUZLETRAYNQITBuYinT0k5xml5pAhqxs55YLpRS1LlTQQV/ddjtw2fQRbj+F1WfcsmjiElgBt6GGMlzRja1iN2yXgxwR/2zqJhiX/NLWGjf77Quvko0/6iVoXEFOKmEDXn8EDlv6QRbJ5xiSqvCvd8b2xiQ4+OciRdjReDL3iyTvPQhE8giMVfrAKjsQG23nov3STM6STk4574XqNNv0zCSixt8UOqLVsZ3X8uwsSlUHKU4F+ceIAf1ojiFM9hxwU4QDDcqDrjVX9CoQF7PPoovu8Qw26FxsmDYebgHtTbNl36BA7kSoOkQdqDnDLQrI+Mji+c6uG6G/kCl3HoQd/k+DICyjSaj7tdwG6oqzqLCQ4Ao/rF0N/o7+Ju5ZrjVPGxtLiN0vScM= root@775b44603b69 diff --git a/gitea/gitea-runner/README.md b/gitea/gitea-runner/README.md new file mode 100644 index 0000000..169ae29 --- /dev/null +++ b/gitea/gitea-runner/README.md @@ -0,0 +1,3 @@ +trigger +test +trigger CI diff --git a/gitea/gitea-runner/act_runner b/gitea/gitea-runner/act_runner new file mode 100644 index 0000000..2e15135 Binary files /dev/null and b/gitea/gitea-runner/act_runner differ diff --git a/gitea/gitea-runner/config.yaml b/gitea/gitea-runner/config.yaml new file mode 100644 index 0000000..637b2fd --- /dev/null +++ b/gitea/gitea-runner/config.yaml @@ -0,0 +1,101 @@ +# Example configuration file, it's safe to copy this as the default config file without any modification. + +# You don't have to copy this file to your instance, +# just run `./act_runner generate-config > config.yaml` to generate a config file. + +log: + # The level of logging, can be trace, debug, info, warn, error, fatal + level: info + +runner: + # Where to store the registration result. + file: .runner + # Execute how many tasks concurrently at the same time. + capacity: 1 + # Extra environment variables to run jobs. + envs: + A_TEST_ENV_NAME_1: a_test_env_value_1 + A_TEST_ENV_NAME_2: a_test_env_value_2 + # Extra environment variables to run jobs from a file. + # It will be ignored if it's empty or the file doesn't exist. + env_file: .env + # The timeout for a job to be finished. + # Please note that the Gitea instance also has a timeout (3h by default) for the job. + # So the job could be stopped by the Gitea instance if it's timeout is shorter than this. + timeout: 3h + # The timeout for the runner to wait for running jobs to finish when shutting down. + # Any running jobs that haven't finished after this timeout will be cancelled. + shutdown_timeout: 0s + # Whether skip verifying the TLS certificate of the Gitea instance. + insecure: false + # The timeout for fetching the job from the Gitea instance. + fetch_timeout: 5s + # The interval for fetching the job from the Gitea instance. + fetch_interval: 2s + # The labels of a runner are used to determine which jobs the runner can run, and how to run them. + # Like: "macos-arm64:host" or "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest" + # Find more images provided by Gitea at https://gitea.com/gitea/runner-images . + # If it's empty when registering, it will ask for inputting labels. + # If it's empty when execute `daemon`, will use labels in `.runner` file. + labels: + - "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest" + - "ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04" + - "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04" + +cache: + # Enable cache server to use actions/cache. + enabled: true + # The directory to store the cache data. + # If it's empty, the cache data will be stored in $HOME/.cache/actcache. + dir: "" + # The host of the cache server. + # It's not for the address to listen, but the address to connect from job containers. + # So 0.0.0.0 is a bad choice, leave it empty to detect automatically. + host: "" + # The port of the cache server. + # 0 means to use a random available port. + port: 0 + # The external cache server URL. Valid only when enable is true. + # If it's specified, act_runner will use this URL as the ACTIONS_CACHE_URL rather than start a server by itself. + # The URL should generally end with "/". + external_server: "" + +container: + # Specifies the network to which the container will connect. + # Could be host, bridge or the name of a custom network. + # If it's empty, act_runner will create a network automatically. + network: "devops-network" + # Whether to use privileged mode or not when launching task containers (privileged mode is required for Docker-in-Docker). + privileged: false + # And other options to be used when the container is started (eg, --add-host=my.gitea.url:host-gateway). + options: + # The parent directory of a job's working directory. + # NOTE: There is no need to add the first '/' of the path as act_runner will add it automatically. + # If the path starts with '/', the '/' will be trimmed. + # For example, if the parent directory is /path/to/my/dir, workdir_parent should be path/to/my/dir + # If it's empty, /workspace will be used. + workdir_parent: + # Volumes (including bind mounts) can be mounted to containers. Glob syntax is supported, see https://github.com/gobwas/glob + # You can specify multiple volumes. If the sequence is empty, no volumes can be mounted. + # For example, if you only allow containers to mount the `data` volume and all the json files in `/src`, you should change the config to: + # valid_volumes: + # - data + # - /src/*.json + # If you want to allow any volume, please use the following configuration: + # valid_volumes: + # - '**' + valid_volumes: [] + # overrides the docker client host with the specified one. + # If it's empty, act_runner will find an available docker host automatically. + # If it's "-", act_runner will find an available docker host automatically, but the docker host won't be mounted to the job containers and service containers. + # If it's not empty or "-", the specified docker host will be used. An error will be returned if it doesn't work. + docker_host: "" + # Pull docker image(s) even if already present + force_pull: true + # Rebuild docker image(s) even if already present + force_rebuild: false + +host: + # The parent directory of a job's working directory. + # If it's empty, $HOME/.cache/act/ will be used. + workdir_parent: diff --git a/gitea/test b/gitea/test new file mode 160000 index 0000000..9267f81 --- /dev/null +++ b/gitea/test @@ -0,0 +1 @@ +Subproject commit 9267f814310e96b2e1cd5c8d59075346fed85b89 diff --git a/kubernetes/helm/devops-chart/.helmignore b/kubernetes/helm/devops-chart/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/kubernetes/helm/devops-chart/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/kubernetes/helm/devops-chart/Chart.yaml b/kubernetes/helm/devops-chart/Chart.yaml new file mode 100644 index 0000000..789a547 --- /dev/null +++ b/kubernetes/helm/devops-chart/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: devops-chart +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/kubernetes/helm/devops-chart/templates/deployment.yaml b/kubernetes/helm/devops-chart/templates/deployment.yaml new file mode 100644 index 0000000..423ceb3 --- /dev/null +++ b/kubernetes/helm/devops-chart/templates/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.app.name }} + labels: + app: {{ .Values.app.name }} + chart: {{ .Chart.Name }} + version: {{ .Chart.Version }} +spec: + replicas: {{ .Values.app.replicaCount }} + selector: + matchLabels: + app: {{ .Values.app.name }} + template: + metadata: + labels: + app: {{ .Values.app.name }} + {{- if .Values.monitoring.enabled }} + annotations: + prometheus.io/scrape: "{{ .Values.monitoring.prometheusScrape }}" + prometheus.io/port: "{{ .Values.app.service.targetPort }}" + prometheus.io/path: "/metrics" + {{- end }} + spec: + containers: + - name: {{ .Values.app.name }} + image: "{{ .Values.app.image.repository }}:{{ .Values.app.image.tag }}" + imagePullPolicy: {{ .Values.app.image.pullPolicy }} + ports: + - containerPort: {{ .Values.app.service.targetPort }} + name: http + env: + {{- range $key, $value := .Values.app.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + resources: + {{- toYaml .Values.app.resources | nindent 10 }} + readinessProbe: + httpGet: + path: /health + port: {{ .Values.app.service.targetPort }} + initialDelaySeconds: 10 + periodSeconds: 15 \ No newline at end of file diff --git a/kubernetes/helm/devops-chart/values.yaml b/kubernetes/helm/devops-chart/values.yaml new file mode 100644 index 0000000..910932b --- /dev/null +++ b/kubernetes/helm/devops-chart/values.yaml @@ -0,0 +1,32 @@ +# Configuration de l'application +app: + name: "devops-helm-app" + image: + repository: "devops-app" + tag: "local" + pullPolicy: "IfNotPresent" + + replicaCount: 2 + + service: + type: NodePort + port: 80 + targetPort: 8000 + + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "256Mi" + cpu: "200m" + + env: + ENV: "production" + LOG_LEVEL: "INFO" + +# Monitoring +monitoring: + enabled: true + prometheusScrape: true + diff --git a/kubernetes/manifests/configmap.yaml b/kubernetes/manifests/configmap.yaml new file mode 100644 index 0000000..e08acfd --- /dev/null +++ b/kubernetes/manifests/configmap.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: app-config + namespace: devops-demo +data: + ENV: "production" + APP_NAME: "devops-windows-app" + LOG_LEVEL: "INFO" + PYTHONUNBUFFERED: "1" \ No newline at end of file diff --git a/kubernetes/manifests/db.yaml b/kubernetes/manifests/db.yaml new file mode 100644 index 0000000..e57718f --- /dev/null +++ b/kubernetes/manifests/db.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: postgres-db + namespace: devops-demo + labels: + app: postgres-db +spec: + replicas: 1 + selector: + matchLabels: + app: postgres-db + template: + metadata: + labels: + app: postgres-db + spec: + containers: + - name: postgres + image: postgres:15-alpine + env: + - name: POSTGRES_DB + value: devopsdb + - name: POSTGRES_USER + value: devopsuser + - name: POSTGRES_PASSWORD + value: devopspass + ports: + - containerPort: 5432 + volumeMounts: + - name: data + mountPath: /var/lib/postgresql/data + volumes: + - name: data + emptyDir: {} +--- +apiVersion: v1 +kind: Service +metadata: + name: postgres-service + namespace: devops-demo +spec: + selector: + app: postgres-db + ports: + - protocol: TCP + port: 5432 + targetPort: 5432 + type: ClusterIP \ No newline at end of file diff --git a/kubernetes/manifests/deployment.yaml b/kubernetes/manifests/deployment.yaml new file mode 100644 index 0000000..be9ac1c --- /dev/null +++ b/kubernetes/manifests/deployment.yaml @@ -0,0 +1,71 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: devops-app + namespace: devops-demo + labels: + app: devops-app + version: v1 +spec: + replicas: 2 + selector: + matchLabels: + app: devops-app + template: + metadata: + labels: + app: devops-app + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8000" + prometheus.io/path: "/metrics" + spec: + containers: + - name: app + image: devops-app:local # IMPORTANT : Utiliser l'image locale + imagePullPolicy: IfNotPresent # Ne pas pull depuis Docker Hub + ports: + - containerPort: 8000 + name: http + envFrom: + - configMapRef: + name: app-config + env: + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: metadata.name + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "256Mi" + cpu: "200m" + readinessProbe: + httpGet: + path: /health + port: 8000 + initialDelaySeconds: 10 + periodSeconds: 15 + livenessProbe: + httpGet: + path: /health + port: 8000 + initialDelaySeconds: 30 + periodSeconds: 30 +--- +apiVersion: v1 +kind: Service +metadata: + name: devops-app-service + namespace: devops-demo +spec: + selector: + app: devops-app + ports: + - port: 80 + targetPort: 8000 + protocol: TCP + name: http + type: NodePort # CORRIGÉ : NodePort au lieu de LoadBalancer pour Windows \ No newline at end of file diff --git a/kubernetes/manifests/namespace.yaml b/kubernetes/manifests/namespace.yaml new file mode 100644 index 0000000..ae770a5 --- /dev/null +++ b/kubernetes/manifests/namespace.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: devops-demo + labels: + name: devops-demo + environment: development \ No newline at end of file diff --git a/kubernetes/manifests/nginx-proxy.yaml b/kubernetes/manifests/nginx-proxy.yaml new file mode 100644 index 0000000..3a5c72c --- /dev/null +++ b/kubernetes/manifests/nginx-proxy.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-proxy + namespace: devops-demo + labels: + app: nginx-proxy +spec: + replicas: 1 + selector: + matchLabels: + app: nginx-proxy + template: + metadata: + labels: + app: nginx-proxy + spec: + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 + - containerPort: 443 + volumeMounts: + - name: config + mountPath: /etc/nginx/nginx.conf + subPath: nginx.conf + - name: certs + mountPath: /etc/nginx/certs + volumes: + - name: config + hostPath: + path: /run/desktop/mnt/host/c/DevOpsProject/kubernetes/manifests/nginx/nginx.conf + - name: certs + hostPath: + path: /run/desktop/mnt/host/c/DevOpsProject/kubernetes/manifests/nginx/certs +--- +apiVersion: v1 +kind: Service +metadata: + name: nginx-service + namespace: devops-demo +spec: + selector: + app: nginx-proxy + ports: + - protocol: TCP + port: 80 + targetPort: 80 + - protocol: TCP + port: 443 + targetPort: 443 + type: NodePort \ No newline at end of file diff --git a/kubernetes/manifests/nginx/certs/localhost.crt b/kubernetes/manifests/nginx/certs/localhost.crt new file mode 100644 index 0000000..360646a --- /dev/null +++ b/kubernetes/manifests/nginx/certs/localhost.crt @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDlTCCAn2gAwIBAgIUcEVmwTioAADhqYNcHQ+xvEKsQwswDQYJKoZIhvcNAQEL +BQAwWjELMAkGA1UEBhMCRlIxFjAUBgNVBAgMDUlsZS1kZS1GcmFuY2UxDjAMBgNV +BAcMBVBhcmlzMQ8wDQYDVQQKDAZEZXZPcHMxEjAQBgNVBAMMCWxvY2FsaG9zdDAe +Fw0yNjAxMTkxNTM5MTlaFw0yNzAxMTkxNTM5MTlaMFoxCzAJBgNVBAYTAkZSMRYw +FAYDVQQIDA1JbGUtZGUtRnJhbmNlMQ4wDAYDVQQHDAVQYXJpczEPMA0GA1UECgwG +RGV2T3BzMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDeWVC4CPMt2DE0aI26erPvRGk2Rytmd8kpbLAGu68vkIxDu4Oj +h4IS1CD8R9IjsaJGz5SaKQHhvYJLxVFQtEcHB9A9Rk+6TNNqodHVgKFngytbAPJ0 +mSPRYjYCnPgVKmm9/g9O1Tza8Adnx2zZjq4wilxymxwIASh98RJxTa6DcehRUP82 +ejT4KRKSAxW4+L1XUwHtw2zSain2dLODe0bu7CPYxCjrvr2KNMa2aPnP2Owo6djx +qoHedaxZ/zpPInXq6DiofEvM1TQrB9CjHR7OjOE65IzDh2OC2KTpVKgmcDqR/hcK +KUS7/+PCNlH1tidfwJ2b33GEisLNIWx/5RmtAgMBAAGjUzBRMB0GA1UdDgQWBBTK +eOgJg8lzv6oS+0mV2bqQ96QJQTAfBgNVHSMEGDAWgBTKeOgJg8lzv6oS+0mV2bqQ +96QJQTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBabnUoKZ1e +8fe7uXiHxKnhIsH/C6RoGecETwJZPLE7gVU0J7mA5Bxqk/ssQB6/ykSRqSnjsEM7 +gHGeRgaE93/J99xewTBmmzHJqzr+ETl4vsyUtP4O9ggu1JjijTgB0WpUuBnC+SUp +4W14nwonTEKY0Qua7U8Lz4PMqWOC1URzQYaQwR3Lw9OFSxPcLHlmGoWYbKrdOMYP +vBq18DE2JQoCrcC73vee2ABC3DUtqwjWYuOkuEoCbBE33u8EO5tLA84OLsb61zhe +UuBoAWnNhr+GixzMmetiZoiT3265lZnriXDqor74lEDfuoJkXs/XqBN0x8v6GmkM +ycLs7NXJOe0L +-----END CERTIFICATE----- diff --git a/kubernetes/manifests/nginx/certs/localhost.key b/kubernetes/manifests/nginx/certs/localhost.key new file mode 100644 index 0000000..94aa03f --- /dev/null +++ b/kubernetes/manifests/nginx/certs/localhost.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDeWVC4CPMt2DE0 +aI26erPvRGk2Rytmd8kpbLAGu68vkIxDu4Ojh4IS1CD8R9IjsaJGz5SaKQHhvYJL +xVFQtEcHB9A9Rk+6TNNqodHVgKFngytbAPJ0mSPRYjYCnPgVKmm9/g9O1Tza8Adn +x2zZjq4wilxymxwIASh98RJxTa6DcehRUP82ejT4KRKSAxW4+L1XUwHtw2zSain2 +dLODe0bu7CPYxCjrvr2KNMa2aPnP2Owo6djxqoHedaxZ/zpPInXq6DiofEvM1TQr +B9CjHR7OjOE65IzDh2OC2KTpVKgmcDqR/hcKKUS7/+PCNlH1tidfwJ2b33GEisLN +IWx/5RmtAgMBAAECggEAF5IpU/Ei8mu2P6OLzsZ+N7GtY6Mkzy6IpTsP6A7Scfzl +WbLRsC7H074oJwZoGP+WP+J2kucg+3DPFMA8sA0EcJLb+PrwrcPCL84qw/LoaWRG +3tVZXpHzcZlzN1Czne7KmekKb2V8l4sVheNmvyN4hM3OIhoeXRzeUYeSWG+PPgDN +KV2s1vvcBtIay7aMs6XUdnKuxea/7j/vNr1NUyc9BYFAAVxbNxmdwus5w80kc0PV +BXJOvf7SiFoOOP+V+IjrDhnJyeg6qjmzohV/ju6jhOmX9d9raotrPFESIF0CWiHB +HZHEuXibLU8RqDjjwqVD95KEJdqQpNa6dyFftLMe8QKBgQD5T/zEjkO77X4AzYZD +Sxbt/hpd+Zgg8KlJdQg636TKWAyfD3Wuq/1ExJNaBOR21nfts6wfXUGV4XfSPWgf +znfADRBej8mZIyyPxkTnHfL+NMqZo03ZjI8aQB8AZByStNYrNoZ0YIxr94HkGJ+g +y6IiX4bxkqABMD+LATMDE9m4SQKBgQDkUCu+h4o1gu9Af0sLNFMc4msrRjEDliWQ +nPeDld7FX4lB9XSOknw4sUEUS2pzcjquHpmPosJ6tjQps28IXnnm9y6KWcVEO0k/ +mrhZnRu9dbL+FQEpPVBS2c7n6tvT0Anrtqt84n5U0ZnWo+AhXVUgG8BOQ2d5V5P2 +c8dlYm7+RQKBgDn5p8Xtb0LcT1jQclBjvclKNcd0qzO9wyAZ3vgR2bhUEVtLtQoR +ZKwBKmLckGQyK2FTTstcXEwGSl7ReM0srhwy7YOP3EmILGyippM4G7GRhSuFFi1o +yj5Ieu0UWrCi7MrPuySE7yKMQ+BO+Y/iyqlDnZW/iwW7uosQlFQ64X5BAoGACWYr +htp5nB5ZzyPuaPWsfkHr+4oWNnmV7lAn+GjRFPsL4YVDWSM6rfLOJRG9vibzt3tX +AwzGSNr7ZsQWTBfnmNSQO+3aKybtqwqpkDbhj3kq9z7SH2qAxghldjK6/gtQfT21 +7Zw9ayx90tJIRddby8iYsCAiQGKUms7FZK0auKkCgYA+cU0Ju7of0QQ0Mc5qkR/H +hg09o+0rpiMzDkGUP/4qhKIA0XJ2I+gCS09irwWmYabq4zySbO7gzUh4ItdTl5XL +qYkE1HghsTiLsWSG/Brm4qH/TeMiZGQP/1O7+r/+9YKyD49jqXu3u4vzF8EiKOVo +Fh6Y4/3E2Bk0wgbWGynPMg== +-----END PRIVATE KEY----- diff --git a/kubernetes/manifests/nginx/nginx.conf b/kubernetes/manifests/nginx/nginx.conf new file mode 100644 index 0000000..e9e1861 --- /dev/null +++ b/kubernetes/manifests/nginx/nginx.conf @@ -0,0 +1,27 @@ +events { + worker_connections 1024; +} + +http { + server { + listen 80; + server_name localhost; + return 301 https://$host$request_uri; + } + + server { + listen 443 ssl; + server_name localhost; + + ssl_certificate /etc/nginx/certs/localhost.crt; + ssl_certificate_key /etc/nginx/certs/localhost.key; + + location / { + proxy_pass http://app:8000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } +} \ No newline at end of file diff --git a/monitoring/elklogs/filebeat/filebeat.yml b/monitoring/elklogs/filebeat/filebeat.yml new file mode 100644 index 0000000..e4fa961 --- /dev/null +++ b/monitoring/elklogs/filebeat/filebeat.yml @@ -0,0 +1,9 @@ +filebeat.inputs: + - type: container + paths: + - /var/lib/docker/containers/*/*.log + processors: + - add_docker_metadata: ~ + +output.elasticsearch: + hosts: ["elasticsearch:9200"] \ No newline at end of file diff --git a/monitoring/elklogs/logstash/config/jvm.options b/monitoring/elklogs/logstash/config/jvm.options new file mode 100644 index 0000000..9c56234 --- /dev/null +++ b/monitoring/elklogs/logstash/config/jvm.options @@ -0,0 +1,6 @@ +-Xms1g +-Xmx1g +-Djava.awt.headless=true +-Dfile.encoding=UTF-8 +-XX:+HeapDumpOnOutOfMemoryError +-Djava.security.egd=file:/dev/urandom diff --git a/monitoring/grafana-dashboards/dashboard.json b/monitoring/grafana-dashboards/dashboard.json new file mode 100644 index 0000000..8172914 --- /dev/null +++ b/monitoring/grafana-dashboards/dashboard.json @@ -0,0 +1,23 @@ +{ + "dashboard": { + "title": "DevOps Windows Dashboard", + "panels": [ + { + "title": "Requêtes HTTP", + "type": "graph", + "targets": [{ + "expr": "rate(http_requests_total[5m])", + "legendFormat": "{{method}} {{endpoint}}" + }] + }, + { + "title": "Latence", + "type": "graph", + "targets": [{ + "expr": "histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))", + "legendFormat": "p95" + }] + } + ] + } +} diff --git a/postgresql/init.sql b/postgresql/init.sql new file mode 100644 index 0000000..6c8696b --- /dev/null +++ b/postgresql/init.sql @@ -0,0 +1,10 @@ +CREATE TABLE IF NOT EXISTS users ( + id SERIAL PRIMARY KEY, + name VARCHAR(100), + email VARCHAR(100) UNIQUE +); + +INSERT INTO users (name, email) VALUES + ('Alice', 'alice@example.com'), + ('Bob', 'bob@example.com') +ON CONFLICT (email) DO NOTHING; \ No newline at end of file diff --git a/scripts/GenerKubConf.ps1 b/scripts/GenerKubConf.ps1 new file mode 100644 index 0000000..e427980 --- /dev/null +++ b/scripts/GenerKubConf.ps1 @@ -0,0 +1,44 @@ +# Activer le proxy +Start-Process kubectl -ArgumentList "proxy" -WindowStyle Hidden + +# Créer le ServiceAccount +kubectl create serviceaccount dashboard-admin -n kubernetes-dashboard --force + +# Lui donner les droits admin +kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:dashboard-admin --force + +# Générer le jeton +$Token = kubectl create token dashboard-admin -n kubernetes-dashboard + +# Informations du cluster +$ClusterName = kubectl config current-context +$Server = kubectl config view -o jsonpath="{.clusters[?(@.name==`"$ClusterName`")].cluster.server}" +$CACert = kubectl config view -o jsonpath="{.clusters[?(@.name==`"$ClusterName`")].cluster.certificate-authority-data}" + +# Générer le kubeconfig avec token uniquement (pas de certificats) +$Kubeconfig = @" +apiVersion: v1 +kind: Config +clusters: +- name: $ClusterName + cluster: + server: $Server + certificate-authority-data: $CACert +contexts: +- name: $ClusterName + context: + cluster: $ClusterName + user: dashboard-admin +current-context: $ClusterName +users: +- name: dashboard-admin + user: + token: $Token +"@ + +# Sauvegarder +$Kubeconfig | Out-File -FilePath "C:\DevOpsProject\scripts\dashboard.kubeconfig" -Encoding UTF8 + +Write-Host "✅ kubeconfig généré : C:\DevOpsProject\scripts\dashboard.kubeconfig" +Write-Host "Accédez au dashboard : http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/" +Write-Host "→ Choisissez 'Kubeconfig' et sélectionnez le fichier." \ No newline at end of file diff --git a/scripts/cleanup.ps1 b/scripts/cleanup.ps1 new file mode 100644 index 0000000..6b9e529 --- /dev/null +++ b/scripts/cleanup.ps1 @@ -0,0 +1,83 @@ +# Nettoyage complet DevOps Stack +Write-Host "🧹 NETTOYAGE DEVOPS STACK" -ForegroundColor Yellow +Write-Host "==========================" -ForegroundColor Yellow +Write-Host "" + +# 1. Arrêter Docker Compose +Write-Host "[1/4] Arrêt Docker Compose..." -ForegroundColor Yellow +try { + if (Test-Path "..\docker\docker-compose.yml") { + Set-Location "..\docker" + docker-compose down -v # -v pour supprimer les volumes + Write-Host " ✅ Docker Compose arrêté" -ForegroundColor Green + Set-Location $PSScriptRoot + } +} catch { + Write-Host " ⚠️ Aucun service Docker Compose en cours" -ForegroundColor Gray +} + +# 2. Nettoyer Kubernetes +Write-Host "[2/4] Nettoyage Kubernetes..." -ForegroundColor Yellow +try { + # Supprimer le namespace (supprime tout à l'intérieur) + kubectl delete namespace devops-demo --ignore-not-found=true + kubectl delete namespace terraform-ns --ignore-not-found=true + + # Désinstaller Helm + helm uninstall devops-release --namespace devops-demo --ignore-not-found=true + + Write-Host " ✅ Kubernetes nettoyé" -ForegroundColor Green +} catch { + Write-Host " ⚠️ Kubernetes non configuré ou déjà nettoyé" -ForegroundColor Gray +} + +# 3. Nettoyer Docker +Write-Host "[3/4] Nettoyage Docker..." -ForegroundColor Yellow +try { + # Arrêter tous les conteneurs + docker stop $(docker ps -aq) 2>$null + + # Supprimer tous les conteneurs + docker rm $(docker ps -aq) 2>$null + + # Supprimer toutes les images + docker rmi $(docker images -q) -f 2>$null + + # Nettoyer le système + docker system prune -a -f --volumes + + Write-Host " ✅ Docker nettoyé" -ForegroundColor Green +} catch { + Write-Host " ℹ️ Aucune ressource Docker à nettoyer" -ForegroundColor Gray +} + +# 4. Nettoyer Terraform +Write-Host "[4/4] Nettoyage Terraform..." -ForegroundColor Yellow +try { + if (Test-Path "..\terraform") { + Set-Location "..\terraform" + + # Détruire l'infrastructure si terraform.tfstate existe + if (Test-Path "terraform.tfstate") { + terraform destroy -auto-approve 2>$null + } + + # Supprimer les fichiers temporaires + Remove-Item -Path "*.tfstate*", ".terraform*", "terraform.tfstate.backup" -Force -ErrorAction SilentlyContinue + + Write-Host " ✅ Terraform nettoyé" -ForegroundColor Green + Set-Location $PSScriptRoot + } +} catch { + Write-Host " ℹ️ Terraform non configuré" -ForegroundColor Gray +} + +Write-Host "" +Write-Host "========================================" -ForegroundColor Green +Write-Host " NETTOYAGE TERMINÉ !" -ForegroundColor Green +Write-Host "========================================" -ForegroundColor Green +Write-Host "" +Write-Host "✅ Toutes les ressources ont été nettoyées" -ForegroundColor Green +Write-Host "" +Write-Host "Pour recommencer :" -ForegroundColor Cyan +Write-Host " .\setup.ps1" -ForegroundColor Gray \ No newline at end of file diff --git a/scripts/dashboard.kubeconfig b/scripts/dashboard.kubeconfig new file mode 100644 index 0000000..e9d1447 --- /dev/null +++ b/scripts/dashboard.kubeconfig @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Config +clusters: +- name: docker-desktop + cluster: + server: https://kubernetes.docker.internal:6443 + certificate-authority-data: DATA+OMITTED +contexts: +- name: docker-desktop + context: + cluster: docker-desktop + user: dashboard-admin +current-context: docker-desktop +users: +- name: dashboard-admin + user: + token: eyJhbGciOiJSUzI1NiIsImtpZCI6Ikt1VTA5b0ZjYXNUS050T1ZkVFRhTVlIRXBzLU9MMEdnaWZqdDZjSTRLRDAifQ.eyJhdWQiOlsiaHR0cHM6Ly9rdWJlcm5ldGVzLmRlZmF1bHQuc3ZjLmNsdXN0ZXIubG9jYWwiXSwiZXhwIjoxNzY5MTAxMDkxLCJpYXQiOjE3NjkwOTc0OTEsImlzcyI6Imh0dHBzOi8va3ViZXJuZXRlcy5kZWZhdWx0LnN2Yy5jbHVzdGVyLmxvY2FsIiwianRpIjoiZmY1MTZiZmQtNTE2Mi00ZjFlLWFjNzEtMTg5ODQ5Yzg1Y2E0Iiwia3ViZXJuZXRlcy5pbyI6eyJuYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsInNlcnZpY2VhY2NvdW50Ijp7Im5hbWUiOiJkYXNoYm9hcmQtYWRtaW4iLCJ1aWQiOiI5NDM4MGYwNy05ZTQ0LTQxOTAtOTc5Zi00M2Q0NTQyMDk2ZTEifX0sIm5iZiI6MTc2OTA5NzQ5MSwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmVybmV0ZXMtZGFzaGJvYXJkOmRhc2hib2FyZC1hZG1pbiJ9.C1d-ptxZRymbqpyuy2AWRMilcnWDc63XAN7eYcTQkeuJGb6CNqF0uefYpzBNumdBmyjlkGlRfeCezLjJ4G1_jP_H5c3VWx8temZWDJYOAXRVNogD7ebdLJ21lvRWFXcT_m4Sttp__ysjYX6gi0EuKOC7srWIthfaHC-1n9yXlyCDUtwSPrxoIkvmh___hrIIzLHlq1wsQpIZ_FqE9P9MYV_zhRc1X5YL9wIVDAmwJ1nYzF0KEgmR5cVNHTHr-ri7oLcxjvRgQkwtbdAXRRfUP99MnEzq27sskcZ430UZQfXO2VH9gaUkMqu035yqCEmUueDNc5eYPzsBTtD9tOM5mw diff --git a/scripts/setup.ps1 b/scripts/setup.ps1 new file mode 100644 index 0000000..be37b95 --- /dev/null +++ b/scripts/setup.ps1 @@ -0,0 +1,181 @@ +# DevOps Windows Setup Script +# PowerShell 5.1+ requis + +param( + [switch]$SkipDocker = $false, + [switch]$SkipK8s = $false, + [switch]$Help = $false +) + +if ($Help) { + Write-Host "Usage: .\setup.ps1 [-SkipDocker] [-SkipK8s] [-Help]" -ForegroundColor Cyan + Write-Host " -SkipDocker : Ne pas démarrer Docker Compose" -ForegroundColor Gray + Write-Host " -SkipK8s : Ne pas déployer sur Kubernetes" -ForegroundColor Gray + Write-Host " -Help : Afficher cette aide" -ForegroundColor Gray + exit 0 +} + +Write-Host "========================================" -ForegroundColor Green +Write-Host " DEVOPS WINDOWS SETUP" -ForegroundColor Green +Write-Host "========================================" -ForegroundColor Green +Write-Host "" + +# 1. Vérification des outils +Write-Host "[1/5] Vérification des outils..." -ForegroundColor Yellow + +$tools = @( + @{Name="Docker"; Cmd="docker --version"}, + @{Name="kubectl"; Cmd="kubectl version --client"}, + @{Name="helm"; Cmd="helm version"}, + @{Name="python"; Cmd="python --version"} +) + +foreach ($tool in $tools) { + try { + $output = Invoke-Expression $tool.Cmd 2>&1 + Write-Host " ✅ $($tool.Name) : OK" -ForegroundColor Green + } catch { + Write-Host " ❌ $($tool.Name) : MANQUANT" -ForegroundColor Red + Write-Host " Installez avec: choco install $($tool.Name.ToLower())" -ForegroundColor Gray + } +} + +Write-Host "" + +# 2. Build de l'application +Write-Host "[2/5] Build de l'application Docker..." -ForegroundColor Yellow +try { + Set-Location "$PSScriptRoot\..\src\app" + docker build -t devops-app:local . + Write-Host " ✅ Image Docker construite" -ForegroundColor Green + Set-Location $PSScriptRoot +} catch { + Write-Host " ❌ Erreur lors du build Docker" -ForegroundColor Red + Write-Host $_.Exception.Message + exit 1 +} + +# 3. Docker Compose +if (-not $SkipDocker) { + Write-Host "[3/5] Démarrage Docker Compose..." -ForegroundColor Yellow + try { + Set-Location "$PSScriptRoot\..\docker" + + # Arrêter si déjà en cours + docker-compose down 2>$null + + # Démarrer + docker-compose up -d + + # Attendre que les services soient prêts + Start-Sleep -Seconds 10 + + Write-Host " ✅ Docker Compose démarré" -ForegroundColor Green + Write-Host " Attente supplémentaire pour les services..." -ForegroundColor Gray + + # Vérifier l'application + $attempts = 0 + $maxAttempts = 6 + while ($attempts -lt $maxAttempts) { + try { + $response = Invoke-WebRequest -Uri "http://localhost:8000/health" -UseBasicParsing -TimeoutSec 5 + if ($response.StatusCode -eq 200) { + Write-Host " ✅ Application accessible" -ForegroundColor Green + break + } + } catch { + $attempts++ + Write-Host " ⏳ Tentative $attempts/$maxAttempts..." -ForegroundColor Yellow + Start-Sleep -Seconds 10 + + if ($attempts -eq $maxAttempts) { + Write-Host " ⚠️ Application lente à démarrer" -ForegroundColor Yellow + } + } + } + + Set-Location $PSScriptRoot + } catch { + Write-Host " ⚠️ Erreur Docker Compose : $($_.Exception.Message)" -ForegroundColor Yellow + Set-Location $PSScriptRoot + } +} + +# 4. Kubernetes +if (-not $SkipK8s) { + Write-Host "[4/5] Déploiement Kubernetes..." -ForegroundColor Yellow + try { + Set-Location "$PSScriptRoot\..\kubernetes\manifests" + + # Vérifier que Kubernetes est activé + $k8sContext = kubectl config current-context 2>$null + if ($LASTEXITCODE -ne 0) { + Write-Host " ℹ️ Kubernetes non configuré, passage au mode Docker uniquement" -ForegroundColor Yellow + } else { + # Appliquer les manifests + kubectl apply -f namespace.yaml + kubectl apply -f configmap.yaml + kubectl apply -f deployment.yaml + + Write-Host " ✅ Déploiement Kubernetes terminé" -ForegroundColor Green + + # Obtenir les infos + $service = kubectl get svc -n devops-demo devops-app-service -o json | ConvertFrom-Json + $nodePort = $service.spec.ports[0].nodePort + Write-Host " Accès K8s : http://localhost:$nodePort" -ForegroundColor Cyan + } + + Set-Location $PSScriptRoot + } catch { + Write-Host " ⚠️ Erreur Kubernetes : $($_.Exception.Message)" -ForegroundColor Yellow + Set-Location $PSScriptRoot + } +} + +Write-Host "[5/5] Récapitulatif..." -ForegroundColor Yellow +Write-Host "" +Write-Host "========================================" -ForegroundColor Green +Write-Host " SETUP TERMINÉ !" -ForegroundColor Green +Write-Host "========================================" -ForegroundColor Green +Write-Host "" +Write-Host "🌐 ACCèS AUX SERVICES :" -ForegroundColor White +Write-Host "" +Write-Host " 📊 Application FastAPI :" -ForegroundColor Cyan +Write-Host " • Interface : http://localhost:8000" -ForegroundColor Gray +Write-Host " • Health : http://localhost:8000/health" -ForegroundColor Gray +Write-Host " • Docs : http://localhost:8000/docs" -ForegroundColor Gray +Write-Host " • Métriques : http://localhost:8000/metrics" -ForegroundColor Gray +Write-Host "" +Write-Host " 📈 Monitoring :" -ForegroundColor Cyan +Write-Host " • Prometheus : http://localhost:9090" -ForegroundColor Gray +Write-Host " • Grafana : http://localhost:3000" -ForegroundColor Gray +Write-Host " Login : admin / admin123" -ForegroundColor DarkGray +Write-Host "" +Write-Host " 🐳 Gestion Docker :" -ForegroundColor Cyan +Write-Host " • Portainer : http://localhost:9000" -ForegroundColor Gray +Write-Host "" +if (-not $SkipK8s) { + Write-Host " ☸️ Kubernetes :" -ForegroundColor Cyan + Write-Host " • Vérifier : kubectl get pods -n devops-demo" -ForegroundColor Gray + Write-Host " • Logs : kubectl logs -f -n devops-demo -l app=devops-app" -ForegroundColor Gray +} +Write-Host "" +Write-Host "🔧 COMMANDES UTILES :" -ForegroundColor White +Write-Host " * Voir les logs : docker-compose logs -f [app|prometheus|grafana]" -ForegroundColor DarkGray +Write-Host " * Arrêter tout : docker-compose down" -ForegroundColor DarkGray +Write-Host " * Nettoyer : docker system prune -a -f --volumes" -ForegroundColor DarkGray +Write-Host "" +Write-Host "💡 CONSEIL :" -ForegroundColor Yellow +Write-Host " Testez avec : curl http://localhost:8000 ou dans PowerShell :" -ForegroundColor Gray +Write-Host " Invoke-WebRequest -Uri 'http://localhost:8000' -UseBasicParsing" -ForegroundColor DarkGray +Write-Host "" + +# Test automatique +try { + $test = Invoke-WebRequest -Uri "http://localhost:8000/health" -UseBasicParsing -TimeoutSec 5 + if ($test.StatusCode -eq 200) { + Write-Host "✅ Test de santé réussi !" -ForegroundColor Green + } +} catch { + Write-Host "⚠️ L'application n'est pas encore accessible, patientez..." -ForegroundColor Yellow +} \ No newline at end of file diff --git a/scripts/start_other_ctnrs.ps1 b/scripts/start_other_ctnrs.ps1 new file mode 100644 index 0000000..44db06a --- /dev/null +++ b/scripts/start_other_ctnrs.ps1 @@ -0,0 +1,20 @@ +# Définit le chemin vers le dossier contenant tous tes fichiers docker-compose.yml +$projectPath = "C:\DevOpsProject\docker" + +# La liste de tous tes fichiers docker-compose YAML à lancer +$composeFiles = @( + "docker-compose-db.yml", + "docker-compose-elk.yml", + "docker-compose-gitea.yml", + "docker-compose-nginx.yml" +) + +# Pour chaque fichier dans la liste +foreach ($file in $composeFiles) { + # Lance une nouvelle instance de 'docker-compose' pour ce fichier, en mode détaché (-d) + # Start-Process permet de lancer la commande en arrière-plan, sans bloquer le script + Start-Process -NoNewWindow -FilePath "docker-compose" -ArgumentList "-f `"$projectPath\$file`" up -d" +} + +# Affiche un message une fois tous les containers lancés +Write-Host "Tous les environnements ont été lancés." \ No newline at end of file diff --git a/src/app/Dockerfile b/src/app/Dockerfile new file mode 100644 index 0000000..cd08fbb --- /dev/null +++ b/src/app/Dockerfile @@ -0,0 +1,66 @@ +# ========================== +# STAGE 1 : Construction +# ========================== +FROM python:3.11-slim AS builder + +WORKDIR /app + +# Installer les dépendances système +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + libpq-dev \ + gcc \ + postgresql-client \ + && rm -rf /var/lib/apt/lists/* + +# Créer un environnement virtuel +RUN python -m venv /venv +ENV PATH="/venv/bin:$PATH" + +# Installer les dépendances +COPY src/app/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + + +# ========================== +# STAGE 2 : Production +# ========================== +FROM python:3.11-slim AS runtime + +# Définir le répertoire de travail +WORKDIR /app + +# Installer les bibliothèques système +RUN apt-get update && apt-get install -y --no-install-recommends \ + libpq5 \ + && rm -rf /var/lib/apt/lists/* + +# 🔥 Installe curl ici +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* + + +# Créer un utilisateur non-root +RUN useradd -m -u 1000 devopsuser + +# Copier l'environnement virtuel +COPY --from=builder /venv /venv +ENV PATH="/venv/bin:$PATH" + +# Copier le code +COPY src/app /app + +# Changer les droits +RUN chown -R devopsuser:devopsuser /app +USER devopsuser + +# Variables d'environnement +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 +ENV ENV=production +ENV HOSTNAME=devops-container +ENV PYTHONPATH="${PYTHONPATH}:/app" + +EXPOSE 8000 + +# Lancer l'application +CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--no-access-log"] \ No newline at end of file diff --git a/src/app/__init__.py b/src/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/app/database.py b/src/app/database.py new file mode 100644 index 0000000..47c72be --- /dev/null +++ b/src/app/database.py @@ -0,0 +1,11 @@ +import psycopg2 +from psycopg2.extras import RealDictCursor + +def get_db_connection(): + conn = psycopg2.connect( + host="db", + database="devopsdb", + user="devopsuser", + password="devopspass" + ) + return conn \ No newline at end of file diff --git a/src/app/main.py b/src/app/main.py new file mode 100644 index 0000000..78e3c0b --- /dev/null +++ b/src/app/main.py @@ -0,0 +1,153 @@ +# ========================== +# IMPORTS DES DÉPENDANCES +# ========================== +from fastapi import FastAPI, Request, HTTPException, Response +from prometheus_client import Counter, Histogram, generate_latest, CONTENT_TYPE_LATEST +import time +import os +import logging +from typing import Dict + +# Import du routeur pour /users +from routes import router as routes_app + +# ========================== +# CONFIGURATION DE L'APPLICATION +# ========================== +# Configuration du logging +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +# Création de l'application FastAPI +app = FastAPI( + title="DevOps Windows API", + description="Application de démonstration DevOps sous Windows", + version="1.0.0" +) + +# Inclusion du routeur (doit être après la création de 'app') +app.include_router(routes_app, prefix="/users", tags=["users"]) + +# ========================== +# MÉTRIQUES PROMETHEUS +# ========================== +REQUEST_COUNT = Counter( + 'http_requests_total', + 'Total des requêtes HTTP', + ['method', 'endpoint', 'status'] +) + +REQUEST_LATENCY = Histogram( + 'http_request_duration_seconds', + 'Temps de réponse HTTP', + ['method', 'endpoint'] +) + +# ========================== +# MIDDLEWARE DE MONITORING +# ========================== +@app.middleware("http") +async def monitor_requests(request: Request, call_next): + """Middleware pour suivre les requêtes et mesurer la latence.""" + start_time = time.time() + + try: + response = await call_next(request) + status_code = str(response.status_code) + except Exception as e: + status_code = "500" + response = Response( + content=f"Erreur serveur : {str(e)}", + status_code=500 + ) + + process_time = time.time() - start_time + + # Enregistrement des métriques + REQUEST_COUNT.labels( + method=request.method, + endpoint=request.url.path, + status=status_code + ).inc() + + REQUEST_LATENCY.labels( + method=request.method, + endpoint=request.url.path + ).observe(process_time) + + # Ajout du temps de traitement dans les headers + response.headers["X-Process-Time"] = f"{process_time:.3f}s" + + return response + +# ========================== +# ENDPOINTS PRINCIPAUX +# ========================== + +@app.get("/") +async def home(): + """Endpoint racine - Statut de l'application.""" + return { + "message": "🚀 DevOps Stack Windows - Fonctionnel !", + "environment": os.getenv("ENV", "development"), + "status": "running", + "hostname": os.getenv("HOSTNAME", "windows-devops"), + "version": "1.0.0" + } + +@app.get("/health") +async def health(): + """Health check pour Kubernetes.""" + return { + "status": "healthy", + "timestamp": time.time(), + "service": "devops-app" + } + +@app.get("/metrics") +async def metrics(): + """Endpoint pour Prometheus.""" + try: + data = generate_latest() + return Response( + content=data, + media_type=CONTENT_TYPE_LATEST, + headers={"Cache-Control": "no-cache"} + ) + except Exception as e: + logger.error(f"Erreur lors de la génération des métriques : {e}") + raise HTTPException(status_code=500, detail="Échec de la génération des métriques") + +@app.get("/info") +async def info(): + """Informations système.""" + return { + "python_version": "3.11", + "platform": "windows", + "service": "FastAPI DevOps", + "features": ["docker", "kubernetes", "monitoring", "ci-cd"] + } + +@app.get("/env") +async def show_env(): + """Affiche les variables d'environnement (sécurisées).""" + safe_env = { + "ENV": os.getenv("ENV", "not-set"), + "HOSTNAME": os.getenv("HOSTNAME", "not-set"), + "PYTHON_VERSION": os.getenv("PYTHON_VERSION", "not-set") + } + return safe_env + +# ========================== +# LANCEMENT EN DÉVELOPPEMENT +# ========================== +if __name__ == "__main__": + import uvicorn + logger.info("Démarrage du serveur FastAPI...") + uvicorn.run( + app, + host="0.0.0.0", + port=8000, + log_level="info", + reload=True # Auto-reload en dev + ) \ No newline at end of file diff --git a/src/app/requirements.txt b/src/app/requirements.txt new file mode 100644 index 0000000..2b9cb27 --- /dev/null +++ b/src/app/requirements.txt @@ -0,0 +1,8 @@ +fastapi==0.104.1 +uvicorn[standard]==0.24.0 +pydantic==2.5.0 +prometheus-client==0.19.0 +python-dotenv==1.0.0 +pytest==7.4.3 +httpx==0.25.1 +psycopg2==2.9.9 diff --git a/src/app/routes.py b/src/app/routes.py new file mode 100644 index 0000000..92ddd12 --- /dev/null +++ b/src/app/routes.py @@ -0,0 +1,23 @@ +from fastapi import APIRouter +from psycopg2.extras import RealDictCursor +from database import get_db_connection + +router = APIRouter() + +@router.get("/users") +async def get_users(): + conn = get_db_connection() + cursor = conn.cursor(cursor_factory=RealDictCursor) + cursor.execute("SELECT * FROM users") + rows = cursor.fetchall() + conn.close() + return rows + +@router.post("/users") +async def add_user(name: str, email: str): + conn = get_db_connection() + cursor = conn.cursor() + cursor.execute("INSERT INTO users (name, email) VALUES (%s, %s) ON CONFLICT (email) DO NOTHING", (name, email)) + conn.commit() + conn.close() + return {"status": "success"} \ No newline at end of file diff --git a/src/app/test_main.py b/src/app/test_main.py new file mode 100644 index 0000000..e7b199c --- /dev/null +++ b/src/app/test_main.py @@ -0,0 +1,44 @@ +import pytest +from fastapi.testclient import TestClient +from main import app + +client = TestClient(app) + +def test_home_endpoint(): + """Test de l'endpoint principal""" + response = client.get("/") + assert response.status_code == 200 + data = response.json() + assert "message" in data + assert "status" in data + assert data["status"] == "running" + +def test_health_endpoint(): + """Test du health check""" + response = client.get("/health") + assert response.status_code == 200 + data = response.json() + assert data["status"] == "healthy" + assert "service" in data + +def test_metrics_endpoint(): + """Test des métriques Prometheus""" + response = client.get("/metrics") + assert response.status_code == 200 + assert "text/plain" in response.headers["content-type"] + assert "http_requests_total" in response.text + +def test_info_endpoint(): + """Test des informations""" + response = client.get("/info") + assert response.status_code == 200 + data = response.json() + assert "python_version" in data + assert "platform" in data + +def test_env_endpoint(): + """Test des variables d'environnement""" + response = client.get("/env") + assert response.status_code == 200 + data = response.json() + assert "ENV" in data \ No newline at end of file diff --git a/terraform/main.tf b/terraform/main.tf new file mode 100644 index 0000000..1b0e46c --- /dev/null +++ b/terraform/main.tf @@ -0,0 +1,114 @@ +# Terraform minimal pour Windows - KUBERNETES UNIQUEMENT +terraform { + required_version = ">= 1.5.0" + + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + version = "~> 2.23" + } + } +} + +# Provider Kubernetes avec Docker Desktop +provider "kubernetes" { + config_path = "~/.kube/config" + config_context = "docker-desktop" +} + +# Namespace +resource "kubernetes_namespace" "devops" { + metadata { + name = "terraform-ns" + + labels = { + created-by = "terraform" + environment = "development" + } + } +} + +# Déploiement simple +resource "kubernetes_deployment" "app" { + metadata { + name = "terraform-app" + namespace = kubernetes_namespace.devops.metadata[0].name + + labels = { + app = "terraform-app" + } + } + + spec { + replicas = 1 + + selector { + match_labels = { + app = "terraform-app" + } + } + + template { + metadata { + labels = { + app = "terraform-app" + } + } + + spec { + container { + name = "app" + image = "nginx:alpine" # Image simple pour test + + port { + container_port = 80 + } + + resources { + limits = { + cpu = "100m" + memory = "128Mi" + } + requests = { + cpu = "50m" + memory = "64Mi" + } + } + } + } + } + } + + depends_on = [kubernetes_namespace.devops] +} + +# Service +resource "kubernetes_service" "app" { + metadata { + name = "terraform-service" + namespace = kubernetes_namespace.devops.metadata[0].name + } + + spec { + selector = { + app = kubernetes_deployment.app.spec[0].template[0].metadata[0].labels.app + } + + port { + port = 8080 + target_port = 80 + } + + type = "NodePort" + } +} + +# Output utile +output "application_url" { + value = "http://localhost:${kubernetes_service.app.spec[0].port[0].node_port}" +} + +output "namespace" { + value = kubernetes_namespace.devops.metadata[0].name +} +