Skip to content

Commit

Permalink
Merge pull request #82 from Jinnrry/v2.3.8
Browse files Browse the repository at this point in the history
V2.3.8
Jinnrry authored Feb 18, 2024
2 parents 15b8c2b + d7dbf11 commit cfd29a3
Showing 4 changed files with 50 additions and 27 deletions.
26 changes: 26 additions & 0 deletions DockerfileGithubAction
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM golang:alpine as serverbuild

WORKDIR /work

COPY server .

RUN apk update && apk add git
RUN go build -ldflags "-X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail main.go


FROM alpine

WORKDIR /work

# 设置时区
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache tzdata \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&&rm -rf /var/cache/apk/* /tmp/* /var/tmp/* $HOME/.cache


COPY --from=serverbuild /work/pmail .


CMD /work/pmail
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
build: build_fe build_server package

clean:
rm -rf output

build_fe:
cd fe && yarn && yarn build
cd server && cp -rf ../fe/dist http_server

build_server:
cd server && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_linux_amd64 main.go
cd server && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_windows_amd64.exe main.go
cd server && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_mac_amd64 main.go
cd server && CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_mac_arm64 main.go

package: clean
mkdir output
mv server/pmail* output/
mkdir config
cp -r server/config/dkim output/config/
cp -r server/config/ssl output/config/
cp -r server/config/config.json output/config/
cp README.md output/
26 changes: 0 additions & 26 deletions build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion server/config/config.go
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ type Config struct {
//go:embed tables/*
var tableConfig embed.FS

const Version = "2.3.7"
const Version = "2.3.8"

const DBTypeMySQL = "mysql"
const DBTypeSQLite = "sqlite"

0 comments on commit cfd29a3

Please sign in to comment.