为什么我不能将 Jelastic 清单设置中的任何 url 传递给 lets encrypt 清单?

Why can't I pass any url from my Jelastic manifest settings to the lets encrypt manifest?

我正在尝试做一些非常简单的事情。我有一个带有 nginx 负载均衡器的 Jelastic 环境。在该平衡器上,我想使用以下清单安装 let's encrypt 插件:

type: update
name: load balancer

targetNodes:
  nodeGroup:
    - bl

settings:
  fields:
    - name: externalDomains
      caption: External domain names (;-separated list)
      type: string
      vtype: domainlist
      required: true

onInstall:
  - installAddon:
      id: letsencrypt

addons:
  - id: letsencrypt
    name: letsencrypt
    onInstall:
      - install [bl]:
          envName: ${env.envName}
          jps: https://github.com/jelastic-jps/lets-encrypt/blob/master/manifest.jps
          settings:
            customDomains: ${settings.externalDomains}

当我运行那个清单时,我需要提供一个外部域:

然后安装运行就成功了,看来。然后我点击插件的“配置”按钮:

不幸的是,我看到“外部域”字段为空:

这很不幸,因为我将其设置为 ${settings.externalDomains}

但是,如果我安装以下清单,那么一切都很好:

type: update
name: load balancer

targetNodes:
  nodeGroup:
    - bl

onInstall:
  - installAddon:
      id: letsencrypt

addons:
  - id: letsencrypt
    name: letsencrypt
    onInstall:
      - install [bl]:
          envName: ${env.envName}
          jps: https://github.com/jelastic-jps/lets-encrypt/blob/master/manifest.jps
          settings:
            customDomains: ${env.envName}.my-provider.com

只要我在插件的 customDomains 字段中手动写入任何内容,就可以了。一旦我将 settings 中的值放在那里,该值就会被丢弃。我做错了什么?

传递给 customDomains 的参数应该首先在 add-on 中传递:

onInstall:
  - installAddon:
      id: letsencrypt
      settings:
        externalDomains: ${settings.externalDomains}

然后就可以在add-on正文中使用了。

完整的 add-on 清单:

type: update
name: load balancer

targetNodes:
  nodeGroup:
  - bl
settings:
  fields:
  - name: externalDomains
    caption: External domain names (;-separated list)
    type: string
    vtype: domainlist
    required: true

onInstall:
  - installAddon:
      id: letsencrypt
      settings:
        externalDomains: ${settings.externalDomains}

addons:
  - id: letsencrypt
    name: letsencrypt
    
    onInstall:
      - install:
          envName: ${env.envName}
          nodeGroup: bl
          jps: https://github.com/jelastic-jps/lets-encrypt/blob/master/manifest.jps
          settings:
            customDomains: ${settings.externalDomains}

可以在控制台选项卡中检查 JPS 行为:-

{DOMAIN_URL}/控制台

测试清单控制台日志:

[07:33:10 letsencrypt]: BEGIN INSTALLATION: letsencrypt
[07:33:11 letsencrypt]: BEGIN HANDLE EVENT: {"topic":"application/install","envAppid":"c5b959b2a936d56a23daa6964b15dc19"}
[07:33:11 letsencrypt:1]: install [bl]:  {"envName":"env-sup","nodeGroup":"bl","settings":{"customDomains":"domain8.com"}}
[07:33:11]: BEGIN MIXINS INITIALIZATION: Let's Encrypt Free SSL
[07:33:11]: loading mixin [configs/vers.yaml].response: {"result":0}
[07:33:11]: END MIXINS INITIALIZATION: Let's Encrypt Free SSL

[07:33:12 Let's.SSL]: BEGIN INSTALLATION: Let's Encrypt Free SSL
[07:33:12 Let's.SSL]: BEGIN HANDLE EVENT: {"topic":"application/install","envAppid":"c5b959b2a936d56a23daa6964b15dc19"}
[07:33:12 Let's.SSL:1]: setGlobals [bl]:  {"nodeId":"","nodeGroup":"bl","withExtIp":"true","webroot":"","webrootPath":"","fallbackToX1":"","deployHook":"","deployHookType":"","undeployHook":"","undeployHookType":"","test":""}

所以这里可以看到参数是否传递和显示成功