diff --git a/.air.toml b/.air.toml index 82c977d3..96b8b457 100644 --- a/.air.toml +++ b/.air.toml @@ -15,9 +15,9 @@ full_bin = "APP_ENV=dev APP_USER=air ./tmp/main" # Watch these filename extensions. include_ext = ["go", "tpl", "tmpl", "html", "toml"] # Ignore these filename extensions or directories. -exclude_dir = ["assets", "tmp", "vendor", "frontend/node_modules", "upload", "docs", "resources", .ts", ".vue", ".tsx", ".idea"] +exclude_dir = ["assets", "tmp", "vendor", "app/node_modules", "upload", "docs", "resources", .ts", ".vue", ".tsx", ".idea"] # Watch these directories if you specified. -include_dir = ["frontend/src/language"] +include_dir = ["app/src/language"] # Exclude files. exclude_file = [] # Exclude specific regular expressions. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aebe9358..a20f5502 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,8 +7,8 @@ on: paths: - "**/*.js" - "**/*.vue" - - "frontend/package.json" - - "frontend/.env*" + - "app/package.json" + - "app/.env*" - "**/*.go" - "go.mod" - "go.sum" @@ -21,8 +21,8 @@ on: paths: - "**/*.js" - "**/*.vue" - - "frontend/package.json" - - "frontend/.env*" + - "app/package.json" + - "app/.env*" - "**/*.go" - "go.mod" - "go.sum" @@ -35,7 +35,7 @@ on: - published jobs: - build_frontend: + build_app: runs-on: ubuntu-latest steps: - name: Checkout @@ -51,35 +51,35 @@ jobs: corepack enable corepack prepare pnpm@latest --activate pnpm install - working-directory: frontend + working-directory: app - name: Build run: | npx browserslist@latest --update-db pnpm build - working-directory: frontend + working-directory: app - - name: Archive frontend artifacts + - name: Archive app artifacts uses: actions/upload-artifact@v3 with: - name: frontend-dist - path: frontend/dist + name: app-dist + path: app/dist - name: Prepare publish if: github.event_name == 'release' run: | - cp README*.md frontend/dist - find frontend/dist -printf '%P\n' | tar -C frontend/dist --no-recursion -zcvf frontend-dist.tar.gz -T - + cp README*.md app/dist + find app/dist -printf '%P\n' | tar -C app/dist --no-recursion -zcvf app-dist.tar.gz -T - - name: Publish uses: softprops/action-gh-release@v1 if: github.event_name == 'release' with: - files: frontend-dist.tar.gz + files: app-dist.tar.gz build: runs-on: ubuntu-latest - needs: build_frontend + needs: build_app strategy: matrix: goos: [ linux, darwin ] @@ -163,11 +163,11 @@ jobs: echo "CXX=${{ env.ARCH_NAME }}-clang++" >> $GITHUB_ENV echo "LD_FLAGS=-w" >> $GITHUB_ENV - - name: Download frontend artifacts + - name: Download app artifacts uses: actions/download-artifact@v3 with: - name: frontend-dist - path: frontend/dist + name: app-dist + path: app/dist - name: Build run: | diff --git a/README-es.md b/README-es.md index 8da3d997..fbffa12c 100644 --- a/README-es.md +++ b/README-es.md @@ -49,7 +49,7 @@ Para consultar la documentación, visite [nginxui.com](https://nginxui.com). Compilación manual @@ -223,7 +223,7 @@ En plataformas que no tienen una versión de compilación oficial, pueden compil ### Compilación del Frontend -Ejecute el siguiente comando en el directorio `frontend`. +Ejecute el siguiente comando en el directorio `app`. ```shell yarn install diff --git a/README-zh_CN.md b/README-zh_CN.md index 61c9badc..f61a0a3e 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -217,7 +217,7 @@ docker run -dit \ ### 构建前端 -请在 `frontend` 目录中执行以下命令。 +请在 `app` 目录中执行以下命令。 ```shell yarn install diff --git a/README-zh_TW.md b/README-zh_TW.md index 830b7e2c..e01a887b 100644 --- a/README-zh_TW.md +++ b/README-zh_TW.md @@ -222,7 +222,7 @@ docker run -dit \ ### 建置前端 -請在 `frontend` 資料夾中執行以下命令。 +請在 `app` 資料夾中執行以下命令。 ```shell yarn install diff --git a/README.md b/README.md index 90db4a87..ea6e6ecd 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ English | [Español](README-es.md) | [简体中文](README-zh_CN.md) | [繁體 Manual Build @@ -283,7 +283,7 @@ On platforms that do not have an official build version, they can be built manua ### Build Frontend -Please execute the following command in `frontend` directory. +Please execute the following command in `app` directory. ```shell yarn install @@ -292,7 +292,7 @@ yarn build ### Build Backend -Please build the frontend first, and then execute the following command in the project root directory. +Please build the app first, and then execute the following command in the project root directory. ```shell go build -o nginx-ui -v main.go diff --git a/api/cert.go b/api/cert.go index 8c11c653..a86a5d13 100644 --- a/api/cert.go +++ b/api/cert.go @@ -1,7 +1,7 @@ package api import ( - cert2 "github.com/0xJacky/Nginx-UI/internal/cert" + "github.com/0xJacky/Nginx-UI/internal/cert" "github.com/0xJacky/Nginx-UI/internal/cert/dns" "github.com/0xJacky/Nginx-UI/internal/logger" "github.com/0xJacky/Nginx-UI/internal/nginx" @@ -69,7 +69,7 @@ func IssueCert(c *gin.Context) { }(ws) // read - buffer := &cert2.ConfigPayload{} + buffer := &cert.ConfigPayload{} err = ws.ReadJSON(buffer) @@ -88,13 +88,13 @@ func IssueCert(c *gin.Context) { logChan := make(chan string, 1) errChan := make(chan error, 1) - go cert2.IssueCert(buffer, logChan, errChan) + go cert.IssueCert(buffer, logChan, errChan) go handleIssueCertLogChan(ws, logChan) // block, until errChan closes for err = range errChan { - errLog := &cert2.AutoCertErrorLog{} + errLog := &cert.AutoCertErrorLog{} errLog.SetCertModel(&certModel) errLog.Exit("issue cert", err) @@ -169,7 +169,7 @@ func getCert(c *gin.Context, certModel *model.Cert) { sslCertificationBytes, _ = os.ReadFile(certModel.SSLCertificatePath) } - pubKey, err := cert2.GetCertInfo(certModel.SSLCertificatePath) + pubKey, err := cert.GetCertInfo(certModel.SSLCertificatePath) if err != nil { ErrHandler(c, err) diff --git a/app/package.json b/app/package.json index 1adf8830..2e8631a3 100644 --- a/app/package.json +++ b/app/package.json @@ -1,5 +1,5 @@ { - "name": "nginx-ui-frontend-next", + "name": "nginx-ui-app-next", "private": true, "version": "2.0.0-beta.4", "type": "commonjs", diff --git a/app/src/language/es/app.po b/app/src/language/es/app.po index 1e39da50..63c29127 100644 --- a/app/src/language/es/app.po +++ b/app/src/language/es/app.po @@ -6,7 +6,7 @@ msgstr "" "PO-Revision-Date: 2023-09-03 08:56+0000\n" "Last-Translator: Kcho \n" "Language-Team: Spanish \n" +"app/es/>\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/docs/guide/build.md b/docs/guide/build.md index 8657db7a..abff5d0e 100644 --- a/docs/guide/build.md +++ b/docs/guide/build.md @@ -16,7 +16,7 @@ You should execute the following command to update browser list database before ## Build Frontend -Please execute the following command in `frontend` directory. +Please execute the following command in `app` directory. ```shell yarn install @@ -27,7 +27,7 @@ yarn build ## Build Backend ::: warning -Before building the backend, the frontend should be built first because the backend will embed the frontend distribution. +Before building the backend, the app should be built first because the backend will embed the app distribution. ::: Please execute the following command in the project root directory. diff --git a/docs/guide/nginx-ui-template.md b/docs/guide/nginx-ui-template.md index dac61684..dbbf20a4 100644 --- a/docs/guide/nginx-ui-template.md +++ b/docs/guide/nginx-ui-template.md @@ -103,7 +103,7 @@ location ~ .*\.(jpg|png|js|css)$ { } ``` -When users input variable values in the frontend input boxes, the system will automatically generate new configuration content, as shown below: +When users input variable values in the app input boxes, the system will automatically generate new configuration content, as shown below: diff --git a/docs/guide/project-structure.md b/docs/guide/project-structure.md index dbd0d65c..d0b2f8e2 100644 --- a/docs/guide/project-structure.md +++ b/docs/guide/project-structure.md @@ -6,7 +6,7 @@ . ├─ docs # documentations ├─ cmd # command-line tool -├─ frontend # frontend build with vue 3 +├─ app # app build with vue 3 ├─ server # backend build with golang ├─ resources # additional resources, not for build ├─ template # templates for nginx @@ -35,7 +35,7 @@ ``` . -├─ frontend +├─ app │ ├─ public # public resources │ ├─ src # source code │ │ ├─ api # api to backend diff --git a/docs/zh_CN/guide/build.md b/docs/zh_CN/guide/build.md index 8374273d..0e628b07 100644 --- a/docs/zh_CN/guide/build.md +++ b/docs/zh_CN/guide/build.md @@ -15,7 +15,7 @@ ## 构建前端 -请在 `frontend` 目录中执行以下命令。 +请在 `app` 目录中执行以下命令。 ```shell yarn install diff --git a/docs/zh_CN/guide/project-structure.md b/docs/zh_CN/guide/project-structure.md index 8cc73e23..015e0f31 100644 --- a/docs/zh_CN/guide/project-structure.md +++ b/docs/zh_CN/guide/project-structure.md @@ -6,7 +6,7 @@ . ├─ docs # 文档目录 ├─ cmd # 命令行工具 -├─ frontend # 使用 Vue 3 构建的前端 +├─ app # 使用 Vue 3 构建的前端 ├─ server # 使用 Golang 构建的后端 ├─ resources # 其他资源,不参与构建 ├─ template # 用于 Nginx 的模板文件 @@ -35,7 +35,7 @@ ``` . -├─ frontend +├─ app │ ├─ public # 公共资源 │ ├─ src # 源代码 │ │ ├─ api # 向后端发起请求的 API diff --git a/docs/zh_TW/guide/build.md b/docs/zh_TW/guide/build.md index b3113e0f..13962623 100644 --- a/docs/zh_TW/guide/build.md +++ b/docs/zh_TW/guide/build.md @@ -15,7 +15,7 @@ ## 構建前端 -請在 `frontend` 資料夾中執行以下命令。 +請在 `app` 資料夾中執行以下命令。 ```shell yarn install diff --git a/docs/zh_TW/guide/project-structure.md b/docs/zh_TW/guide/project-structure.md index 08cfb264..8b1cf585 100644 --- a/docs/zh_TW/guide/project-structure.md +++ b/docs/zh_TW/guide/project-structure.md @@ -6,7 +6,7 @@ . ├─ docs # 手冊資料夾 ├─ cmd # 命令列工具 -├─ frontend # 使用 Vue 3 構建的前端 +├─ app # 使用 Vue 3 構建的前端 ├─ server # 使用 Golang 構建的後端 ├─ resources # 其他資源,不參與構建 ├─ template # 用於 Nginx 的模板檔案 @@ -35,7 +35,7 @@ ``` . -├─ frontend +├─ app │ ├─ public # 公共資源 │ ├─ src # 原始碼 │ │ ├─ api # 向後端發起請求的 API diff --git a/router/middleware.go b/router/middleware.go index dd79bc89..9da5734a 100644 --- a/router/middleware.go +++ b/router/middleware.go @@ -1,19 +1,19 @@ package router import ( - "encoding/base64" - "github.com/0xJacky/Nginx-UI/app" - "github.com/0xJacky/Nginx-UI/internal/logger" - "github.com/0xJacky/Nginx-UI/model" - "github.com/0xJacky/Nginx-UI/settings" - "github.com/gin-contrib/static" - "github.com/gin-gonic/gin" - "github.com/spf13/cast" - "io/fs" - "net/http" - "path" - "runtime" - "strings" + "encoding/base64" + "github.com/0xJacky/Nginx-UI/app" + "github.com/0xJacky/Nginx-UI/internal/logger" + "github.com/0xJacky/Nginx-UI/model" + "github.com/0xJacky/Nginx-UI/settings" + "github.com/gin-contrib/static" + "github.com/gin-gonic/gin" + "github.com/spf13/cast" + "io/fs" + "net/http" + "path" + "runtime" + "strings" ) func recovery() gin.HandlerFunc { @@ -99,7 +99,7 @@ func (f serverFileSystemType) Exists(prefix string, _path string) bool { func mustFS(dir string) (serverFileSystem static.ServeFileSystem) { - sub, err := fs.Sub(frontend.DistFS, path.Join("dist", dir)) + sub, err := fs.Sub(app.DistFS, path.Join("dist", dir)) if err != nil { logger.Error(err)