commit 4
This commit is contained in:
16
README.md
16
README.md
@@ -47,7 +47,7 @@ Self-hosted SSO / OIDC-сервис — аналог Keycloak / Яндекс ID.
|
||||
**Одна команда — установит Node.js 22, Docker, сам сервис и запустит:**
|
||||
|
||||
```bash
|
||||
curl -fsSL https://github.com/ssomvk/sso-service/raw/main/install.sh | bash
|
||||
curl -fsSL https://git.lendry.ru/lendry/sso-service/raw/branch/main/install.sh | bash
|
||||
```
|
||||
|
||||
Скрипт автоматически:
|
||||
@@ -202,14 +202,14 @@ curl -fsSL https://git.lendry.ru/lendry/sso-mvk/raw/main/install.sh | bash
|
||||
|
||||
### Переменные окружения (опционально)
|
||||
```bash
|
||||
INSTALL_DIR=/opt/sso curl -fsSL https://github.com/ssomvk/sso-service/raw/main/install.sh | bash
|
||||
INSTALL_DIR=/opt/sso curl -fsSL https://git.lendry.ru/lendry/sso-service/raw/branch/main/install.sh | bash
|
||||
```
|
||||
|
||||
## Ручная установка
|
||||
|
||||
```bash
|
||||
# 1. Клонировать
|
||||
git clone https://github.com/ssomvk/sso-service.git
|
||||
git clone https://git.lendry.ru/lendry/sso-service.git
|
||||
cd sso-service
|
||||
|
||||
# 2. Настроить окружение
|
||||
@@ -239,10 +239,10 @@ node dist/main
|
||||
|
||||
Корректно обрабатывает X-Forwarded-For (TRUST_PROXY).
|
||||
|
||||
## Публикация на GitHub
|
||||
## Публикация на Gitea
|
||||
|
||||
```bash
|
||||
# 1. Создать репозиторий на github.com → New repository
|
||||
# 1. Создать репозиторий на https://git.lendry.ru → New repository
|
||||
# Название: sso-service (или любое другое)
|
||||
# Visibility: Public
|
||||
|
||||
@@ -252,11 +252,11 @@ git init
|
||||
git add -A
|
||||
git commit -m "Initial commit: SSO service (NestJS, Prisma 7, PostgreSQL)"
|
||||
git branch -M main
|
||||
git remote add origin https://github.com/ВАШ_ЛОГИН/sso-service.git
|
||||
git remote add origin https://git.lendry.ru/lendry/sso-service.git
|
||||
git push -u origin main
|
||||
|
||||
# 3. Установка с любого сервера:
|
||||
curl -fsSL https://github.com/ВАШ_ЛОГИН/sso-service/raw/main/install.sh | bash
|
||||
curl -fsSL https://git.lendry.ru/lendry/sso-service/raw/branch/main/install.sh | bash
|
||||
```
|
||||
|
||||
**Важно:** Перед пушем отредактируйте `install.sh` — замените `REPO="ssomvk/sso-service"` на ваш репозиторий (строка 4).
|
||||
**Важно:** Перед пушем проверьте `install.sh` — `REPO="lendry/sso-service"` и `GIT_HOST="git.lendry.ru"` должны соответствовать вашему Gitea.
|
||||
|
||||
11
install.sh
11
install.sh
@@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO="ssomvk/sso-service"
|
||||
REPO="lendry/sso-service"
|
||||
GIT_HOST="git.lendry.ru"
|
||||
BRANCH="main"
|
||||
INSTALL_DIR="${INSTALL_DIR:-$HOME/sso-service}"
|
||||
SKIP_PREREQS="${SKIP_PREREQS:-false}"
|
||||
@@ -15,7 +16,7 @@ step() { echo -e "\n${CYAN}━━━ $1 ━━━${NC}"; }
|
||||
echo -e "${CYAN}"
|
||||
echo " ╔══════════════════════════════════════════════╗"
|
||||
echo " ║ SSO Service — Auto Installer ║"
|
||||
echo " ║ https://github.com/${REPO} ║"
|
||||
echo " ║ https://${GIT_HOST}/${REPO} ║"
|
||||
echo " ╚══════════════════════════════════════════════╝"
|
||||
echo -e "${NC}"
|
||||
|
||||
@@ -128,10 +129,10 @@ if [ -d "$INSTALL_DIR/.git" ]; then
|
||||
else
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
if command -v git &>/dev/null; then
|
||||
git clone --depth 1 "https://github.com/$REPO.git" "$INSTALL_DIR" 2>&1
|
||||
git clone --depth 1 "https://$GIT_HOST/$REPO.git" "$INSTALL_DIR" 2>&1
|
||||
else
|
||||
warn "git not found, downloading archive..."
|
||||
curl -fsSL "https://github.com/$REPO/archive/refs/heads/$BRANCH.tar.gz" | tar xz --strip=1 -C "$INSTALL_DIR"
|
||||
curl -fsSL "https://$GIT_HOST/$REPO/archive/$BRANCH.tar.gz" | tar xz --strip=1 -C "$INSTALL_DIR"
|
||||
fi
|
||||
info "Downloaded to $INSTALL_DIR"
|
||||
fi
|
||||
@@ -238,7 +239,7 @@ echo -e " ${YELLOW}Log file:${NC} $INSTALL_DIR/sso.log"
|
||||
echo ""
|
||||
echo -e " ${YELLOW}Stop:${NC} $(command -v pm2 &>/dev/null && echo 'pm2 stop sso-service' || echo "kill \$(cat $INSTALL_DIR/.sso.pid)")"
|
||||
echo -e " ${YELLOW}Update:${NC} cd $INSTALL_DIR && git pull && npm ci && npm run build && npm run start:prod"
|
||||
echo -e " ${YELLOW}Re-run:${NC} curl -fsSL https://github.com/${REPO}/raw/${BRANCH}/install.sh | bash"
|
||||
echo -e " ${YELLOW}Re-run:${NC} curl -fsSL https://${GIT_HOST}/${REPO}/raw/branch/${BRANCH}/install.sh | bash"
|
||||
echo ""
|
||||
echo -e " ${GREEN}Open http://localhost:${PORT:-3000} in your browser${NC}"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user