Skip to content

Commit 5dfc3fa

Browse files
authored
Merge pull request #94 from Triple-Z/info-patch
Deployment patches
2 parents 206c7cc + e604340 commit 5dfc3fa

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

build/package/safeu-backend-dev/Dockerfile-compose

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ FROM golang:1.9.7
22

33
MAINTAINER TripleZ "[email protected]"
44

5-
WORKDIR $GOPATH/src/a2os/safeu-backend
6-
ADD . $GOPATH/src/a2os/safeu-backend/
7-
85
# COPY conf/db.example.json $GOPATH/src/a2os/safeu-backend/conf/db.json
96

107
# Solution for Chinese special network enviornment
@@ -16,6 +13,9 @@ RUN mkdir -p $GOPATH/src/golang.org/x/ && \
1613
# Add dependencies
1714
RUN go get github.com/pilu/fresh
1815

16+
WORKDIR $GOPATH/src/a2os/safeu-backend
17+
ADD . $GOPATH/src/a2os/safeu-backend/
18+
1919
# Build package
2020
RUN go build -o safeu-backend-dev .
2121

common/const.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package common
33
var CloudConfig *CloudConfiguration
44

55
const (
6-
DEBUG = true
6+
DEBUG = false
77
MAINTENANCE = false
88
PORT = "8080"
99
)

deployments/prod-safeu/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222
context: ../..
2323
dockerfile: ././build/package/safeu-backend/Dockerfile-compose
2424
volumes:
25-
- ../../log/web1:/go/src/a2os/safeu-backend/log/
25+
- ../../log/safeu1:/go/src/a2os/safeu-backend/log
2626
# - ../..:/go/src/a2os/safeu-backend/
2727
environment:
2828
- TZ=Asia/Shanghai
@@ -39,7 +39,7 @@ services:
3939
context: ../..
4040
dockerfile: ././build/package/safeu-backend/Dockerfile-compose
4141
volumes:
42-
- ../../log/web2:/go/src/a2os/safeu-backend/log/
42+
- ../../log/safeu2:/go/src/a2os/safeu-backend/log
4343
# - ../..:/go/src/a2os/safeu-backend/
4444
environment:
4545
- TZ=Asia/Shanghai
@@ -56,7 +56,7 @@ services:
5656
context: ../..
5757
dockerfile: ././build/package/safeu-backend/Dockerfile-compose
5858
volumes:
59-
- ../../log/web2:/go/src/a2os/safeu-backend/log/
59+
- ../../log/safeu3:/go/src/a2os/safeu-backend/log
6060
# - ../..:/go/src/a2os/safeu-backend/
6161
environment:
6262
- TZ=Asia/Shanghai

item/download.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ func GetSignURL(itemBucket string, itemPath string, client *oss.Client) (string,
384384
log.Println(fmt.Sprintf("Func: GetSignURL Get Bucket %s Object %s Failed %s", itemBucket, itemPath, err.Error()))
385385
return "", err
386386
}
387-
log.Println("signed url: ", signedURL)
388-
return signedURL, nil
387+
388+
// TODO: 优雅一点……这个太暴力了
389+
signedHttpsURL := "https" + signedURL[4:]
390+
log.Println("signed url: ", signedHttpsURL)
391+
return signedHttpsURL, nil
389392
}

item/downloadCount.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func MinusDownloadCount(c *gin.Context) {
7777

7878
// 下载次数--
7979
singleItem.DownCount -= 1
80-
if singleItem.DownCount <= 0 {
80+
if singleItem.DownCount < 0 {
8181
// 删除文件
8282
err := DeleteItem(singleItem.Bucket, singleItem.Path)
8383
if err != nil {

item/info.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ func GetItemInfo(c *gin.Context) {
2929
return
3030
}
3131
c.JSON(http.StatusOK, gin.H{
32-
"down_count ": item.DownCount,
33-
"expired_at": item.ExpiredAt,
34-
"is_public": item.IsPublic,
32+
"down_count": item.DownCount,
33+
"expired_at": item.ExpiredAt,
34+
"is_public": item.IsPublic,
3535
})
3636
return
3737
}

0 commit comments

Comments
 (0)