Initialisation depot

This commit is contained in:
Serge NOEL
2026-02-10 12:12:11 +01:00
commit c3176e8d79
818 changed files with 52573 additions and 0 deletions

89
arti-api/setup-full-stack.sh Executable file
View File

@@ -0,0 +1,89 @@
#!/bin/bash
# Complete Artifactory Setup with Authentication
# This script sets up the full artifactory stack with Chart Museum authentication
set -e
echo "🚀 Setting up Complete Artifactory Stack with Authentication..."
echo ""
# Build the Arti-API container
echo "📦 Building Arti-API container..."
docker build -t arti-api:latest .
# Start the complete stack
echo "🔧 Starting the complete artifactory stack..."
docker-compose -f docker-compose-full.yaml up -d
# Wait for services to be ready
echo "⏳ Waiting for services to start..."
sleep 15
# Create initial users
echo "👥 Creating initial users..."
# Check if Arti-API is ready
until curl -s http://localhost:8000/health > /dev/null; do
echo " Waiting for Arti-API to be ready..."
sleep 5
done
# Create admin user
echo " Creating admin user..."
curl -s -X POST "http://localhost:8000/users" \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "admin123"}' > /dev/null
# Create developer user
echo " Creating developer user..."
curl -s -X POST "http://localhost:8000/users" \
-H "Content-Type: application/json" \
-d '{"username": "developer", "password": "dev123"}' > /dev/null
# Create readonly user
echo " Creating readonly user..."
curl -s -X POST "http://localhost:8000/users" \
-H "Content-Type: application/json" \
-d '{"username": "readonly", "password": "read123"}' > /dev/null
echo ""
echo "✅ Artifactory stack setup complete!"
echo ""
echo "🌐 Services Available:"
echo " 📖 Arti-API (Management): http://localhost:8000"
echo " 📚 API Documentation: http://localhost:8000/docs"
echo " ⛵ Chart Museum: http://localhost:8080"
echo " 🐳 Docker Registry: http://localhost:5000"
echo ""
echo "🔐 Default Users Created:"
echo " 👑 admin:admin123 (Full access)"
echo " 👨‍💻 developer:dev123 (Development access)"
echo " 👀 readonly:read123 (Read-only access)"
echo ""
echo "🧪 Test Commands:"
echo ""
echo " # Test Chart Museum with authentication:"
echo " curl -u admin:admin123 http://localhost:8080/api/charts"
echo ""
echo " # Test Docker Registry with authentication:"
echo " docker login localhost:5000"
echo " # Username: admin, Password: admin123"
echo ""
echo " # Add Helm repository with authentication:"
echo " helm repo add myrepo http://admin:admin123@localhost:8080"
echo ""
echo " # List users via API:"
echo " curl http://localhost:8000/users"
echo ""
echo "📋 Management:"
echo " # Stop all services:"
echo " docker-compose -f docker-compose-full.yaml down"
echo ""
echo " # View logs:"
echo " docker-compose -f docker-compose-full.yaml logs -f"
echo ""
echo " # Manage users via API:"
echo " curl -X POST http://localhost:8000/users -H 'Content-Type: application/json' -d '{\"username\": \"newuser\", \"password\": \"newpass\"}'"
echo ""
echo "🎉 Your authenticated artifactory is ready!"