mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-13 02:26:36 +08:00
[优化] 更新包名
This commit is contained in:
@@ -42,7 +42,7 @@ jobs:
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
justsong/gin-template
|
||||
ghcr.io/rain-kl/atsflare
|
||||
ghcr.io/${{ github.repository }}
|
||||
|
||||
- name: Build and push Docker images
|
||||
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
justsong/gin-template
|
||||
ghcr.io/rain-kl/atsflare
|
||||
ghcr.io/${{ github.repository }}
|
||||
|
||||
- name: Build and push Docker images
|
||||
|
||||
@@ -33,21 +33,21 @@ jobs:
|
||||
- name: Build Backend (amd64)
|
||||
run: |
|
||||
go mod download
|
||||
go build -ldflags "-s -w -X 'gin-template/common.Version=$(git describe --tags)' -extldflags '-static'" -o gin-template
|
||||
go build -ldflags "-s -w -X 'atsflare/common.Version=$(git describe --tags)' -extldflags '-static'" -o atsflare
|
||||
|
||||
- name: Build Backend (arm64)
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-aarch64-linux-gnu
|
||||
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X 'gin-template/common.Version=$(git describe --tags)' -extldflags '-static'" -o gin-template-arm64
|
||||
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X 'atsflare/common.Version=$(git describe --tags)' -extldflags '-static'" -o atsflare-arm64
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: |
|
||||
gin-template
|
||||
gin-template-arm64
|
||||
atsflare
|
||||
atsflare-arm64
|
||||
draft: false
|
||||
generate_release_notes: true
|
||||
env:
|
||||
|
||||
@@ -33,12 +33,12 @@ jobs:
|
||||
- name: Build Backend
|
||||
run: |
|
||||
go mod download
|
||||
go build -ldflags "-X 'gin-template/common.Version=$(git describe --tags)'" -o gin-template-macos
|
||||
go build -ldflags "-X 'atsflare/common.Version=$(git describe --tags)'" -o atsflare-macos
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: gin-template-macos
|
||||
files: atsflare-macos
|
||||
draft: false
|
||||
generate_release_notes: true
|
||||
env:
|
||||
|
||||
@@ -36,12 +36,12 @@ jobs:
|
||||
- name: Build Backend
|
||||
run: |
|
||||
go mod download
|
||||
go build -ldflags "-s -w -X 'gin-template/common.Version=$(git describe --tags)'" -o gin-template.exe
|
||||
go build -ldflags "-s -w -X 'atsflare/common.Version=$(git describe --tags)'" -o atsflare.exe
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: gin-template.exe
|
||||
files: atsflare.exe
|
||||
draft: false
|
||||
generate_release_notes: true
|
||||
env:
|
||||
|
||||
+22
-27
@@ -3,43 +3,38 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/songquanpeng/gin-template"><img src="https://raw.githubusercontent.com/songquanpeng/gin-template/main/web/public/logo.png" width="150" height="150" alt="gin-template logo"></a>
|
||||
<a href="https://github.com/Rain-kl/ATSFlare"><img src="https://raw.githubusercontent.com/Rain-kl/ATSFlare/main/atsf_server/web/public/logo.png" width="150" height="150" alt="ATSFlare logo"></a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# Gin Template
|
||||
# ATSFlare
|
||||
|
||||
_✨ Template for Gin & React projects ✨_
|
||||
_✨ Internal Nginx control plane for reverse proxy management ✨_
|
||||
|
||||
</div>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://raw.githubusercontent.com/songquanpeng/gin-template/main/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/songquanpeng/gin-template?color=brightgreen" alt="license">
|
||||
<a href="https://raw.githubusercontent.com/Rain-kl/ATSFlare/main/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/Rain-kl/ATSFlare?color=brightgreen" alt="license">
|
||||
</a>
|
||||
<a href="https://github.com/songquanpeng/gin-template/releases/latest">
|
||||
<img src="https://img.shields.io/github/v/release/songquanpeng/gin-template?color=brightgreen&include_prereleases" alt="release">
|
||||
<a href="https://github.com/Rain-kl/ATSFlare/releases/latest">
|
||||
<img src="https://img.shields.io/github/v/release/Rain-kl/ATSFlare?color=brightgreen&include_prereleases" alt="release">
|
||||
</a>
|
||||
<a href="https://hub.docker.com/repository/docker/justsong/gin-template">
|
||||
<img src="https://img.shields.io/docker/pulls/justsong/gin-template?color=brightgreen" alt="docker pull">
|
||||
<a href="https://github.com/Rain-kl/ATSFlare/releases/latest">
|
||||
<img src="https://img.shields.io/github/downloads/Rain-kl/ATSFlare/total?color=brightgreen&include_prereleases" alt="release">
|
||||
</a>
|
||||
<a href="https://github.com/songquanpeng/gin-template/releases/latest">
|
||||
<img src="https://img.shields.io/github/downloads/songquanpeng/gin-template/total?color=brightgreen&include_prereleases" alt="release">
|
||||
</a>
|
||||
<a href="https://goreportcard.com/report/github.com/songquanpeng/go-file">
|
||||
<img src="https://goreportcard.com/badge/github.com/songquanpeng/gin-template" alt="GoReportCard">
|
||||
<a href="https://goreportcard.com/report/github.com/Rain-kl/ATSFlare">
|
||||
<img src="https://goreportcard.com/badge/github.com/Rain-kl/ATSFlare" alt="GoReportCard">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/songquanpeng/gin-template/releases">Download</a>
|
||||
<a href="https://github.com/Rain-kl/ATSFlare/releases">Download</a>
|
||||
·
|
||||
<a href="https://github.com/songquanpeng/gin-template/blob/main/README.en.md#deployment">Tutorial</a>
|
||||
<a href="https://github.com/Rain-kl/ATSFlare/blob/main/README.en.md#deployment">Tutorial</a>
|
||||
·
|
||||
<a href="https://github.com/songquanpeng/gin-template/issues">Feedback</a>
|
||||
·
|
||||
<a href="https://gin-template.vercel.app/">Demo</a>
|
||||
<a href="https://github.com/Rain-kl/ATSFlare/issues">Feedback</a>
|
||||
</p>
|
||||
|
||||
## Features
|
||||
@@ -57,23 +52,23 @@ _✨ Template for Gin & React projects ✨_
|
||||
|
||||
## Deployment
|
||||
### Manual deployment
|
||||
1. Download built binary from [GitHub Releases](https://github.com/songquanpeng/gin-template/releases/latest) or build from source:
|
||||
1. Download built binary from [GitHub Releases](https://github.com/Rain-kl/ATSFlare/releases/latest) or build from source:
|
||||
```shell
|
||||
git clone https://github.com/songquanpeng/gin-template.git
|
||||
git clone https://github.com/Rain-kl/ATSFlare.git
|
||||
go mod download
|
||||
go build -ldflags "-s -w" -o gin-template
|
||||
go build -ldflags "-s -w" -o atsflare
|
||||
````
|
||||
2. Run it:
|
||||
```shell
|
||||
chmod u+x gin-template
|
||||
./gin-template --port 3000 --log-dir ./logs
|
||||
chmod u+x atsflare
|
||||
./atsflare --port 3000 --log-dir ./logs
|
||||
```
|
||||
3. Visit [http://localhost:3000/](http://localhost:3000/) and login. The username for the initial account is `root` and the password is `123456`.
|
||||
|
||||
### Deploy with Docker
|
||||
Execute: `docker run -d --restart always -p 3000:3000 -v /home/ubuntu/data/gin-template:/data -v /etc/ssl/certs:/etc/ssl/certs:ro justsong/gin-template`
|
||||
Execute: `docker run -d --restart always -p 3000:3000 -v /home/ubuntu/data/atsflare:/data -v /etc/ssl/certs:/etc/ssl/certs:ro ghcr.io/rain-kl/atsflare`
|
||||
|
||||
Data will be saved in `/home/ubuntu/data/gin-template`.
|
||||
Data will be saved in `/home/ubuntu/data/atsflare`.
|
||||
|
||||
## Configurations
|
||||
The system works out of the box.
|
||||
@@ -88,7 +83,7 @@ After the system starts, use `root` user to log in to the system and do further
|
||||
2. `SESSION_SECRET`: when set, a fixed session key will be used so that the logged-in users' cookie remains valid across system reboots.
|
||||
+ Example: `SESSION_SECRET=random_string`
|
||||
3. `SQL_DSN`: when set, the target SQL database will be used instead of SQLite.
|
||||
+ Example: `SQL_DSN=root:123456@tcp(localhost:3306)/gin-template`
|
||||
+ Example: `SQL_DSN=root:123456@tcp(localhost:3306)/atsflare`
|
||||
|
||||
### Command line Arguments
|
||||
1. `--port <port_number>`: specify the port number, the default value is `3000`.
|
||||
|
||||
@@ -16,7 +16,7 @@ WORKDIR /build
|
||||
COPY . .
|
||||
COPY --from=builder /build/build ./web/build
|
||||
RUN go mod download
|
||||
RUN go build -ldflags "-s -w -X 'gin-template/common.Version=$(cat VERSION)' -extldflags '-static'" -o gin-template
|
||||
RUN go build -ldflags "-s -w -X 'atsflare/common.Version=$(cat VERSION)' -extldflags '-static'" -o atsflare
|
||||
|
||||
FROM alpine
|
||||
|
||||
@@ -25,7 +25,7 @@ RUN apk update \
|
||||
&& apk add --no-cache ca-certificates tzdata \
|
||||
&& update-ca-certificates 2>/dev/null || true
|
||||
ENV PORT=3000
|
||||
COPY --from=builder2 /build/gin-template /
|
||||
COPY --from=builder2 /build/atsflare /
|
||||
EXPOSE 3000
|
||||
WORKDIR /data
|
||||
ENTRYPOINT ["/gin-template"]
|
||||
ENTRYPOINT ["/atsflare"]
|
||||
|
||||
@@ -20,10 +20,10 @@ var (
|
||||
var UploadPath = "upload"
|
||||
|
||||
func printHelp() {
|
||||
fmt.Println("Gin Template " + Version + " - Your next project starts from here.")
|
||||
fmt.Println("ATSFlare " + Version + " - Internal Nginx Control Plane.")
|
||||
fmt.Println("Copyright (C) 2023 JustSong. All rights reserved.")
|
||||
fmt.Println("GitHub: https://github.com/songquanpeng/gin-template")
|
||||
fmt.Println("Usage: gin-template [--port <port>] [--log-dir <log directory>] [--version] [--help]")
|
||||
fmt.Println("GitHub: https://github.com/Rain-kl/ATSFlare")
|
||||
fmt.Println("Usage: atsflare [--port <port>] [--log-dir <log directory>] [--version] [--help]")
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/model"
|
||||
"atsflare/service"
|
||||
"encoding/json"
|
||||
"gin-template/model"
|
||||
"gin-template/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"gin-template/service"
|
||||
"atsflare/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"fmt"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/service"
|
||||
"encoding/json"
|
||||
"gin-template/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/service"
|
||||
"encoding/json"
|
||||
"gin-template/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"encoding/json"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/service"
|
||||
"encoding/json"
|
||||
"gin-template/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/service"
|
||||
"encoding/json"
|
||||
"gin-template/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"encoding/json"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/google/uuid"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
module gin-template
|
||||
module atsflare
|
||||
|
||||
// +heroku goVersion go1.18
|
||||
go 1.18
|
||||
|
||||
+5
-5
@@ -1,12 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/middleware"
|
||||
"atsflare/model"
|
||||
"atsflare/router"
|
||||
"embed"
|
||||
"fmt"
|
||||
"gin-template/common"
|
||||
"gin-template/middleware"
|
||||
"gin-template/model"
|
||||
"gin-template/router"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-contrib/sessions/cookie"
|
||||
"github.com/gin-contrib/sessions/redis"
|
||||
@@ -24,7 +24,7 @@ var indexPage []byte
|
||||
|
||||
func main() {
|
||||
common.SetupGinLog()
|
||||
common.SysLog("Gin Template " + common.Version + " started")
|
||||
common.SysLog("ATSFlare " + common.Version + " started")
|
||||
if os.Getenv("GIN_MODE") != "debug" {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"gin-template/service"
|
||||
"atsflare/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
|
||||
@@ -7,6 +7,6 @@ import (
|
||||
|
||||
func CORS() gin.HandlerFunc {
|
||||
config := cors.DefaultConfig()
|
||||
config.AllowOrigins = []string{"https://gin-template.vercel.app", "http://localhost:3000/"}
|
||||
config.AllowOrigins = []string{"https://atsflare.vercel.app", "http://localhost:3000/"}
|
||||
return cors.New(config)
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"context"
|
||||
"fmt"
|
||||
"gin-template/common"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"encoding/json"
|
||||
"gin-template/common"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gin-template/common"
|
||||
"atsflare/common"
|
||||
"gorm.io/gorm"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gin-template/common"
|
||||
"atsflare/common"
|
||||
"github.com/glebarez/sqlite"
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gin-template/common"
|
||||
"atsflare/common"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"errors"
|
||||
"gin-template/common"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"gin-template/controller"
|
||||
"gin-template/middleware"
|
||||
"atsflare/controller"
|
||||
"atsflare/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package router_test
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"atsflare/router"
|
||||
"atsflare/service"
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
@@ -8,10 +12,6 @@ import (
|
||||
"crypto/x509/pkix"
|
||||
"encoding/json"
|
||||
"encoding/pem"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"gin-template/router"
|
||||
"gin-template/service"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-contrib/sessions/cookie"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package router_test
|
||||
|
||||
import (
|
||||
"gin-template/common"
|
||||
"gin-template/router"
|
||||
"atsflare/common"
|
||||
"atsflare/router"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-contrib/sessions/cookie"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package router_test
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"atsflare/router"
|
||||
"atsflare/service"
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"gin-template/router"
|
||||
"gin-template/service"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-contrib/sessions/cookie"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/controller"
|
||||
"atsflare/middleware"
|
||||
"embed"
|
||||
"gin-template/common"
|
||||
"gin-template/controller"
|
||||
"gin-template/middleware"
|
||||
"github.com/gin-contrib/static"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"atsflare/model"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gin-template/model"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/x509"
|
||||
"crypto/x509/pkix"
|
||||
"encoding/pem"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"math/big"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"atsflare/model"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gin-template/model"
|
||||
"sort"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"atsflare/common"
|
||||
"atsflare/model"
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"gin-template/common"
|
||||
"gin-template/model"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"atsflare/model"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"gin-template/model"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"atsflare/model"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gin-template/model"
|
||||
"mime/multipart"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -41,9 +41,7 @@ function App() {
|
||||
const res = await API.get('/api/status');
|
||||
const { success, data } = res.data;
|
||||
if (success) {
|
||||
console.log(
|
||||
`GitHub 仓库地址:https://github.com/songquanpeng/gin-template`
|
||||
);
|
||||
console.log(`GitHub 仓库地址:https://github.com/Rain-kl/ATSFlare`);
|
||||
localStorage.setItem('status', JSON.stringify(data));
|
||||
statusDispatch({ type: 'set', payload: data });
|
||||
localStorage.setItem('system_name', data.system_name);
|
||||
|
||||
@@ -18,16 +18,13 @@ const Footer = () => {
|
||||
) : (
|
||||
<div className='custom-footer'>
|
||||
<a
|
||||
href='https://github.com/songquanpeng/gin-template'
|
||||
href='https://github.com/Rain-kl/ATSFlare'
|
||||
target='_blank'
|
||||
rel='noreferrer'
|
||||
>
|
||||
{systemName} {process.env.REACT_APP_VERSION}{' '}
|
||||
</a>
|
||||
由{' '}
|
||||
<a href='https://github.com/songquanpeng' target='_blank'>
|
||||
JustSong
|
||||
</a>{' '}
|
||||
构建,源代码遵循{' '}
|
||||
开源于 GitHub,源代码遵循{' '}
|
||||
<a href='https://opensource.org/licenses/mit-license.php'>
|
||||
MIT 协议
|
||||
</a>
|
||||
|
||||
@@ -78,13 +78,12 @@ const OtherSetting = () => {
|
||||
};
|
||||
|
||||
const openGitHubRelease = () => {
|
||||
window.location =
|
||||
'https://github.com/songquanpeng/gin-template/releases/latest';
|
||||
window.location = 'https://github.com/Rain-kl/ATSFlare/releases/latest';
|
||||
};
|
||||
|
||||
const checkUpdate = async () => {
|
||||
const res = await API.get(
|
||||
'https://api.github.com/repos/songquanpeng/gin-template/releases/latest'
|
||||
'https://api.github.com/repos/Rain-kl/ATSFlare/releases/latest'
|
||||
);
|
||||
const { tag_name, body } = res.data;
|
||||
if (tag_name === process.env.REACT_APP_VERSION) {
|
||||
|
||||
@@ -34,8 +34,8 @@ const About = () => {
|
||||
<Header as='h3'>关于</Header>
|
||||
<p>可在设置页面设置关于内容,支持 HTML & Markdown</p>
|
||||
项目仓库地址:
|
||||
<a href='https://github.com/songquanpeng/gin-template'>
|
||||
https://github.com/songquanpeng/gin-template
|
||||
<a href='https://github.com/Rain-kl/ATSFlare'>
|
||||
https://github.com/Rain-kl/ATSFlare
|
||||
</a>
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -54,10 +54,10 @@ const Home = () => {
|
||||
<p>
|
||||
源码:
|
||||
<a
|
||||
href='https://github.com/songquanpeng/gin-template'
|
||||
href='https://github.com/Rain-kl/ATSFlare'
|
||||
target='_blank'
|
||||
>
|
||||
https://github.com/songquanpeng/gin-template
|
||||
https://github.com/Rain-kl/ATSFlare
|
||||
</a>
|
||||
</p>
|
||||
<p>启动时间:{getStartTimeString()}</p>
|
||||
|
||||
+2
-2
@@ -40,13 +40,13 @@ npm run build
|
||||
```bash
|
||||
cd atsf_server
|
||||
export SESSION_SECRET='replace-with-random-string'
|
||||
export SQLITE_PATH='./gin-template.db'
|
||||
export SQLITE_PATH='./atsflare.db'
|
||||
go run .
|
||||
```
|
||||
|
||||
说明:
|
||||
|
||||
- 如果未设置 `SQLITE_PATH`,默认也会落到 `atsf_server/gin-template.db`
|
||||
- 如果未设置 `SQLITE_PATH`,默认也会落到 `atsf_server/atsflare.db`
|
||||
- 当前不再依赖全局 `AGENT_TOKEN` 环境变量
|
||||
- 节点接入凭证改由数据库保存:节点专属 `agent_token` + 系统级 `discovery token`
|
||||
- 当前默认监听端口为 `3000`
|
||||
|
||||
+5
-5
@@ -94,12 +94,12 @@
|
||||
|
||||
### Server
|
||||
|
||||
控制中心直接基于现有 `atsf_server` 的 `gin-template` 工程开发:
|
||||
控制中心直接基于现有 `atsf_server` 的 `ATSFlare` 工程开发:
|
||||
|
||||
* Web 框架:Gin
|
||||
* ORM:GORM
|
||||
* 前端:沿用现有 web 管理端
|
||||
* 鉴权:沿用 gin-template 登录体系
|
||||
* 鉴权:沿用 ATSFlare 登录体系
|
||||
|
||||
### 数据库
|
||||
|
||||
@@ -139,7 +139,7 @@ Agent 使用 Go 单体程序:
|
||||
```text
|
||||
┌────────────────────────────┐
|
||||
│ ATSFlare Server │
|
||||
│ gin-template + SQLite │
|
||||
│ ATSFlare + SQLite │
|
||||
│ Admin UI + Admin API │
|
||||
└──────────────┬─────────────┘
|
||||
│
|
||||
@@ -548,7 +548,7 @@ Agent 每次上报:
|
||||
|
||||
管理端:
|
||||
|
||||
* 直接沿用 gin-template 的登录态
|
||||
* 直接沿用 ATSFlare 的登录态
|
||||
|
||||
Agent(第一版):
|
||||
|
||||
@@ -567,7 +567,7 @@ Agent(第二版):
|
||||
|
||||
### 12.1 登录页
|
||||
|
||||
沿用 gin-template 现有登录。
|
||||
沿用 ATSFlare 现有登录。
|
||||
|
||||
### 12.2 反代规则页(第一版,已实现)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
* ORM:GORM
|
||||
* 数据库:SQLite
|
||||
* 前端:现有 `atsf_server/web`
|
||||
* 登录体系:沿用 gin-template 现有能力
|
||||
* 登录体系:沿用 ATSFlare 现有能力
|
||||
|
||||
约束:
|
||||
|
||||
@@ -126,7 +126,7 @@ Agent 放在 `atsf_agent`,使用 Go 单体程序开发。
|
||||
* 所有发布都是"新版本激活",不是在线覆盖编辑。
|
||||
* 第一版与第二版:所有节点默认拉同一份全量配置,不做节点分组差异化下发。
|
||||
* 能用 SQLite 解决的问题,不引入额外中间件。
|
||||
* 新功能优先复用现有 gin-template 结构,不平行造第二套框架。
|
||||
* 新功能优先复用现有 ATSFlare 结构,不平行造第二套框架。
|
||||
|
||||
## 5. 数据模型规范
|
||||
|
||||
@@ -205,7 +205,7 @@ Server 代码按以下职责拆分:
|
||||
|
||||
管理端:
|
||||
|
||||
* 继续复用 gin-template 的登录、角色和 session 体系
|
||||
* 继续复用 ATSFlare 的登录、角色和 session 体系
|
||||
|
||||
Agent(第一版):
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ MVP 已于第一版完成。当前进入第二版迭代。
|
||||
* 节点配置文件填写节点专属 `agent_token` 时,可直接上线;若 `agent_token` 为空且填写全局 discovery token,则会自动注册并完成 token 置换
|
||||
|
||||
|
||||
### V2 Phase 4: 路由自定义头
|
||||
### V2 Phase 4: 路由自定义头 ✅
|
||||
|
||||
目标:
|
||||
|
||||
@@ -155,7 +155,7 @@ MVP 已于第一版完成。当前进入第二版迭代。
|
||||
* 路由配置自定义头后发布,渲染结果包含对应 `proxy_set_header` 指令
|
||||
* 不配置自定义头的路由渲染行为与之前保持一致
|
||||
|
||||
### V2 Phase 5: 配置预览与变更摘要
|
||||
### V2 Phase 5: 配置预览与变更摘要 ✅
|
||||
|
||||
目标:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user