ssl证书更新修复

This commit is contained in:
jinnrry 2023-09-28 09:42:02 +08:00
commit ba5a53a4e2
5 changed files with 96 additions and 34 deletions

44
.github/workflows/docker_build.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Docker Image CI
on:
workflow_dispatch:
release:
types: [released]
env:
REGISTRY: ghcr.io
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> ${GITHUB_ENV}
- uses: actions/checkout@v3
- name: set lower case repository name
run: |
echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV}
env:
REPOSITORY: '${{ github.repository }}'
- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.REPOSITORY_LC }}:${{ env.VERSION }}
${{ env.REGISTRY }}/${{ env.REPOSITORY_LC }}:latest

View File

@ -1,44 +1,56 @@
name: Docker Image CI name: Build and Release
on: on:
push: workflow_dispatch:
tags: release:
- "*" types: [released]
env:
REGISTRY: ghcr.io
jobs: jobs:
build-and-push-image: build:
runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: write
packages: write strategy:
matrix:
goos: [windows, linux, darwin]
goarch: [amd64, arm64]
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
steps: steps:
- name: Get version - name: Get version
id: get_version id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> ${GITHUB_ENV} run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Checkout
- uses: actions/checkout@v3 uses: actions/checkout@v4.0.0
- name: Setup Node.js environment
- name: set lower case repository name uses: actions/setup-node@v3.8.1
- name: Install Dependencies
run: npm install --global yarn
- name: Setup Go environment
uses: actions/setup-go@v4.1.0
- name: Gen output name
run: echo "FILENAME=pmail_${{ matrix.goos }}_${{ matrix.goarch }}" >> ${GITHUB_ENV}
- name: Rename Windows File
if: matrix.goos == 'windows'
run: echo "FILENAME=pmail_${{ matrix.goos }}_${{ matrix.goarch }}.exe" >> ${GITHUB_ENV}
- name: FE Build
run: cd fe && yarn && yarn build
- name: BE Build
run: | run: |
echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV} cd server && cp -rf ../fe/dist http_server
env: 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 ${{ env.FILENAME }} main.go
REPOSITORY: '${{ github.repository }}' - name: Upload files to Artifacts
uses: actions/upload-artifact@v3
- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with: with:
registry: ${{ env.REGISTRY }} name: ${{ env.FILENAME }}
username: ${{ github.actor }} path: ./server/${{ env.FILENAME }}
password: ${{ secrets.GITHUB_TOKEN }} - name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
- name: Build and push Docker images
uses: docker/build-push-action@v4
with: with:
context: . repo_token: ${{ secrets.GITHUB_TOKEN }}
push: true file: ./server/${{ env.FILENAME }}
tags: | tag: ${{ github.ref }}
${{ env.REGISTRY }}/${{ env.REPOSITORY_LC }}:${{ env.VERSION }} file_glob: true
${{ env.REGISTRY }}/${{ env.REPOSITORY_LC }}:latest

View File

@ -55,6 +55,9 @@ Or
`docker run -p 25:25 -p 80:80 -p 443:443 -p 465:465 -v $(pwd)/config:/work/config ghcr.io/jinnrry/pmail:latest` `docker run -p 25:25 -p 80:80 -p 443:443 -p 465:465 -v $(pwd)/config:/work/config ghcr.io/jinnrry/pmail:latest`
> [!IMPORTANT]
> If your server has a firewall turned on, you need to open ports 25, 80, and 443.
## 3、Configuration ## 3、Configuration
Open `http://127.0.0.1` in your browser or use your server's public IP to visit, then follow the instructions to Open `http://127.0.0.1` in your browser or use your server's public IP to visit, then follow the instructions to

View File

@ -59,6 +59,9 @@ PMail是一个追求极简部署流程、极致资源占用的个人域名邮箱
`docker run -p 25:25 -p 80:80 -p 443:443 -p 465:465 -v $(pwd)/config:/work/config ghcr.io/jinnrry/pmail:latest` `docker run -p 25:25 -p 80:80 -p 443:443 -p 465:465 -v $(pwd)/config:/work/config ghcr.io/jinnrry/pmail:latest`
> [!IMPORTANT]
> 如果你服务器开启了防火墙,你需要放行25、80、443这三个端口
## 3、配置 ## 3、配置
浏览器打开 `http://127.0.0.1` 或者是用你服务器公网IP访问,然后按提示配置 浏览器打开 `http://127.0.0.1` 或者是用你服务器公网IP访问,然后按提示配置

View File

@ -38,7 +38,7 @@ type Config struct {
//go:embed tables/* //go:embed tables/*
var tableConfig embed.FS var tableConfig embed.FS
const Version = "2.2.2" const Version = "2.2.6"
const DBTypeMySQL = "mysql" const DBTypeMySQL = "mysql"
const DBTypeSQLite = "sqlite" const DBTypeSQLite = "sqlite"