Skip to content

Commit

Permalink
Merge pull request #95 from Triple-Z/dev
Browse files Browse the repository at this point in the history
Deployment patches
  • Loading branch information
arcosx authored Apr 17, 2019
2 parents a4316ec + 5dfc3fa commit 0adb8bb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
6 changes: 3 additions & 3 deletions build/package/safeu-backend-dev/Dockerfile-compose
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ FROM golang:1.9.7

MAINTAINER TripleZ "[email protected]"

WORKDIR $GOPATH/src/a2os/safeu-backend
ADD . $GOPATH/src/a2os/safeu-backend/

# COPY conf/db.example.json $GOPATH/src/a2os/safeu-backend/conf/db.json

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

WORKDIR $GOPATH/src/a2os/safeu-backend
ADD . $GOPATH/src/a2os/safeu-backend/

# Build package
RUN go build -o safeu-backend-dev .

Expand Down
2 changes: 1 addition & 1 deletion common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package common
var CloudConfig *CloudConfiguration

const (
DEBUG = true
DEBUG = false
MAINTENANCE = false
PORT = "8080"
)
Expand Down
6 changes: 3 additions & 3 deletions deployments/prod-safeu/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
context: ../..
dockerfile: ././build/package/safeu-backend/Dockerfile-compose
volumes:
- ../../log/web1:/go/src/a2os/safeu-backend/log/
- ../../log/safeu1:/go/src/a2os/safeu-backend/log
# - ../..:/go/src/a2os/safeu-backend/
environment:
- TZ=Asia/Shanghai
Expand All @@ -39,7 +39,7 @@ services:
context: ../..
dockerfile: ././build/package/safeu-backend/Dockerfile-compose
volumes:
- ../../log/web2:/go/src/a2os/safeu-backend/log/
- ../../log/safeu2:/go/src/a2os/safeu-backend/log
# - ../..:/go/src/a2os/safeu-backend/
environment:
- TZ=Asia/Shanghai
Expand All @@ -56,7 +56,7 @@ services:
context: ../..
dockerfile: ././build/package/safeu-backend/Dockerfile-compose
volumes:
- ../../log/web2:/go/src/a2os/safeu-backend/log/
- ../../log/safeu3:/go/src/a2os/safeu-backend/log
# - ../..:/go/src/a2os/safeu-backend/
environment:
- TZ=Asia/Shanghai
Expand Down
7 changes: 5 additions & 2 deletions item/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ func GetSignURL(itemBucket string, itemPath string, client *oss.Client) (string,
log.Println(fmt.Sprintf("Func: GetSignURL Get Bucket %s Object %s Failed %s", itemBucket, itemPath, err.Error()))
return "", err
}
log.Println("signed url: ", signedURL)
return signedURL, nil

// TODO: 优雅一点……这个太暴力了
signedHttpsURL := "https" + signedURL[4:]
log.Println("signed url: ", signedHttpsURL)
return signedHttpsURL, nil
}
2 changes: 1 addition & 1 deletion item/downloadCount.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func MinusDownloadCount(c *gin.Context) {

// 下载次数--
singleItem.DownCount -= 1
if singleItem.DownCount <= 0 {
if singleItem.DownCount < 0 {
// 删除文件
err := DeleteItem(singleItem.Bucket, singleItem.Path)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions item/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func GetItemInfo(c *gin.Context) {
return
}
c.JSON(http.StatusOK, gin.H{
"down_count ": item.DownCount,
"expired_at": item.ExpiredAt,
"is_public": item.IsPublic,
"down_count": item.DownCount,
"expired_at": item.ExpiredAt,
"is_public": item.IsPublic,
})
return
}

0 comments on commit 0adb8bb

Please sign in to comment.