Skip to content

Commit

Permalink
Merge pull request #37 from iineva/v2
Browse files Browse the repository at this point in the history
fix depoly script and typo
  • Loading branch information
iineva authored May 24, 2021
2 parents dd2550c + bc26200 commit 6488084
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 27 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,9 @@ services:
# option, qiniu public url
- QINIU_URL=
# option, metadata storage path, use random secret path to keep your metadata safer in case of remote storage
- MATA_PATH=appList.json
- META_PATH=appList.json
volumes:
- "/docker/data/ipa-server:/app/upload"
command:
- -public-url "$PUBLIC_URL"
- -qiniu "$QINIU"
- -qiniu-url "$QINIU_URL"
- -mata-path "$MATA_PATH"
caddy:
image: abiosoft/caddy:0.11.5
restart: always
Expand Down
8 changes: 2 additions & 6 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,9 @@ services:
# option, 七牛DNS域名,注意要加 https://
- QINIU_URL=
# option, 元数据存储路径, 使用一个随机路径来保护元数据,因为在使用远程存储的时候,没有更好的方法防止外部直接访问元数据文件
- MATA_PATH=appList.json
- META_PATH=appList.json
volumes:
- "/docker/data/ipa-server:/app/upload"
command:
- -public-url "$PUBLIC_URL"
- -qiniu "$QINIU"
- -qiniu-url "$QINIU_URL"
- -mata-path "$MATA_PATH"
caddy:
image: abiosoft/caddy:0.11.5
restart: always
Expand Down Expand Up @@ -107,3 +102,4 @@ make
- [ ] 设计全新的鉴权方式,初步考虑试用GitHub登录鉴权
- [x] 支持七牛存储
- [x] 兼容v1产生数据,无缝升级
- [ ] 支持命令行生成静态文件部署
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"required": false,
"value": ""
},
"MATA_PATH": {
"META_PATH": {
"description": "option, metadata storage path, use random secret path to keep your metadata safer in case of remote storage",
"required": false,
"value": "appList.json"
Expand Down
3 changes: 1 addition & 2 deletions cmd/ipasd/ipasd.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ func main() {
flag.Usage = usage
flag.Parse()

host := fmt.Sprintf("%s:%s", *addr, *port)

serve := http.NewServeMux()

logger := log.NewLogfmtLogger(os.Stderr)
Expand Down Expand Up @@ -109,6 +107,7 @@ func main() {
fmt.Sprintf("/%s", *metadataPath): fmt.Sprintf("/%s", uuid.NewString()),
}, http.FileServer(staticFS)))

host := fmt.Sprintf("%s:%s", *addr, *port)
logger.Log("msg", fmt.Sprintf("SERVER LISTEN ON: http://%v", host))
logger.Log("msg", http.ListenAndServe(host, serve))
}
Expand Down
8 changes: 1 addition & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@ services:
# option, qiniu public url
- QINIU_URL=
# option, metadata storage path, use random secret path to keep your metadata safer in case of remote storage
- MATA_PATH=appList.json
- META_PATH=appList.json
ports:
- "9008:8080"
volumes:
- "/docker/data/ipa-server:/app/upload"
command:
- -public-url "$PUBLIC_URL"
- -qiniu "$QINIU"
- -qiniu-url "$QINIU_URL"
- -mata-path "$MATA_PATH"

31 changes: 26 additions & 5 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
#!/bin/sh

/app/ipasd \
-port "$PORT" \
-public-url "${PUBLIC_URL:-$DOMAIN}" \
-qiniu "$QINIU" \
-qiniu-url "$QINIU_URL"
ipasd_args=""

if [ -n "$PORT" ];then
ipasd_args=$ipasd_args"-port $PORT "
fi

PUBLIC_URL=${PUBLIC_URL:-$DOMAIN}
if [ -n "$PUBLIC_URL" ];then
ipasd_args=$ipasd_args"-public-url $PUBLIC_URL"
fi

if [ -n "$QINIU" ];then
ipasd_args=$ipasd_args"-qiniu $QINIU"
fi

if [ -n "$QINIU_URL" ];then
ipasd_args=$ipasd_args"-qiniu-url $QINIU_URL"
fi

if [ -n "$META_PATH" ];then
ipasd_args=$ipasd_args"-meta-path $META_PATH"
fi

echo $ipasd_args

./ipasd $ipasd_args

0 comments on commit 6488084

Please sign in to comment.