Compare commits

...

9 Commits

4 changed files with 98 additions and 21 deletions

View File

@@ -4,8 +4,6 @@ on:
push: push:
branches: branches:
- '**' - '**'
tags:
- '**'
workflow_dispatch: workflow_dispatch:
workflow_call: workflow_call:

View File

@@ -17,7 +17,7 @@ permissions:
jobs: jobs:
# 调用 build-all workflow # 调用 build-all workflow
build: build:
uses: ./.github/workflows/build-all.yml uses: ./.github/workflows/build-all.yaml
permissions: permissions:
contents: read contents: read
@@ -47,17 +47,49 @@ jobs:
with: with:
path: artifacts path: artifacts
- name: Display artifact structure
run: |
echo "Artifact structure:"
ls -R artifacts/
- 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
echo "No archives found, looking for directories to package..."
for dir in artifacts/*/; do
if [ -d "$dir" ]; then
artifact_name=$(basename "$dir")
echo "Packaging $artifact_name"
# 检查是否是 Windows 构建
if echo "$artifact_name" | grep -q "windows"; then
(cd "$dir" && zip -r "../../release_files/${artifact_name}.zip" .)
else
tar -czf "release_files/${artifact_name}.tar.gz" -C "$dir" .
fi
fi
done
fi
echo "Files in release_files:"
ls -lh release_files/ ls -lh release_files/
- name: Generate checksums - name: Generate checksums
run: | run: |
cd release_files cd release_files
sha256sum * > sha256sum.txt if [ -n "$(ls -A .)" ]; then
cat sha256sum.txt sha256sum * > sha256sum.txt
cat sha256sum.txt
else
echo "No files to generate checksums for!"
exit 1
fi
- name: Save checksums for changelog - name: Save checksums for changelog
id: checksums id: checksums

View File

@@ -14,7 +14,7 @@
package version package version
var version = "LoliaFRP-CLI 0.66.0" var version = "LoliaFRP-CLI 0.66.1"
func Full() string { func Full() string {
return version return version

View File

@@ -28,23 +28,70 @@ var NotFoundPagePath = ""
const ( const (
NotFound = `<!DOCTYPE html> NotFound = `<!DOCTYPE html>
<html> <html lang="zh-CN">
<head> <head>
<title>Not Found</title> <meta charset="UTF-8">
<style> <meta name="viewport" content="width=device-width, initial-scale=1.0">
body { <title>404 - 未绑定域名</title>
width: 35em; <style>
margin: 0 auto; body {
font-family: Tahoma, Verdana, Arial, sans-serif; font-family: -apple-system, sans-serif;
} display: flex;
</style> align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
background: #fff;
color: #333;
}
.container {
max-width: 600px;
padding: 40px 20px;
text-align: center;
}
h1 {
font-size: 32px;
font-weight: 600;
margin-bottom: 20px;
}
p {
line-height: 1.8;
color: #666;
margin: 10px 0;
}
ul {
text-align: left;
margin: 20px auto;
max-width: 400px;
}
li {
margin: 8px 0;
color: #666;
}
a {
color: #0066cc;
text-decoration: none;
}
a:hover { text-decoration: underline; }
.footer {
margin-top: 40px;
font-size: 14px;
color: #999;
}
</style>
</head> </head>
<body> <body>
<h1>The page you requested was not found.</h1> <div class="container">
<p>Sorry, the page you are looking for is currently unavailable.<br/> <h1>域名未绑定绑定</h1>
Please try again later.</p> <p>这个域名还没有绑定到任何隧道哦 (;д;)</p>
<p>The server is powered by <a href="https://github.com/fatedier/frp">frp</a>.</p> <p><strong>可能是这些原因:</strong></p>
<p><em>Faithfully yours, frp.</em></p> <ul>
<li>域名配置不对,或者没有正确解析</li>
<li>隧道可能还没启动,或者已经停止</li>
<li>自定义域名忘记在服务端配置了</li>
</ul>
<div class="footer">由 <a href="https://lolia.link/">LoliaFRP</a> 与捐赠者们用爱发电</div>
</div>
</body> </body>
</html> </html>
` `
@@ -69,7 +116,7 @@ func getNotFoundPageContent() []byte {
func NotFoundResponse() *http.Response { func NotFoundResponse() *http.Response {
header := make(http.Header) header := make(http.Header)
header.Set("server", "frp/"+version.Full()) header.Set("server", version.Full())
header.Set("Content-Type", "text/html") header.Set("Content-Type", "text/html")
content := getNotFoundPageContent() content := getNotFoundPageContent()