Skip to content

Commit 115b75c

Browse files
feat: 修改main路径,增加打包静态资源
1 parent 5f5a480 commit 115b75c

File tree

120 files changed

+1357
-414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1357
-414
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
*.so
66
*.dylib
77
.idea
8+
cmd/server/web/assets/
9+
cmd/server/web/monacoeditorwork
10+
cmd/server/web/favicon.ico
11+
cmd/server/web/index.html
12+
13+
build
814

915
# Test binary, built with `go test -c`
1016
*.test

Makefile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
GOCMD=go
2+
GOBUILD=$(GOCMD) build
3+
GOCLEAN=$(GOCMD) clean
4+
GOARCH=$(shell go env GOARCH)
5+
GOOS=$(shell go env GOOS )
6+
7+
BASE_PAH := $(shell pwd)
8+
BUILD_PATH = $(BASE_PAH)/build
9+
WEB_PATH=$(BASE_PAH)/frontend
10+
SERVER_PATH=$(BASE_PAH)/backend
11+
MAIN= $(BASE_PAH)/cmd/server/main.go
12+
APP_NAME=1panel
13+
14+
build_web:
15+
cd $(WEB_PATH) && npm install && npm run build:dev
16+
17+
build_bin:
18+
cd $(SERVER_PATH) \
19+
&& GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags "-s -w" -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
20+
21+
build_all: build_web build_bin
22+

apps/apps.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "0.0.1",
2+
"version": "0.0.3",
33
"package": ""
44
}

apps/list.json

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.1",
2+
"version": "0.0.2",
33
"tags": [
44
{
55
"key": "WebSite",
@@ -56,6 +56,20 @@
5656
"limit": 0,
5757
"crossVersionUpdate": true,
5858
"source": "http://wordpress.org/"
59+
},
60+
{
61+
"key": "redis",
62+
"name": "redis",
63+
"tags": ["Datastore"],
64+
"versions": ["7.0.5","6.0.16"],
65+
"short_desc": "缓存数据库",
66+
"icon": "redis.png",
67+
"author": "Salvatore Sanfilippo",
68+
"type": "runtime",
69+
"required": [""],
70+
"limit": 0,
71+
"crossVersionUpdate": true,
72+
"source": "https://redis.io/"
5973
}
6074
]
6175
}

apps/mysql/5.7.39/docker-compose.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ services:
1919
--character-set-server=utf8mb4
2020
--collation-server=utf8mb4_general_ci
2121
--explicit_defaults_for_timestamp=true
22-
--lower_case_table_names=1
22+
--lower_case_table_names=1
23+
24+
networks:
25+
1panel:
26+
external: true

apps/nginx/1.23.1/docker-compose.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ services:
33
container_name: ${CONTAINER_NAME}
44
image: nginx:1.23.1
55
restart: always
6+
networks:
7+
- 1panel
68
ports:
79
- ${PANEL_APP_PORT_HTTP}:80
810
- ${PANEL_APP_PORT_HTTPS}:443
@@ -11,4 +13,8 @@ services:
1113
- ./www:/home/www
1214
- ./log:/var/log/nginx
1315
- ./conf/conf.d:/etc/nginx/conf.d/
14-
- ./html:/usr/share/nginx/html
16+
- ./html:/usr/share/nginx/html
17+
18+
networks:
19+
1panel:
20+
external: true

apps/redis/6.0.16/README.md

Whitespace-only changes.

apps/redis/6.0.16/config.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"formFields": [
3+
{
4+
"type": "text",
5+
"labelZh": "密码",
6+
"labelEn": "Password",
7+
"required": true,
8+
"default": "eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81",
9+
"envKey": "PANEL_DB_ROOT_PASSWORD"
10+
},
11+
{
12+
"type": "number",
13+
"labelZh": "端口",
14+
"labelEn": "Port",
15+
"required": true,
16+
"default": 6379,
17+
"envKey": "PANEL_APP_PORT_HTTP"
18+
}
19+
]
20+
}

apps/redis/6.0.16/docker-compose.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3'
2+
services:
3+
redis-6.0.16:
4+
image: redis:6.0.16
5+
restart: always
6+
networks:
7+
- 1panel
8+
ports:
9+
- ${PANEL_APP_PORT_HTTP}:6379
10+
command: redis-server --save 20 1 --loglevel warning --requirepass eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81
11+
volumes:
12+
- ./data:/data
13+
networks:
14+
1panel:
15+
external: true

apps/redis/7.0.5/README.md

Whitespace-only changes.

apps/redis/7.0.5/config.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"formFields": [
3+
{
4+
"type": "text",
5+
"labelZh": "密码",
6+
"labelEn": "Password",
7+
"required": true,
8+
"default": "eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81",
9+
"envKey": "PANEL_DB_ROOT_PASSWORD"
10+
},
11+
{
12+
"type": "number",
13+
"labelZh": "端口",
14+
"labelEn": "Port",
15+
"required": true,
16+
"default": 6379,
17+
"envKey": "PANEL_APP_PORT_HTTP"
18+
}
19+
]
20+
}

apps/redis/7.0.5/docker-compose.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3'
2+
services:
3+
redis-7.0.5:
4+
image: redis:7.0.5
5+
restart: always
6+
networks:
7+
- 1panel
8+
ports:
9+
- ${PANEL_APP_PORT_HTTP}:6379
10+
command: redis-server --save 20 1 --loglevel warning --requirepass eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81
11+
volumes:
12+
- ./data:/data
13+
networks:
14+
1panel:
15+
external: true

backend/app/api/v1/app.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package v1
22

33
import (
4-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
5-
"github.com/1Panel-dev/1Panel/app/dto"
6-
"github.com/1Panel-dev/1Panel/constant"
4+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
5+
"github.com/1Panel-dev/1Panel/backend/app/dto"
6+
"github.com/1Panel-dev/1Panel/backend/constant"
77
"github.com/gin-gonic/gin"
88
"strconv"
99
)

backend/app/api/v1/auth.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package v1
33
import (
44
"errors"
55

6-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
7-
"github.com/1Panel-dev/1Panel/app/dto"
8-
"github.com/1Panel-dev/1Panel/constant"
9-
"github.com/1Panel-dev/1Panel/global"
10-
"github.com/1Panel-dev/1Panel/utils/captcha"
11-
"github.com/1Panel-dev/1Panel/utils/encrypt"
6+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
7+
"github.com/1Panel-dev/1Panel/backend/app/dto"
8+
"github.com/1Panel-dev/1Panel/backend/constant"
9+
"github.com/1Panel-dev/1Panel/backend/global"
10+
"github.com/1Panel-dev/1Panel/backend/utils/captcha"
11+
"github.com/1Panel-dev/1Panel/backend/utils/encrypt"
1212
"github.com/gin-gonic/gin"
1313
)
1414

backend/app/api/v1/backup.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package v1
22

33
import (
4-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
5-
"github.com/1Panel-dev/1Panel/app/dto"
6-
"github.com/1Panel-dev/1Panel/constant"
7-
"github.com/1Panel-dev/1Panel/global"
4+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
5+
"github.com/1Panel-dev/1Panel/backend/app/dto"
6+
"github.com/1Panel-dev/1Panel/backend/constant"
7+
"github.com/1Panel-dev/1Panel/backend/global"
88
"github.com/gin-gonic/gin"
99
)
1010

backend/app/api/v1/command.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package v1
22

33
import (
4-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
5-
"github.com/1Panel-dev/1Panel/app/dto"
6-
"github.com/1Panel-dev/1Panel/constant"
7-
"github.com/1Panel-dev/1Panel/global"
4+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
5+
"github.com/1Panel-dev/1Panel/backend/app/dto"
6+
"github.com/1Panel-dev/1Panel/backend/constant"
7+
"github.com/1Panel-dev/1Panel/backend/global"
88
"github.com/gin-gonic/gin"
99
)
1010

backend/app/api/v1/cronjob.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"os"
55
"time"
66

7-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
8-
"github.com/1Panel-dev/1Panel/app/dto"
9-
"github.com/1Panel-dev/1Panel/constant"
10-
"github.com/1Panel-dev/1Panel/global"
7+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
8+
"github.com/1Panel-dev/1Panel/backend/app/dto"
9+
"github.com/1Panel-dev/1Panel/backend/constant"
10+
"github.com/1Panel-dev/1Panel/backend/global"
1111
"github.com/gin-gonic/gin"
1212
)
1313

backend/app/api/v1/entry.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package v1
22

3-
import "github.com/1Panel-dev/1Panel/app/service"
3+
import "github.com/1Panel-dev/1Panel/backend/app/service"
44

55
type ApiGroup struct {
66
BaseApi

backend/app/api/v1/file.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package v1
22

33
import (
44
"fmt"
5-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
6-
"github.com/1Panel-dev/1Panel/app/dto"
7-
"github.com/1Panel-dev/1Panel/constant"
8-
"github.com/1Panel-dev/1Panel/global"
9-
websocket2 "github.com/1Panel-dev/1Panel/utils/websocket"
5+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
6+
"github.com/1Panel-dev/1Panel/backend/app/dto"
7+
"github.com/1Panel-dev/1Panel/backend/constant"
8+
"github.com/1Panel-dev/1Panel/backend/global"
9+
websocket2 "github.com/1Panel-dev/1Panel/backend/utils/websocket"
1010
"github.com/gin-gonic/gin"
1111
"github.com/gorilla/websocket"
1212
"net/http"

backend/app/api/v1/group.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package v1
22

33
import (
4-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
5-
"github.com/1Panel-dev/1Panel/app/dto"
6-
"github.com/1Panel-dev/1Panel/constant"
7-
"github.com/1Panel-dev/1Panel/global"
4+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
5+
"github.com/1Panel-dev/1Panel/backend/app/dto"
6+
"github.com/1Panel-dev/1Panel/backend/constant"
7+
"github.com/1Panel-dev/1Panel/backend/global"
88
"github.com/gin-gonic/gin"
99
)
1010

backend/app/api/v1/helper/helper.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66

77
"github.com/pkg/errors"
88

9-
"github.com/1Panel-dev/1Panel/app/dto"
10-
"github.com/1Panel-dev/1Panel/constant"
11-
"github.com/1Panel-dev/1Panel/i18n"
9+
"github.com/1Panel-dev/1Panel/backend/app/dto"
10+
"github.com/1Panel-dev/1Panel/backend/constant"
11+
"github.com/1Panel-dev/1Panel/backend/i18n"
1212
"github.com/gin-gonic/gin"
1313
)
1414

backend/app/api/v1/host.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package v1
22

33
import (
4-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
5-
"github.com/1Panel-dev/1Panel/app/dto"
6-
"github.com/1Panel-dev/1Panel/constant"
7-
"github.com/1Panel-dev/1Panel/global"
8-
"github.com/1Panel-dev/1Panel/utils/copier"
9-
"github.com/1Panel-dev/1Panel/utils/ssh"
4+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
5+
"github.com/1Panel-dev/1Panel/backend/app/dto"
6+
"github.com/1Panel-dev/1Panel/backend/constant"
7+
"github.com/1Panel-dev/1Panel/backend/global"
8+
"github.com/1Panel-dev/1Panel/backend/utils/copier"
9+
"github.com/1Panel-dev/1Panel/backend/utils/ssh"
1010
"github.com/gin-gonic/gin"
1111
)
1212

backend/app/api/v1/monitor.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package v1
33
import (
44
"time"
55

6-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
7-
"github.com/1Panel-dev/1Panel/app/dto"
8-
"github.com/1Panel-dev/1Panel/app/model"
9-
"github.com/1Panel-dev/1Panel/constant"
10-
"github.com/1Panel-dev/1Panel/global"
6+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
7+
"github.com/1Panel-dev/1Panel/backend/app/dto"
8+
"github.com/1Panel-dev/1Panel/backend/app/model"
9+
"github.com/1Panel-dev/1Panel/backend/constant"
10+
"github.com/1Panel-dev/1Panel/backend/global"
1111
"github.com/gin-gonic/gin"
1212
"github.com/shirou/gopsutil/net"
1313
)

backend/app/api/v1/operation_log.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package v1
22

33
import (
4-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
5-
"github.com/1Panel-dev/1Panel/app/dto"
6-
"github.com/1Panel-dev/1Panel/constant"
7-
"github.com/1Panel-dev/1Panel/global"
4+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
5+
"github.com/1Panel-dev/1Panel/backend/app/dto"
6+
"github.com/1Panel-dev/1Panel/backend/constant"
7+
"github.com/1Panel-dev/1Panel/backend/global"
88
"github.com/gin-gonic/gin"
99
)
1010

backend/app/api/v1/setting.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package v1
33
import (
44
"errors"
55

6-
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
7-
"github.com/1Panel-dev/1Panel/app/dto"
8-
"github.com/1Panel-dev/1Panel/constant"
9-
"github.com/1Panel-dev/1Panel/global"
10-
"github.com/1Panel-dev/1Panel/utils/mfa"
11-
"github.com/1Panel-dev/1Panel/utils/ntp"
6+
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
7+
"github.com/1Panel-dev/1Panel/backend/app/dto"
8+
"github.com/1Panel-dev/1Panel/backend/constant"
9+
"github.com/1Panel-dev/1Panel/backend/global"
10+
"github.com/1Panel-dev/1Panel/backend/utils/mfa"
11+
"github.com/1Panel-dev/1Panel/backend/utils/ntp"
1212
"github.com/gin-gonic/gin"
1313
)
1414

0 commit comments

Comments
 (0)