diff --git a/apps/icons/halo.png b/apps/halo/metadata/logo.png
similarity index 100%
rename from apps/icons/halo.png
rename to apps/halo/metadata/logo.png
diff --git a/apps/halo/versions/1.6.0/README.md b/apps/halo/versions/1.6.0/README.md
new file mode 100644
index 000000000..c339a9541
--- /dev/null
+++ b/apps/halo/versions/1.6.0/README.md
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+Halo [ˈheɪloʊ],一款现代化的开源建站 / CMS 系统。
+
+
+
+
+
+
+
+
+官网
+文档(2.0 Beta)
+社区
+Gitee
+Telegram 频道
+
+
diff --git a/apps/halo/versions/1.6.0/config.json b/apps/halo/versions/1.6.0/config.json
new file mode 100644
index 000000000..82b91fbe7
--- /dev/null
+++ b/apps/halo/versions/1.6.0/config.json
@@ -0,0 +1,45 @@
+{
+ "formFields": [
+ {
+ "type": "service",
+ "key": "mysql",
+ "labelZh": "数据库服务",
+ "labelEn": "Database Service",
+ "required": true,
+ "default": "",
+ "envKey": "PANEL_DB_HOST"
+ },
+ {
+ "type": "text",
+ "labelZh": "数据库名",
+ "labelEn": "Database",
+ "required": true,
+ "default": "random",
+ "envKey": "PANEL_DB_NAME"
+ },
+ {
+ "type": "text",
+ "labelZh": "数据库用户",
+ "labelEn": "User",
+ "required": true,
+ "default": "random",
+ "envKey": "PANEL_DB_USER"
+ },
+ {
+ "type": "text",
+ "labelZh": "数据库用户密码",
+ "labelEn": "Password",
+ "required": true,
+ "default": "random",
+ "envKey": "PANEL_DB_USER_PASSWORD"
+ },
+ {
+ "type": "number",
+ "labelZh": "端口",
+ "labelEn": "Port",
+ "required": true,
+ "default": 8080,
+ "envKey": "PANEL_APP_PORT_HTTP"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/apps/halo/versions/1.6.0/docker-compose.yml b/apps/halo/versions/1.6.0/docker-compose.yml
new file mode 100644
index 000000000..59ba94b66
--- /dev/null
+++ b/apps/halo/versions/1.6.0/docker-compose.yml
@@ -0,0 +1,24 @@
+version: "3"
+services:
+ 1panel_halo:
+ image: halohub/halo:1.6.0
+ container_name: ${CONTAINER_NAME}
+ restart: always
+ networks:
+ - 1panel
+ volumes:
+ - ./data:/root/.halo
+ ports:
+ - ${PANEL_APP_PORT_HTTP}:8090
+ environment:
+ SERVER_PORT: 8090
+ SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.cj.jdbc.Driver
+ SPRING_DATASOURCE_URL: jdbc:mysql://${PANEL_DB_HOST}:3306/${PANEL_DB_NAME}?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+ SPRING_DATASOURCE_USERNAME: ${PANEL_DB_USER}
+ SPRING_DATASOURCE_PASSWORD: ${PANEL_DB_USER_PASSWORD}
+ HALO_ADMIN_PATH: admin
+ HALO_CACHE: memory
+
+networks:
+ 1panel:
+ external: true
\ No newline at end of file
diff --git a/apps/list.json b/apps/list.json
index a5c8e6d3d..937f418de 100644
--- a/apps/list.json
+++ b/apps/list.json
@@ -12,27 +12,18 @@
{
"key": "Database",
"name": "数据库"
+ },
+ {
+ "key": "Tool",
+ "name": "工具"
}
],
"items": [
{
- "key": "mysql5.7",
- "name": "Mysql5.7",
+ "key": "mysql",
+ "name": "Mysql",
"tags": ["Database"],
- "versions": ["5.7.39"],
- "short_desc": "常用关系型数据库",
- "author": "Oracle",
- "type": "runtime",
- "required": [],
- "crossVersionUpdate": false,
- "limit": 1,
- "source": "https://www.mysql.com"
- },
- {
- "key": "mysql8.0",
- "name": "Mysql8.0",
- "tags": ["Database"],
- "versions": ["8.0.30"],
+ "versions": ["5.7.39","8.0.30"],
"short_desc": "常用关系型数据库",
"author": "Oracle",
"type": "runtime",
@@ -62,7 +53,7 @@
"short_desc": "老牌博客网站模版",
"author": "Wordpress",
"type": "website",
- "required": ["mysql8.0"],
+ "required": ["mysql"],
"limit": 0,
"crossVersionUpdate": true,
"source": "http://wordpress.org/"
@@ -79,6 +70,45 @@
"limit": 0,
"crossVersionUpdate": true,
"source": "https://redis.io/"
+ },
+ {
+ "key": "halo",
+ "name": "Halo",
+ "tags": ["WebSite"],
+ "versions": ["1.6.0"],
+ "short_desc": "现代化的CMS",
+ "author": "Halo",
+ "type": "website",
+ "required": ["mysql"],
+ "limit": 0,
+ "crossVersionUpdate": true,
+ "source": "https://halo.run/"
+ },
+ {
+ "key": "phpmyadmin",
+ "name": "phpmyadmin",
+ "tags": ["Tool"],
+ "versions": ["5.2.0"],
+ "short_desc": "Mysql 客户端",
+ "author": "phpmyadmin",
+ "type": "tool",
+ "required": ["mysql"],
+ "limit": 0,
+ "crossVersionUpdate": true,
+ "source": "https://www.phpmyadmin.net/"
+ },
+ {
+ "key": "redis-commander",
+ "name": "redis-commander",
+ "tags": ["Tool"],
+ "versions": ["0.8.0"],
+ "short_desc": "Redis 客户端",
+ "author": "redis-commander",
+ "type": "tool",
+ "required": ["redis"],
+ "limit": 0,
+ "crossVersionUpdate": true,
+ "source": "https://github.com/joeferner/redis-commander"
}
]
}
\ No newline at end of file
diff --git a/apps/mysql/metadata/logo.png b/apps/mysql/metadata/logo.png
new file mode 100644
index 000000000..73b55bd0d
Binary files /dev/null and b/apps/mysql/metadata/logo.png differ
diff --git a/apps/mysql5.7/versions/5.7.39/README.md b/apps/mysql/versions/5.7.39/README.md
similarity index 100%
rename from apps/mysql5.7/versions/5.7.39/README.md
rename to apps/mysql/versions/5.7.39/README.md
diff --git a/apps/mysql5.7/versions/5.7.39/conf/my.cnf b/apps/mysql/versions/5.7.39/conf/my.cnf
similarity index 100%
rename from apps/mysql5.7/versions/5.7.39/conf/my.cnf
rename to apps/mysql/versions/5.7.39/conf/my.cnf
diff --git a/apps/mysql5.7/versions/5.7.39/config.json b/apps/mysql/versions/5.7.39/config.json
similarity index 100%
rename from apps/mysql5.7/versions/5.7.39/config.json
rename to apps/mysql/versions/5.7.39/config.json
diff --git a/apps/mysql5.7/versions/5.7.39/docker-compose.yml b/apps/mysql/versions/5.7.39/docker-compose.yml
similarity index 100%
rename from apps/mysql5.7/versions/5.7.39/docker-compose.yml
rename to apps/mysql/versions/5.7.39/docker-compose.yml
diff --git a/apps/mysql8.0/versions/8.0.30/README.md b/apps/mysql/versions/8.0.30/README.md
similarity index 100%
rename from apps/mysql8.0/versions/8.0.30/README.md
rename to apps/mysql/versions/8.0.30/README.md
diff --git a/apps/mysql8.0/versions/8.0.30/conf/my.cnf b/apps/mysql/versions/8.0.30/conf/my.cnf
similarity index 100%
rename from apps/mysql8.0/versions/8.0.30/conf/my.cnf
rename to apps/mysql/versions/8.0.30/conf/my.cnf
diff --git a/apps/mysql8.0/versions/8.0.30/config.json b/apps/mysql/versions/8.0.30/config.json
similarity index 100%
rename from apps/mysql8.0/versions/8.0.30/config.json
rename to apps/mysql/versions/8.0.30/config.json
diff --git a/apps/mysql8.0/versions/8.0.30/docker-compose.yml b/apps/mysql/versions/8.0.30/docker-compose.yml
similarity index 100%
rename from apps/mysql8.0/versions/8.0.30/docker-compose.yml
rename to apps/mysql/versions/8.0.30/docker-compose.yml
diff --git a/apps/mysql5.7/metadata/logo.png b/apps/mysql5.7/metadata/logo.png
deleted file mode 100644
index 3fbbeed73..000000000
Binary files a/apps/mysql5.7/metadata/logo.png and /dev/null differ
diff --git a/apps/mysql8.0/metadata/logo.png b/apps/mysql8.0/metadata/logo.png
deleted file mode 100644
index 3fbbeed73..000000000
Binary files a/apps/mysql8.0/metadata/logo.png and /dev/null differ
diff --git a/apps/nginx/versions/1.23.1/conf/mime.types b/apps/nginx/versions/1.23.1/conf/mime.types
index 1c00d701a..e69de29bb 100644
--- a/apps/nginx/versions/1.23.1/conf/mime.types
+++ b/apps/nginx/versions/1.23.1/conf/mime.types
@@ -1,99 +0,0 @@
-
-types {
- text/html html htm shtml;
- text/css css;
- text/xml xml;
- image/gif gif;
- image/jpeg jpeg jpg;
- application/javascript js;
- application/atom+xml atom;
- application/rss+xml rss;
-
- text/mathml mml;
- text/plain txt;
- text/vnd.sun.j2me.app-descriptor jad;
- text/vnd.wap.wml wml;
- text/x-component htc;
-
- image/avif avif;
- image/png png;
- image/svg+xml svg svgz;
- image/tiff tif tiff;
- image/vnd.wap.wbmp wbmp;
- image/webp webp;
- image/x-icon ico;
- image/x-jng jng;
- image/x-ms-bmp bmp;
-
- font/woff woff;
- font/woff2 woff2;
-
- application/java-archive jar war ear;
- application/json json;
- application/mac-binhex40 hqx;
- application/msword doc;
- application/pdf pdf;
- application/postscript ps eps ai;
- application/rtf rtf;
- application/vnd.apple.mpegurl m3u8;
- application/vnd.google-earth.kml+xml kml;
- application/vnd.google-earth.kmz kmz;
- application/vnd.ms-excel xls;
- application/vnd.ms-fontobject eot;
- application/vnd.ms-powerpoint ppt;
- application/vnd.oasis.opendocument.graphics odg;
- application/vnd.oasis.opendocument.presentation odp;
- application/vnd.oasis.opendocument.spreadsheet ods;
- application/vnd.oasis.opendocument.text odt;
- application/vnd.openxmlformats-officedocument.presentationml.presentation
- pptx;
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- xlsx;
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
- docx;
- application/vnd.wap.wmlc wmlc;
- application/wasm wasm;
- application/x-7z-compressed 7z;
- application/x-cocoa cco;
- application/x-java-archive-diff jardiff;
- application/x-java-jnlp-file jnlp;
- application/x-makeself run;
- application/x-perl pl pm;
- application/x-pilot prc pdb;
- application/x-rar-compressed rar;
- application/x-redhat-package-manager rpm;
- application/x-sea sea;
- application/x-shockwave-flash swf;
- application/x-stuffit sit;
- application/x-tcl tcl tk;
- application/x-x509-ca-cert der pem crt;
- application/x-xpinstall xpi;
- application/xhtml+xml xhtml;
- application/xspf+xml xspf;
- application/zip zip;
-
- application/octet-stream bin exe dll;
- application/octet-stream deb;
- application/octet-stream dmg;
- application/octet-stream iso img;
- application/octet-stream msi msp msm;
-
- audio/midi mid midi kar;
- audio/mpeg mp3;
- audio/ogg ogg;
- audio/x-m4a m4a;
- audio/x-realaudio ra;
-
- video/3gpp 3gpp 3gp;
- video/mp2t ts;
- video/mp4 mp4;
- video/mpeg mpeg mpg;
- video/quicktime mov;
- video/webm webm;
- video/x-flv flv;
- video/x-m4v m4v;
- video/x-mng mng;
- video/x-ms-asf asx asf;
- video/x-ms-wmv wmv;
- video/x-msvideo avi;
-}
diff --git a/apps/nginx/versions/1.23.1/config.json b/apps/nginx/versions/1.23.1/config.json
index c1ab673a1..e69de29bb 100644
--- a/apps/nginx/versions/1.23.1/config.json
+++ b/apps/nginx/versions/1.23.1/config.json
@@ -1,20 +0,0 @@
-{
- "formFields": [
- {
- "type": "number",
- "labelZh": "Http 端口",
- "labelEn": "Http Port",
- "required": true,
- "default": 80,
- "envKey": "PANEL_APP_PORT_HTTP"
- },
- {
- "type": "number",
- "labelZh": "Https 端口",
- "labelEn": "Https Port",
- "required": true,
- "default": 443,
- "envKey": "PANEL_APP_PORT_HTTPS"
- }
- ]
-}
\ No newline at end of file
diff --git a/apps/nginx/versions/1.23.1/docker-compose.yml b/apps/nginx/versions/1.23.1/docker-compose.yml
index 1a3890191..e69de29bb 100644
--- a/apps/nginx/versions/1.23.1/docker-compose.yml
+++ b/apps/nginx/versions/1.23.1/docker-compose.yml
@@ -1,19 +0,0 @@
-services:
- nginx1.23.1:
- container_name: ${CONTAINER_NAME}
- image: nginx:1.23.1
- restart: always
- networks:
- - 1panel
- ports:
- - ${PANEL_APP_PORT_HTTP}:80
- - ${PANEL_APP_PORT_HTTPS}:443
- volumes:
- - ./conf/nginx.conf:/etc/nginx/nginx.conf
- - ./log:/var/log/nginx
- - ./conf/conf.d:/etc/nginx/conf.d/
- - ./ssl:/etc/nginx/ssl
-
-networks:
- 1panel:
- external: true
\ No newline at end of file
diff --git a/apps/nginx/versions/1.23.1/html/index.html b/apps/nginx/versions/1.23.1/html/index.html
index 30d74d258..e69de29bb 100644
--- a/apps/nginx/versions/1.23.1/html/index.html
+++ b/apps/nginx/versions/1.23.1/html/index.html
@@ -1 +0,0 @@
-test
\ No newline at end of file
diff --git a/apps/phpmyadmin/metadata/logo.png b/apps/phpmyadmin/metadata/logo.png
new file mode 100644
index 000000000..0ddf21256
Binary files /dev/null and b/apps/phpmyadmin/metadata/logo.png differ
diff --git a/apps/phpmyadmin/versions/5.2.0/config.json b/apps/phpmyadmin/versions/5.2.0/config.json
new file mode 100644
index 000000000..909103187
--- /dev/null
+++ b/apps/phpmyadmin/versions/5.2.0/config.json
@@ -0,0 +1,21 @@
+{
+ "formFields": [
+ {
+ "type": "service",
+ "key": "mysql",
+ "labelZh": "数据库服务",
+ "labelEn": "Database Service",
+ "required": true,
+ "default": "",
+ "envKey": "PANEL_DB_HOST"
+ },
+ {
+ "type": "number",
+ "labelZh": "端口",
+ "labelEn": "Port",
+ "required": true,
+ "default": 8080,
+ "envKey": "PANEL_APP_PORT_HTTP"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/apps/phpmyadmin/versions/5.2.0/docker-compose.yml b/apps/phpmyadmin/versions/5.2.0/docker-compose.yml
new file mode 100644
index 000000000..d586d5cca
--- /dev/null
+++ b/apps/phpmyadmin/versions/5.2.0/docker-compose.yml
@@ -0,0 +1,15 @@
+version: '3'
+services:
+ 1panel_phpmyadmin:
+ image: phpmyadmin/phpmyadmin:5.2.0
+ container_name: 1panel_phpmyadmin
+ ports:
+ - ${PANEL_APP_PORT_HTTP}:80
+ environment:
+ - PMA_HOST=${PANEL_DB_HOST}
+ networks:
+ - 1panel
+
+networks:
+ 1panel:
+ external: true
\ No newline at end of file
diff --git a/apps/redis-commander/metadata/logo.png b/apps/redis-commander/metadata/logo.png
new file mode 100644
index 000000000..15afa9295
Binary files /dev/null and b/apps/redis-commander/metadata/logo.png differ
diff --git a/apps/redis-commander/versions/0.8.0/config.json b/apps/redis-commander/versions/0.8.0/config.json
new file mode 100644
index 000000000..50d4784c6
--- /dev/null
+++ b/apps/redis-commander/versions/0.8.0/config.json
@@ -0,0 +1,29 @@
+{
+ "formFields": [
+ {
+ "type": "service",
+ "key": "redis",
+ "labelZh": "Redis 服务",
+ "labelEn": "Redis Service",
+ "required": true,
+ "default": "",
+ "envKey": "PANEL_REDIS_HOST"
+ },
+ {
+ "type": "text",
+ "labelZh": "密码",
+ "labelEn": "Password",
+ "required": true,
+ "default": "eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81",
+ "envKey": "PANEL_DB_ROOT_PASSWORD"
+ },
+ {
+ "type": "number",
+ "labelZh": "端口",
+ "labelEn": "Port",
+ "required": true,
+ "default": 8081,
+ "envKey": "PANEL_APP_PORT_HTTP"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/apps/redis-commander/versions/0.8.0/docker-compose.yml b/apps/redis-commander/versions/0.8.0/docker-compose.yml
new file mode 100644
index 000000000..1e700190d
--- /dev/null
+++ b/apps/redis-commander/versions/0.8.0/docker-compose.yml
@@ -0,0 +1,16 @@
+version: '3'
+services:
+ redis-commander:
+ container_name: redis-commander
+ hostname: redis-commander
+ image: rediscommander/redis-commander:latest
+ restart: always
+ networks:
+ - 1panel
+ environment:
+ - REDIS_HOSTS=1panel:${PANEL_REDIS_HOST}:6379:0:${PANEL_DB_ROOT_PASSWORD}
+ ports:
+ - ${PANEL_APP_PORT_HTTP}:8081
+networks:
+ 1panel:
+ external: true
\ No newline at end of file
diff --git a/apps/wordpress/versions/6.0.1/config.json b/apps/wordpress/versions/6.0.1/config.json
index 57b6902f3..82b91fbe7 100644
--- a/apps/wordpress/versions/6.0.1/config.json
+++ b/apps/wordpress/versions/6.0.1/config.json
@@ -2,7 +2,7 @@
"formFields": [
{
"type": "service",
- "key": "mysql8.0",
+ "key": "mysql",
"labelZh": "数据库服务",
"labelEn": "Database Service",
"required": true,
diff --git a/apps/wordpress/versions/6.0.2/config.json b/apps/wordpress/versions/6.0.2/config.json
index 57b6902f3..82b91fbe7 100644
--- a/apps/wordpress/versions/6.0.2/config.json
+++ b/apps/wordpress/versions/6.0.2/config.json
@@ -2,7 +2,7 @@
"formFields": [
{
"type": "service",
- "key": "mysql8.0",
+ "key": "mysql",
"labelZh": "数据库服务",
"labelEn": "Database Service",
"required": true,
diff --git a/backend/app/service/app.go b/backend/app/service/app.go
index f8915161a..5241e13cf 100644
--- a/backend/app/service/app.go
+++ b/backend/app/service/app.go
@@ -305,10 +305,10 @@ func (a AppService) SyncInstalled(installId uint) error {
}
func (a AppService) SyncAppList() error {
- if err := getAppFromOss(); err != nil {
- global.LOG.Errorf("get app from oss error: %s", err.Error())
- return err
- }
+ //if err := getAppFromOss(); err != nil {
+ // global.LOG.Errorf("get app from oss error: %s", err.Error())
+ // return err
+ //}
appDir := constant.AppResourceDir
listFile := path.Join(appDir, "list.json")
diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go
index b221f5bdb..d9fc85fe2 100644
--- a/backend/app/service/app_utils.go
+++ b/backend/app/service/app_utils.go
@@ -46,18 +46,18 @@ func execDockerCommand(database model.AppDatabase, dbInstall model.AppInstall, o
Auth: auth,
DbParam: dbConfig,
}
- _, err := cmd.Exec(getSqlStr(database.Key, op, execConfig))
+ out, err := cmd.Exec(getSqlStr(database.Key, op, execConfig))
if err != nil {
- return err
+ return errors.New(out)
}
return nil
}
-func getSqlStr(key string, operate DatabaseOp, exec dto.ContainerExec) string {
+func getSqlStr(version string, operate DatabaseOp, exec dto.ContainerExec) string {
var str string
param := exec.DbParam
- switch key {
- case "mysql5.7":
+
+ if strings.Contains(version, "5.7") {
if operate == Add {
str = fmt.Sprintf("docker exec -i %s mysql -uroot -p%s -e \"CREATE USER '%s'@'%%' IDENTIFIED BY '%s';\" -e \"create database %s;\" -e \"GRANT ALL ON %s.* TO '%s'@'%%' IDENTIFIED BY '%s';\" -e \"FLUSH PRIVILEGES;\"",
exec.ContainerName, exec.Auth.RootPassword, param.DbUser, param.Password, param.DbName, param.DbName, param.DbUser, param.Password)
@@ -66,7 +66,9 @@ func getSqlStr(key string, operate DatabaseOp, exec dto.ContainerExec) string {
str = fmt.Sprintf("docker exec -i %s mysql -uroot -p%s -e \"drop database %s;\" -e \"drop user %s;\" ",
exec.ContainerName, exec.Auth.RootPassword, param.DbName, param.DbUser)
}
- case "mysql8.0":
+ }
+
+ if strings.Contains(version, "8.0") {
if operate == Add {
str = fmt.Sprintf("docker exec -i %s mysql -uroot -p%s -e \"CREATE USER '%s'@'%%' IDENTIFIED BY '%s';\" -e \"create database %s;\" -e \"GRANT ALL ON %s.* TO '%s'@'%%';\" -e \"FLUSH PRIVILEGES;\"",
exec.ContainerName, exec.Auth.RootPassword, param.DbUser, param.Password, param.DbName, param.DbName, param.DbUser)
@@ -76,6 +78,7 @@ func getSqlStr(key string, operate DatabaseOp, exec dto.ContainerExec) string {
exec.ContainerName, exec.Auth.RootPassword, param.DbName, param.DbUser)
}
}
+
return str
}