Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
c8eff343
Commit
c8eff343
authored
Mar 09, 2026
by
shaw
Browse files
chore: update readme
parent
f19b0382
Changes
3
Show whitespace changes
Inline
Side-by-side
README.md
View file @
c8eff343
...
...
@@ -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
# Start services
docker-compose
-f
docker-compose.local.yml
up
-d
docker-compose up
-d
# View logs
docker-compose
-f
docker-compose.local.yml
logs
-f
sub2api
docker-compose logs
-f
sub2api
```
**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)
-
Creates
`.env`
file with auto-generated secrets
-
Creates data directories (uses local directories for easy backup/migration)
...
...
README_CN.md
View file @
c8eff343
...
...
@@ -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
# 启动服务
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)
-
创建
`.env`
文件并填充自动生成的密钥
-
创建数据目录(使用本地目录,便于备份和迁移)
...
...
deploy/docker-deploy.sh
View file @
c8eff343
...
...
@@ -8,7 +8,7 @@
# - Creates necessary data directories
#
# After running this script, you can start services with:
# docker-compose
-f docker-compose.local.yml
up -d
# docker-compose up -d
# =============================================================================
set
-e
...
...
@@ -65,7 +65,7 @@ main() {
fi
# 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."
read
-p
"Overwrite existing files? (y/N): "
-r
echo
...
...
@@ -75,17 +75,17 @@ main() {
fi
fi
# Download docker-compose.local.yml
print_info
"Downloading docker-compose.
local.
yml..."
# Download docker-compose.local.yml
and save as docker-compose.yml
print_info
"Downloading docker-compose.yml..."
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
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
print_error
"Neither curl nor wget is installed. Please install one of them."
exit
1
fi
print_success
"Downloaded docker-compose.
local.
yml"
print_success
"Downloaded docker-compose.yml"
# Download .env.example
print_info
"Downloading .env.example..."
...
...
@@ -144,7 +144,7 @@ main() {
print_warning
"Please keep them secure and do not share publicly!"
echo
""
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.example - Example template (for reference)"
echo
" data/ - Application data (will be created on first run)"
...
...
@@ -154,10 +154,10 @@ main() {
echo
"Next steps:"
echo
" 1. (Optional) Edit .env to customize configuration"
echo
" 2. Start services:"
echo
" docker-compose
-f docker-compose.local.yml
up -d"
echo
" docker-compose up -d"
echo
""
echo
" 3. View logs:"
echo
" docker-compose
-f docker-compose.local.yml
logs -f sub2api"
echo
" docker-compose logs -f sub2api"
echo
""
echo
" 4. Access Web UI:"
echo
" http://localhost:8080"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment