SOGOMS v1.0.3 - Admin UI, Cron, Config reload
Phase 13 : sogoms-cron
- Jobs planifiés avec schedule cron standard
- Types: query_email, http, service
- Actions: list, trigger, status
Phase 16 : Réorganisation config/apps/{app}/
- Tous les fichiers d'une app dans un seul dossier
- Migration prokov vers nouvelle structure
Phase 17 : sogoms-admin
- Interface web d'administration (Go templates + htmx)
- Auth sessions cookies signées HMAC-SHA256
- Rôles super_admin / app_admin avec permissions
Phase 19 : Création d'app via Admin UI
- Formulaire création app avec config DB/auth
- Bouton "Scanner la base" : introspection + schema.yaml
- Rechargement automatique sogoway via SIGHUP
Infrastructure :
- sogoctl : socket de contrôle /run/sogoctl.sock
- sogoway : reload config sur SIGHUP sans restart
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
70
deploy-admin.sh
Executable file
70
deploy-admin.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script de déploiement des templates admin pour SOGOMS
|
||||
# Déploie uniquement les templates HTML sans recompilation
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Configuration SSH
|
||||
JUMP_USER="root"
|
||||
JUMP_HOST="195.154.80.116"
|
||||
JUMP_PORT="22"
|
||||
JUMP_KEY="/home/pierre/.ssh/id_rsa_mbpi"
|
||||
|
||||
# Configuration Incus
|
||||
INCUS_PROJECT="default"
|
||||
INCUS_CONTAINER="gw3"
|
||||
|
||||
# Chemin des templates sur le container
|
||||
REMOTE_TEMPLATES="/config/admin/templates"
|
||||
|
||||
# Couleurs
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
echo_step() { echo -e "${GREEN}==>${NC} $1"; }
|
||||
echo_info() { echo -e "${BLUE}Info:${NC} $1"; }
|
||||
|
||||
# Répertoire du script
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
TEMPLATES_DIR="${SCRIPT_DIR}/cmd/sogoms/admin/templates"
|
||||
|
||||
if [ ! -d "$TEMPLATES_DIR" ]; then
|
||||
echo "Error: templates directory not found: $TEMPLATES_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Commandes SSH/SCP
|
||||
SSH_CMD="ssh -i ${JUMP_KEY} -p ${JUMP_PORT} ${JUMP_USER}@${JUMP_HOST}"
|
||||
SCP_CMD="scp -i ${JUMP_KEY} -P ${JUMP_PORT}"
|
||||
|
||||
# Créer archive des templates
|
||||
echo_step "Creating templates archive..."
|
||||
TIMESTAMP=$(date +%s)
|
||||
ARCHIVE="sogoms-templates-${TIMESTAMP}.tar.gz"
|
||||
tar -czf "/tmp/${ARCHIVE}" -C "${TEMPLATES_DIR}" .
|
||||
echo_info "Archive: $(du -h /tmp/${ARCHIVE} | cut -f1)"
|
||||
|
||||
# Copier vers IN3
|
||||
echo_step "Copying to jump server..."
|
||||
$SCP_CMD "/tmp/${ARCHIVE}" "${JUMP_USER}@${JUMP_HOST}:/tmp/"
|
||||
|
||||
# Déployer sur gw3
|
||||
echo_step "Deploying templates to ${INCUS_CONTAINER}..."
|
||||
$SSH_CMD "
|
||||
incus project switch ${INCUS_PROJECT}
|
||||
incus file push /tmp/${ARCHIVE} ${INCUS_CONTAINER}/tmp/
|
||||
incus exec ${INCUS_CONTAINER} -- mkdir -p ${REMOTE_TEMPLATES}/partials
|
||||
incus exec ${INCUS_CONTAINER} -- tar -xzf /tmp/${ARCHIVE} -C ${REMOTE_TEMPLATES}/
|
||||
incus exec ${INCUS_CONTAINER} -- rm -f /tmp/${ARCHIVE}
|
||||
rm -f /tmp/${ARCHIVE}
|
||||
echo 'Templates deployed to ${REMOTE_TEMPLATES}'
|
||||
incus exec ${INCUS_CONTAINER} -- ls -la ${REMOTE_TEMPLATES}/
|
||||
"
|
||||
|
||||
# Cleanup local
|
||||
rm -f "/tmp/${ARCHIVE}"
|
||||
|
||||
echo_step "Done! Templates deployed."
|
||||
echo_info "Dev mode: templates reload automatically on each request."
|
||||
Reference in New Issue
Block a user