Browse Source

feat: 修改数据库名称

pull/5993/head
ssongliu 4 months ago
parent
commit
d6c5cab08d
  1. 3
      .gitignore
  2. 35
      Makefile
  3. 6
      agent/cmd/server/conf/app.yaml
  4. 2
      agent/configs/system.go
  5. 3
      cmd/server/conf/app.yaml

3
.gitignore vendored

@ -4,7 +4,8 @@
*.dll *.dll
*.so *.so
*.dylib *.dylib
build/1panel build/1panel_agent
build/1panel_core
# Mac # Mac
.DS_Store .DS_Store

35
Makefile

@ -7,10 +7,15 @@ GOOS=$(shell go env GOOS )
BASE_PAH := $(shell pwd) BASE_PAH := $(shell pwd)
BUILD_PATH = $(BASE_PAH)/build BUILD_PATH = $(BASE_PAH)/build
WEB_PATH=$(BASE_PAH)/frontend WEB_PATH=$(BASE_PAH)/frontend
SERVER_PATH=$(BASE_PAH)/backend ASSERT_PATH= $(BASE_PAH)/core/cmd/server/web/assets
MAIN= $(BASE_PAH)/cmd/server/main.go
APP_NAME=1panel CORE_MAIN= $(BASE_PAH)/cmd/server/main.go
ASSERT_PATH= $(BASE_PAH)/cmd/server/web/assets CORE_NAME=1panel_core
AGENT_PATH=$(BASE_PAH)/agent
AGENT_MAIN= $(AGENT_PATH)/cmd/server/main.go
AGENT_NAME=1panel_agent
clean_assets: clean_assets:
rm -rf $(ASSERT_PATH) rm -rf $(ASSERT_PATH)
@ -21,14 +26,20 @@ upx_bin:
build_frontend: build_frontend:
cd $(WEB_PATH) && npm install && npm run build:pro cd $(WEB_PATH) && npm install && npm run build:pro
build_backend_on_linux: build_core_on_linux:
cd $(SERVER_PATH) \ GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(CORE_NAME) $(CORE_MAIN)
&& GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
build_agent_on_linux:
cd $(AGENT_PATH) \
&& GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(AGENT_NAME) $(AGENT_MAIN)
build_core_on_darwin:
GOOS=linux GOARCH=amd64 $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(CORE_NAME) $(CORE_MAIN)
build_backend_on_darwin: build_agent_on_darwin:
cd $(SERVER_PATH) \ cd $(AGENT_PATH) \
&& GOOS=linux GOARCH=amd64 $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN) && GOOS=linux GOARCH=amd64 $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(AGENT_NAME) $(AGENT_MAIN)
build_all: build_frontend build_backend_on_linux build_all: build_frontend build_core_on_linux build_agent_on_linux
build_on_local: clean_assets build_frontend build_backend_on_darwin upx_bin build_on_local: clean_assets build_frontend build_core_on_darwin build_agent_on_darwin upx_bin

6
agent/cmd/server/conf/app.yaml

@ -1,13 +1,9 @@
system: system:
db_file: 1Panel.db db_file: agent.db
base_dir: /opt base_dir: /opt
mode: dev mode: dev
repo_url: https://resource.fit2cloud.com/1panel/package repo_url: https://resource.fit2cloud.com/1panel/package
app_repo: https://apps-assets.fit2cloud.com app_repo: https://apps-assets.fit2cloud.com
is_demo: false
port: 9999
username: admin
password: admin123
log: log:
level: debug level: debug

2
agent/configs/system.go

@ -1,7 +1,7 @@
package configs package configs
type System struct { type System struct {
DbFile string `mapstructure:"db_file"` DbFile string `mapstructure:"db_agent_file"`
DbPath string `mapstructure:"db_path"` DbPath string `mapstructure:"db_path"`
LogPath string `mapstructure:"log_path"` LogPath string `mapstructure:"log_path"`
DataDir string `mapstructure:"data_dir"` DataDir string `mapstructure:"data_dir"`

3
cmd/server/conf/app.yaml

@ -1,6 +1,5 @@
system: system:
db_core_file: 1Panel_Core.db db_core_file: core.db
db_file: 1Panel.db
base_dir: /opt base_dir: /opt
mode: dev mode: dev
repo_url: https://resource.fit2cloud.com/1panel/package repo_url: https://resource.fit2cloud.com/1panel/package

Loading…
Cancel
Save