version: 1
kind: platform-infra-provider-apps

metadata:
  id: provider-apps
  owner: platform-infra

target:
  id: NC01
  route: NC01
  workspace: /root/unidesk

runtime:
  bindHost: 127.0.0.1
  probeHost: 127.0.0.1
  port: 18121
  stateDir: .state/provider-apps-native
  pidPath: .state/provider-apps-native/server.json
  logPath: .state/provider-apps-native/server.log
  maxLogTailBytes: 12000

release:
  root: src/components/unideskcprovider
  manifestPath: update.json
  providerPath: unideskcprovider.py
  routes:
    manifest: /v1/unideskcprovider/update.json
    provider: /v1/unideskcprovider/unideskcprovider.py
    health: /health/live

install:
  root: src/components/provider-apps/install
  indexPath: index.html
  stylePath: app.css
  scriptPath: app.js
  installerPath: install.ps1
  startCmdPath: unideskcprovider-start.cmd
  bootstrapPath: install-bootstrap.py
  linuxInstallerPath: install-linux.sh
  faviconPath: provider-icon.svg
  panelImagePath: provider-panel.png
  routes:
    index: /
    style: /assets/app.css
    script: /assets/app.js
    installer: /v1/unideskcprovider/install.ps1
    startCmd: /win.cmd
    bootstrap: /v1/unideskcprovider/install-bootstrap.py
    linuxInstaller: /linux.sh
    contract: /v1/unideskcprovider/install.json
    favicon: /assets/provider-icon.svg
    panelImage: /assets/provider-panel.png
  defaults:
    server: ws://152.53.229.148:18082/ws/provider
    credentialFile: provider.token
    autoStart: true
    pythonRuntime: auto
  runtime:
    root: runtime
    connectTimeoutSeconds: 4
    progressIntervalSeconds: 1
    windows7:
      version: 3.8.10
      minimumVersion: "3.8"
      directory: python-3.8
      fileName: python-3.8.10-amd64.exe
      bytes: 28296784
      sha256: 7628244cb53408b50639d2c1287c659f4e29d3dfdb9084b11aed5870c0c6a48a
      sources:
        - id: mainland-mirror
          url: https://registry.npmmirror.com/-/binary/python/3.8.10/python-3.8.10-amd64.exe
          pipIndexUrl: https://pypi.tuna.tsinghua.edu.cn/simple
        - id: official
          url: https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe
          pipIndexUrl: https://pypi.org/simple
    windowsModern:
      version: 3.11.9
      minimumVersion: "3.11"
      directory: python-3.11
      fileName: python-3.11.9-amd64.exe
      bytes: 26216840
      sha256: 5ee42c4eee1e6b4464bb23722f90b45303f79442df63083f05322f1785f5fdde
      sources:
        - id: mainland-mirror
          url: https://registry.npmmirror.com/-/binary/python/3.11.9/python-3.11.9-amd64.exe
          pipIndexUrl: https://pypi.tuna.tsinghua.edu.cn/simple
        - id: official
          url: https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe
          pipIndexUrl: https://pypi.org/simple
  linux:
    minimumPythonVersion: "3.8"
    privateRuntimeDirectory: runtime/linux
    systemdRestartSeconds: 3
    pipSources:
      - id: mainland-mirror
        indexUrl: https://pypi.tuna.tsinghua.edu.cn/simple
      - id: official
        indexUrl: https://pypi.org/simple
    targets:
      D601-VM-HOST:
        bootstrap:
          mode: windowsSsh
          route: D601-WIN:win/c/Users/liang
          guest: ubuntu@172.30.60.10
          identityFile: C:\Users\liang\AppData\Local\UniDesk\hyperv-vm\D601-VM\id_ed25519
          stagingDirectory: C:\Users\liang\AppData\Local\Temp\unideskcprovider-linux
        providerId: D601-VM-HOST
        user: root
        home: /root
        systemdUnit: unideskcprovider.service
        network:
          bypassKubernetesServiceNat: true
          systemdUnit: unideskcprovider-network.service
        logsTailLines: 40
        credential:
          sourceRef:
            path: /root/.unidesk/.state/secrets/unidesk-host-k8s.env
            key: PROVIDER_TOKEN
          targetFile: provider.token
        benchmark:
          concurrency: 8
          poolProbeConcurrency: 32
          commandRounds: 8
          transferBytes: 134217728
          transferRounds: 2
          transferTimeoutSeconds: 1200
          readyTimeoutSeconds: 90

publicExposure:
  enabled: true
  publicBaseUrl: https://apps.hwpod.com
  hostname: apps.hwpod.com
  expectedA: 152.53.229.148
  upstream: http://127.0.0.1:18121
  healthPath: /health/live
