Commit c8eff343 authored by shaw's avatar shaw
Browse files

chore: update readme

parent f19b0382
...@@ -150,14 +150,14 @@ mkdir -p sub2api-deploy && cd sub2api-deploy ...@@ -150,14 +150,14 @@ mkdir -p sub2api-deploy && cd sub2api-deploy
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/docker-deploy.sh | bash curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/docker-deploy.sh | bash
# Start services # Start services
docker-compose -f docker-compose.local.yml up -d docker-compose up -d
# View logs # View logs
docker-compose -f docker-compose.local.yml logs -f sub2api docker-compose logs -f sub2api
``` ```
**What the script does:** **What the script does:**
- Downloads `docker-compose.local.yml` and `.env.example` - Downloads `docker-compose.local.yml` (saved as `docker-compose.yml`) and `.env.example`
- Generates secure credentials (JWT_SECRET, TOTP_ENCRYPTION_KEY, POSTGRES_PASSWORD) - Generates secure credentials (JWT_SECRET, TOTP_ENCRYPTION_KEY, POSTGRES_PASSWORD)
- Creates `.env` file with auto-generated secrets - Creates `.env` file with auto-generated secrets
- Creates data directories (uses local directories for easy backup/migration) - Creates data directories (uses local directories for easy backup/migration)
......
...@@ -154,14 +154,14 @@ mkdir -p sub2api-deploy && cd sub2api-deploy ...@@ -154,14 +154,14 @@ mkdir -p sub2api-deploy && cd sub2api-deploy
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/docker-deploy.sh | bash curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/docker-deploy.sh | bash
# 启动服务 # 启动服务
docker-compose -f docker-compose.local.yml up -d docker-compose up -d
# 查看日志 # 查看日志
docker-compose -f docker-compose.local.yml logs -f sub2api docker-compose logs -f sub2api
``` ```
**脚本功能:** **脚本功能:**
- 下载 `docker-compose.local.yml` `.env.example` - 下载 `docker-compose.local.yml`(本地保存为 `docker-compose.yml``.env.example`
- 自动生成安全凭证(JWT_SECRET、TOTP_ENCRYPTION_KEY、POSTGRES_PASSWORD) - 自动生成安全凭证(JWT_SECRET、TOTP_ENCRYPTION_KEY、POSTGRES_PASSWORD)
- 创建 `.env` 文件并填充自动生成的密钥 - 创建 `.env` 文件并填充自动生成的密钥
- 创建数据目录(使用本地目录,便于备份和迁移) - 创建数据目录(使用本地目录,便于备份和迁移)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# - Creates necessary data directories # - Creates necessary data directories
# #
# After running this script, you can start services with: # After running this script, you can start services with:
# docker-compose -f docker-compose.local.yml up -d # docker-compose up -d
# ============================================================================= # =============================================================================
set -e set -e
...@@ -65,7 +65,7 @@ main() { ...@@ -65,7 +65,7 @@ main() {
fi fi
# Check if deployment already exists # Check if deployment already exists
if [ -f "docker-compose.local.yml" ] && [ -f ".env" ]; then if [ -f "docker-compose.yml" ] && [ -f ".env" ]; then
print_warning "Deployment files already exist in current directory." print_warning "Deployment files already exist in current directory."
read -p "Overwrite existing files? (y/N): " -r read -p "Overwrite existing files? (y/N): " -r
echo echo
...@@ -75,17 +75,17 @@ main() { ...@@ -75,17 +75,17 @@ main() {
fi fi
fi fi
# Download docker-compose.local.yml # Download docker-compose.local.yml and save as docker-compose.yml
print_info "Downloading docker-compose.local.yml..." print_info "Downloading docker-compose.yml..."
if command_exists curl; then if command_exists curl; then
curl -sSL "${GITHUB_RAW_URL}/docker-compose.local.yml" -o docker-compose.local.yml curl -sSL "${GITHUB_RAW_URL}/docker-compose.local.yml" -o docker-compose.yml
elif command_exists wget; then elif command_exists wget; then
wget -q "${GITHUB_RAW_URL}/docker-compose.local.yml" -O docker-compose.local.yml wget -q "${GITHUB_RAW_URL}/docker-compose.local.yml" -O docker-compose.yml
else else
print_error "Neither curl nor wget is installed. Please install one of them." print_error "Neither curl nor wget is installed. Please install one of them."
exit 1 exit 1
fi fi
print_success "Downloaded docker-compose.local.yml" print_success "Downloaded docker-compose.yml"
# Download .env.example # Download .env.example
print_info "Downloading .env.example..." print_info "Downloading .env.example..."
...@@ -144,7 +144,7 @@ main() { ...@@ -144,7 +144,7 @@ main() {
print_warning "Please keep them secure and do not share publicly!" print_warning "Please keep them secure and do not share publicly!"
echo "" echo ""
echo "Directory structure:" echo "Directory structure:"
echo " docker-compose.local.yml - Docker Compose configuration" echo " docker-compose.yml - Docker Compose configuration"
echo " .env - Environment variables (generated secrets)" echo " .env - Environment variables (generated secrets)"
echo " .env.example - Example template (for reference)" echo " .env.example - Example template (for reference)"
echo " data/ - Application data (will be created on first run)" echo " data/ - Application data (will be created on first run)"
...@@ -154,10 +154,10 @@ main() { ...@@ -154,10 +154,10 @@ main() {
echo "Next steps:" echo "Next steps:"
echo " 1. (Optional) Edit .env to customize configuration" echo " 1. (Optional) Edit .env to customize configuration"
echo " 2. Start services:" echo " 2. Start services:"
echo " docker-compose -f docker-compose.local.yml up -d" echo " docker-compose up -d"
echo "" echo ""
echo " 3. View logs:" echo " 3. View logs:"
echo " docker-compose -f docker-compose.local.yml logs -f sub2api" echo " docker-compose logs -f sub2api"
echo "" echo ""
echo " 4. Access Web UI:" echo " 4. Access Web UI:"
echo " http://localhost:8080" echo " http://localhost:8080"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment