v1.2 版本本地应用升级指南 - 1Panel-dev/appstore GitHub Wiki

本教程以 /opt 为安装目录,如果安装有指定其他目录,自行替换 以 halo 为例

  1. 迁移本地应用安装目录 原目录 /opt/1panel/localApps 迁移到 /opt/1panel/apps 下 并 localApps 改名为 local

  2. 迁移本地应用资源目录 原目录 /opt/1panel/resource/localApps 迁移到 /opt/1panel/resource/apps 下 并 localApps 改名为 local

  3. 修改目录 在 /opt/1panel/resource/apps/local/halo 下 metadata 目录下的 logo.png 移到上级目录,然后删除 metadata 目录 versions 目录下的版本文件夹移动到上级目录,然后删除 versions 目录 新版本只需要一个 README.md 所以把 版本文件夹下面的 README.md 移动到一级目录中 修改之后的目录结构应该为

├──halo 
	├── logo.png 
	├── data.yml <- 这个文件下面改
	├── README.md 
	├── 2.2.0 
	    ├── data.yml  <- 这个文件下面改
	    ├── data 
	    └── docker-compose.yml // docker-compose 文件

  1. 修改本地应用的配置 在 /opt/1panel/resource/apps/local 下

list.json 修改

{
	"items": [
	{
	  "key": "halo",  
	  "name": "Halo", 
	  "tags": ["WebSite"], 
	  "versions": ["2.3.2"], 
	  "shortDescZh": "强大易用的开源建站工具", 
	  "shortDescEn": "Powerful and easy-to-use open source website builder", 
	  "type": "website", 
	  "limit": 0, 
	  "crossVersionUpdate": false, 
	  "website": "https://halo.run/",  
	  "github": "https://github.com/halo-dev/halo", 
	  "document": "https://docs.halo.run/" 
	}
	]
}

把 list.json 中的应用声明字段改为 yml ,命名为 data.yml 放在 应用一级目录下面 例如 /opt/1panel/resource/apps/local/halo 修改后的 data.yml

additionalProperties: ##注意这个参数
    key: halo  
    name: Halo  
    tags:  
        - WebSite  
    shortDescZh: 强大易用的开源建站工具  
    shortDescEn: Powerful and easy-to-use open source website builder  
    type: website  
    crossVersionUpdate: true  
    limit: 0  
    recommend: 2  
    website: https://halo.run/  
    github: https://github.com/halo-dev/halo  
    document: https://docs.halo.run/
  1. 修改本地应用的参数配置 /opt/1panel/resource/apps/local/halo/2.2.0 下面的 config.json 转为 yml,名称 data.yml 修改后的 data.yml
additionalProperties:  ##注意这个参数
    formFields:  
        - child:  
            default: ""  
            envKey: PANEL_DB_HOST  
            labelEn: Database Service  
            labelZh: 数据库服务  
            required: true  
            type: service  
          default: mysql  
          envKey: HALO_PLATFORM  
          labelEn: Database Service  
          labelZh: 数据库服务  
          params:  
            - envKey: HALO_DB_PORT  
              key: mysql  
              type: param  
              value: "3306"  
            - envKey: HALO_DB_PORT  
              key: postgresql  
              type: param  
              value: "5432"  
          required: true  
          type: apps  
          values:  
            - label: MySQL  
              value: mysql  
        - default: halo  
          envKey: PANEL_DB_NAME  
          labelEn: Database  
          labelZh: 数据库名  
          random: true  
          required: true  
          rule: paramCommon  
          type: text  
        - default: halo  
          envKey: PANEL_DB_USER  
          labelEn: User  
          labelZh: 数据库用户  
          random: true  
          required: true  
          rule: paramCommon  
          type: text  
        - default: halo  
          envKey: PANEL_DB_USER_PASSWORD  
          labelEn: Password  
          labelZh: 数据库用户密码  
          random: true  
          required: true  
          rule: paramComplexity  
          type: password  
        - default: admin  
          envKey: HALO_ADMIN  
          labelEn: Admin Username  
          labelZh: 超级管理员用户名  
          required: true  
          rule: paramCommon  
          type: text  
        - default: halo  
          envKey: HALO_ADMIN_PASSWORD  
          labelEn: Admin Password  
          labelZh: 超级管理员密码  
          random: true  
          required: true  
          rule: paramComplexity  
          type: password  
        - default: http://localhost:8080  
          edit: true  
          envKey: HALO_EXTERNAL_URL  
          labelEn: External URL  
          labelZh: 外部访问地址  
          required: true  
          rule: paramExtUrl  
          type: text  
        - default: 8080  
          edit: true  
          envKey: PANEL_APP_PORT_HTTP  
          labelEn: Port  
          labelZh: 端口  
          required: true  
          rule: paramPort  
          type: number

修改完成,点击页面上的更新应用列表即可