smart_ide/scripts/install-smart-ide-gateway-systemd-user.sh
Nicolas Cantu 940cf59178 Share upstream definitions in @4nk/smart-ide-upstreams, systemd user units
- Add packages/smart-ide-upstreams (versioned dist) for resolveUpstream + listUpstreamKeys
- Wire smart-ide-global-api and smart-ide-sso-gateway via file: dependency
- Add systemd user unit templates and install-smart-ide-gateway-systemd-user.sh (SSO After/Requires global API)
- Update docs and VERSION 0.0.3
2026-04-04 15:37:58 +02:00

29 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Installe les unités systemd *utilisateur* pour smart-ide-global-api puis smart-ide-sso-gateway.
# Prérequis : config/services.local.env (copie de config/services.local.env.example), builds npm
# (packages/smart-ide-upstreams, services/smart-ide-global-api, services/smart-ide-sso-gateway).
# Usage : ./scripts/install-smart-ide-gateway-systemd-user.sh
# Puis : systemctl --user start smart-ide-global-api smart-ide-sso-gateway
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
UNIT_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user"
GLOBAL_IN="${ROOT}/systemd/user/smart-ide-global-api.service.in"
SSO_IN="${ROOT}/systemd/user/smart-ide-sso-gateway.service.in"
GLOBAL_OUT="${UNIT_DIR}/smart-ide-global-api.service"
SSO_OUT="${UNIT_DIR}/smart-ide-sso-gateway.service"
mkdir -p "$UNIT_DIR"
sed "s|@SMART_IDE_ROOT@|$ROOT|g" "$GLOBAL_IN" >"$GLOBAL_OUT"
sed "s|@SMART_IDE_ROOT@|$ROOT|g" "$SSO_IN" >"$SSO_OUT"
chmod 0644 "$GLOBAL_OUT" "$SSO_OUT"
systemctl --user daemon-reload
systemctl --user enable smart-ide-global-api.service
systemctl --user enable smart-ide-sso-gateway.service
echo "Unités : $GLOBAL_OUT"
echo " $SSO_OUT"
echo "Démarrage : systemctl --user start smart-ide-global-api smart-ide-sso-gateway"
echo "État : systemctl --user status smart-ide-global-api smart-ide-sso-gateway"