forked from Mxmilu666/frp
Compare commits
5 Commits
v0.66.3
...
72d147dfa5
| Author | SHA1 | Date | |
|---|---|---|---|
|
72d147dfa5
|
|||
|
481121a6c2
|
|||
|
be252de683
|
|||
|
0a99c1071b
|
|||
|
dd37b2e199
|
6
.github/workflows/build-all.yaml
vendored
6
.github/workflows/build-all.yaml
vendored
@@ -18,16 +18,20 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
goos: [linux, windows, darwin, freebsd, openbsd, android]
|
goos: [linux, windows, darwin, freebsd, openbsd, android]
|
||||||
goarch: [amd64, arm, arm64]
|
goarch: [amd64, 386, arm, arm64]
|
||||||
exclude:
|
exclude:
|
||||||
- goos: darwin
|
- goos: darwin
|
||||||
goarch: arm
|
goarch: arm
|
||||||
|
- goos: darwin
|
||||||
|
goarch: 386
|
||||||
- goos: freebsd
|
- goos: freebsd
|
||||||
goarch: arm
|
goarch: arm
|
||||||
- goos: openbsd
|
- goos: openbsd
|
||||||
goarch: arm
|
goarch: arm
|
||||||
- goos: android
|
- goos: android
|
||||||
goarch: amd64
|
goarch: amd64
|
||||||
|
- goos: android
|
||||||
|
goarch: 386
|
||||||
# 排除 Android ARM 32位,在单独的 job 中处理
|
# 排除 Android ARM 32位,在单独的 job 中处理
|
||||||
- goos: android
|
- goos: android
|
||||||
goarch: arm
|
goarch: arm
|
||||||
|
|||||||
83
.github/workflows/build-and-push-image.yml
vendored
83
.github/workflows/build-and-push-image.yml
vendored
@@ -1,83 +0,0 @@
|
|||||||
name: Build Image and Publish to Dockerhub & GPR
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [ published ]
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
tag:
|
|
||||||
description: 'Image tag'
|
|
||||||
required: true
|
|
||||||
default: 'test'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
image:
|
|
||||||
name: Build Image from Dockerfile and binaries
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
# environment
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: '0'
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
# get image tag name
|
|
||||||
- name: Get Image Tag Name
|
|
||||||
run: |
|
|
||||||
if [ x${{ github.event.inputs.tag }} == x"" ]; then
|
|
||||||
echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "TAG_NAME=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Login to the GPR
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GPR_TOKEN }}
|
|
||||||
|
|
||||||
# prepare image tags
|
|
||||||
- name: Prepare Image Tags
|
|
||||||
run: |
|
|
||||||
echo "DOCKERFILE_FRPC_PATH=dockerfiles/Dockerfile-for-frpc" >> $GITHUB_ENV
|
|
||||||
echo "DOCKERFILE_FRPS_PATH=dockerfiles/Dockerfile-for-frps" >> $GITHUB_ENV
|
|
||||||
echo "TAG_FRPC=fatedier/frpc:${{ env.TAG_NAME }}" >> $GITHUB_ENV
|
|
||||||
echo "TAG_FRPS=fatedier/frps:${{ env.TAG_NAME }}" >> $GITHUB_ENV
|
|
||||||
echo "TAG_FRPC_GPR=ghcr.io/fatedier/frpc:${{ env.TAG_NAME }}" >> $GITHUB_ENV
|
|
||||||
echo "TAG_FRPS_GPR=ghcr.io/fatedier/frps:${{ env.TAG_NAME }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and push frpc
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./dockerfiles/Dockerfile-for-frpc
|
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
${{ env.TAG_FRPC }}
|
|
||||||
${{ env.TAG_FRPC_GPR }}
|
|
||||||
|
|
||||||
- name: Build and push frps
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./dockerfiles/Dockerfile-for-frps
|
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
${{ env.TAG_FRPS }}
|
|
||||||
${{ env.TAG_FRPS_GPR }}
|
|
||||||
82
.github/workflows/docker-build.yml
vendored
Normal file
82
.github/workflows/docker-build.yml
vendored
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
name: Docker Build and Push
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- name: frps
|
||||||
|
dockerfile: dockerfiles/Dockerfile-for-frps
|
||||||
|
image_name: ghcr.io/${{ github.repository_owner }}/loliacli-frps
|
||||||
|
- name: frpc
|
||||||
|
dockerfile: dockerfiles/Dockerfile-for-frpc
|
||||||
|
image_name: ghcr.io/${{ github.repository_owner }}/loliacli-frpc
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ matrix.image_name }}
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ${{ matrix.dockerfile }}
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
|
- name: Generate image digest
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
run: |
|
||||||
|
echo "Image pushed to: ${{ matrix.image_name }}"
|
||||||
|
echo "Tags: ${{ steps.meta.outputs.tags }}"
|
||||||
66
.github/workflows/release.yaml
vendored
66
.github/workflows/release.yaml
vendored
@@ -3,11 +3,11 @@ name: Release FRP Binaries
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- "v*"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: 'Tag to release (e.g., v1.0.0)'
|
description: "Tag to release (e.g., v1.0.0)"
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
name: Create Release
|
name: Create Release
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source
|
- name: Checkout source
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -55,10 +55,10 @@ jobs:
|
|||||||
- name: Organize release files
|
- name: Organize release files
|
||||||
run: |
|
run: |
|
||||||
mkdir -p release_files
|
mkdir -p release_files
|
||||||
|
|
||||||
# 查找并复制所有压缩包
|
# 查找并复制所有压缩包
|
||||||
find artifacts -type f \( -name "*.zip" -o -name "*.tar.gz" \) -exec cp {} release_files/ \;
|
find artifacts -type f \( -name "*.zip" -o -name "*.tar.gz" \) -exec cp {} release_files/ \;
|
||||||
|
|
||||||
# 如果没有压缩包,尝试查找二进制文件并打包
|
# 如果没有压缩包,尝试查找二进制文件并打包
|
||||||
if [ -z "$(ls -A release_files/)" ]; then
|
if [ -z "$(ls -A release_files/)" ]; then
|
||||||
echo "No archives found, looking for directories to package..."
|
echo "No archives found, looking for directories to package..."
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Files in release_files:"
|
echo "Files in release_files:"
|
||||||
ls -lh release_files/
|
ls -lh release_files/
|
||||||
|
|
||||||
@@ -100,11 +100,26 @@ jobs:
|
|||||||
echo EOF
|
echo EOF
|
||||||
} >> $GITHUB_OUTPUT
|
} >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Debug - Check tags and commits
|
||||||
|
run: |
|
||||||
|
echo "Current tag: ${{ steps.tag.outputs.tag }}"
|
||||||
|
PREV_TAG=$(git describe --tags --abbrev=0 ${{ steps.tag.outputs.tag }}^ 2>/dev/null || echo "none")
|
||||||
|
echo "Previous tag: $PREV_TAG"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Commits between tags:"
|
||||||
|
if [ "$PREV_TAG" != "none" ]; then
|
||||||
|
git log --oneline $PREV_TAG..${{ steps.tag.outputs.tag }}
|
||||||
|
else
|
||||||
|
echo "First tag, showing all commits:"
|
||||||
|
git log --oneline ${{ steps.tag.outputs.tag }}
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build Changelog
|
- name: Build Changelog
|
||||||
id: changelog
|
id: changelog
|
||||||
uses: mikepenz/release-changelog-builder-action@v4
|
uses: mikepenz/release-changelog-builder-action@v4
|
||||||
with:
|
with:
|
||||||
configuration: |
|
configurationJson: |
|
||||||
{
|
{
|
||||||
"categories": [
|
"categories": [
|
||||||
{
|
{
|
||||||
@@ -134,30 +149,51 @@ jobs:
|
|||||||
],
|
],
|
||||||
"template": "#{{CHANGELOG}}\n\n## 📥 Download\n\n### Checksums (SHA256)\n\n```\n${{ steps.checksums.outputs.content }}\n```\n\n**Full Changelog**: #{{RELEASE_DIFF}}",
|
"template": "#{{CHANGELOG}}\n\n## 📥 Download\n\n### Checksums (SHA256)\n\n```\n${{ steps.checksums.outputs.content }}\n```\n\n**Full Changelog**: #{{RELEASE_DIFF}}",
|
||||||
"pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}",
|
"pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}",
|
||||||
"empty_template": "- No changes",
|
"commit_template": "- #{{TITLE}} by @#{{AUTHOR}}",
|
||||||
|
"empty_template": "- No changes in this release",
|
||||||
|
"mode": "COMMIT",
|
||||||
|
"sort": {
|
||||||
|
"order": "ASC",
|
||||||
|
"on_property": "mergedAt"
|
||||||
|
},
|
||||||
|
"max_tags_to_fetch": 200,
|
||||||
|
"max_pull_requests": 200,
|
||||||
|
"max_back_track_time_days": 365,
|
||||||
"label_extractor": [
|
"label_extractor": [
|
||||||
{
|
{
|
||||||
"pattern": "^(feat|feature)(\\(.+\\))?:",
|
"pattern": "^(feat|feature)(\\(.+\\))?:",
|
||||||
"target": "feature"
|
"target": "feature",
|
||||||
|
"on_property": "title"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pattern": "^fix(\\(.+\\))?:",
|
"pattern": "^fix(\\(.+\\))?:",
|
||||||
"target": "fix"
|
"target": "fix",
|
||||||
|
"on_property": "title"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pattern": "^docs(\\(.+\\))?:",
|
"pattern": "^docs(\\(.+\\))?:",
|
||||||
"target": "docs"
|
"target": "docs",
|
||||||
|
"on_property": "title"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pattern": "^(chore|refactor|perf)(\\(.+\\))?:",
|
"pattern": "^(chore|refactor|perf)(\\(.+\\))?:",
|
||||||
"target": "chore"
|
"target": "chore",
|
||||||
|
"on_property": "title"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pattern": "^(deps|dependencies)(\\(.+\\))?:",
|
||||||
|
"target": "dependencies",
|
||||||
|
"on_property": "title"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"ignore_labels": ["ignore", "no-changelog"],
|
||||||
|
"ignore_commits": ["skip-ci", "skip ci", "[skip ci]"]
|
||||||
}
|
}
|
||||||
|
outputFile: CHANGELOG.md
|
||||||
toTag: ${{ steps.tag.outputs.tag }}
|
toTag: ${{ steps.tag.outputs.tag }}
|
||||||
|
commitMode: true
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
@@ -169,4 +205,4 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
release_files/*
|
release_files/*
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ var rootCmd = &cobra.Command{
|
|||||||
|
|
||||||
// If multiple config files are specified, run one frpc service for each file
|
// If multiple config files are specified, run one frpc service for each file
|
||||||
if len(cfgFiles) > 1 {
|
if len(cfgFiles) > 1 {
|
||||||
_ = runMultipleClientsFromFiles(cfgFiles, unsafeFeatures)
|
runMultipleClientsFromFiles(cfgFiles, unsafeFeatures)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ func runMultipleClients(cfgDir string, unsafeFeatures *security.UnsafeFeatures)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func runMultipleClientsFromFiles(cfgFiles []string, unsafeFeatures *security.UnsafeFeatures) error {
|
func runMultipleClientsFromFiles(cfgFiles []string, unsafeFeatures *security.UnsafeFeatures) {
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
|
||||||
// Display banner first
|
// Display banner first
|
||||||
@@ -135,20 +135,19 @@ func runMultipleClientsFromFiles(cfgFiles []string, unsafeFeatures *security.Uns
|
|||||||
bannerDisplayed = true
|
bannerDisplayed = true
|
||||||
log.Infof("检测到 %d 个配置文件,将启动多个 frpc 服务实例", len(cfgFiles))
|
log.Infof("检测到 %d 个配置文件,将启动多个 frpc 服务实例", len(cfgFiles))
|
||||||
|
|
||||||
for i, cfgFile := range cfgFiles {
|
for _, cfgFile := range cfgFiles {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
// Add a small delay to avoid log output mixing
|
// Add a small delay to avoid log output mixing
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
go func(index int, path string) {
|
go func(path string) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
err := runClient(path, unsafeFeatures)
|
err := runClient(path, unsafeFeatures)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("\n配置文件 [%s] 启动失败: %v\n", path, err)
|
fmt.Printf("\n配置文件 [%s] 启动失败: %v\n", path, err)
|
||||||
}
|
}
|
||||||
}(i, cfgFile)
|
}(cfgFile)
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Execute() {
|
func Execute() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.24 AS building
|
FROM golang:1.25 AS building
|
||||||
|
|
||||||
COPY . /building
|
COPY . /building
|
||||||
WORKDIR /building
|
WORKDIR /building
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.24 AS building
|
FROM golang:1.25 AS building
|
||||||
|
|
||||||
COPY . /building
|
COPY . /building
|
||||||
WORKDIR /building
|
WORKDIR /building
|
||||||
|
|||||||
Reference in New Issue
Block a user