Files
roa2web-service-auto/nginx/scripts/ssl-renew.sh
Marius Mutu 6b13ffa183 Initial commit: ROA2WEB - FastAPI + Vue.js + Telegram Bot
Modern ERP Reports Application with microservices architecture

Tech Stack:
- Backend: FastAPI + python-oracledb (Oracle DB integration)
- Frontend: Vue.js 3 + PrimeVue + Vite
- Telegram Bot: python-telegram-bot + SQLite
- Infrastructure: Shared database pool, JWT authentication, SSH tunnel

Features:
- FastAPI backend with async Oracle connection pool
- Vue.js 3 responsive frontend with PrimeVue components
- Telegram bot alternative interface
- Microservices architecture with shared components
- Complete deployment support (Linux Docker + Windows IIS)
- Comprehensive testing (Playwright E2E + pytest)

Repository Structure:
- reports-app/ - Main application (backend, frontend, telegram-bot)
- shared/ - Shared components (database pool, auth, utils)
- deployment/ - Deployment scripts (Linux & Windows)
- docs/ - Project documentation
- security/ - Security scanning and git hooks
2025-10-25 14:55:08 +03:00

48 lines
1.3 KiB
Bash

#!/bin/sh
# SSL certificate renewal script for Let's Encrypt
set -e
# Configuration
DOMAIN=${DOMAIN:-localhost}
EMAIL=${SSL_EMAIL:-admin@roa2web.local}
WEBROOT_PATH=/var/www/certbot
# Function to log messages
log() {
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1"
}
# Check if running in production
if [ "$ENVIRONMENT" = "production" ]; then
log "Starting SSL certificate renewal for domain: $DOMAIN"
# Initial certificate generation
if [ ! -f "/etc/letsencrypt/live/$DOMAIN/fullchain.pem" ]; then
log "Generating initial SSL certificate..."
certbot certonly \
--webroot \
--webroot-path=$WEBROOT_PATH \
--email=$EMAIL \
--agree-tos \
--no-eff-email \
--force-renewal \
-d $DOMAIN
fi
# Renew certificates
log "Attempting certificate renewal..."
certbot renew --webroot --webroot-path=$WEBROOT_PATH
# Reload nginx if certificates were renewed
if [ $? -eq 0 ]; then
log "Certificate renewal successful, reloading nginx..."
nginx -s reload
else
log "Certificate renewal failed or not needed"
fi
else
log "Not in production environment, skipping SSL renewal"
fi
log "SSL renewal script completed"