將傳統版 UI 屬性遷移至新版 Edge UI

在 Apigee Edge for Private Cloud 4.54.00 中,系統已移除 Classic UI (edge-ui 元件),新版 Edge UI (edge-management-ui 元件) 是 Edge for Private Cloud 的唯一 UI。

在 Edge for Private Cloud 4.54.00 中,您無法使用 edge-ui。如果您在 /opt/apigee/customer/application/ui.properties 中設定屬性來自訂傳統版 UI,新版 Edge UI 不會讀取該檔案。更新至 4.54.00 後,您必須在 /opt/apigee/customer/application/management-ui.properties 中設定對等屬性。

本頁面列出 ui.properties 的傳統版 UI 屬性、新版 Edge UI 的對等屬性,以及新版 Edge UI 不支援的傳統版 UI 屬性。

New Edge UI 與其他 Edge 元件一樣,使用相同的程式碼和設定 (CwC) 機制。詳情請參閱「如何設定 Edge」。

比較傳統版 UI 和新版 Edge UI 設定

新版 Edge UI 會取代舊版 UI 元件、屬性檔案、服務名稱、預設通訊埠和 TLS 憑證格式。請參閱下表,在遷移資源前更新自動化指令碼、防火牆規則和 TLS 檔案:

設定 傳統版 UI (4.53.01 以下版本) 新版 Edge 使用者介面 (4.54.00)
元件名稱 edge-ui edge-management-ui
屬性檔案 /opt/apigee/customer/application/ui.properties /opt/apigee/customer/application/management-ui.properties
重新啟動指令 apigee-service edge-ui restart apigee-service edge-management-ui restart
預設通訊埠 9000 3001
傳輸層安全標準 (TLS) 設定 Java 金鑰儲存庫 (JKS) 檔案 PEM 憑證和金鑰檔案。請參閱「為 New Edge UI 設定 TLS」。

設定新版 Edge UI 的屬性

在 /opt/apigee/customer/application/management-ui.properties 中設定 New Edge UI 設定屬性,然後重新啟動 edge-management-ui 服務,變更才會生效。

如要為新版 Edge UI 設定屬性,請按照下列步驟操作:

  1. 在編輯器中開啟 management-ui.properties 檔案。如果檔案不存在,請建立該檔案:
    vi /opt/apigee/customer/application/management-ui.properties
    
  2. 設定屬性。例如:
    conf_uebe_disableGeoMap=true
  3. 儲存變更。
  4. 確認檔案擁有者是 apigee 使用者:
    chown apigee:apigee /opt/apigee/customer/application/management-ui.properties
    
  5. 重新啟動新版 Edge UI:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-ui restart
    

為 New Edge 使用者介面設定屬性時,請遵守下列格式規則:

  • 屬性名稱須區分大小寫。舉例來說,conf_uebe_disableGeoMap 是有效網址,但 conf_uebe_disablegeomap 不是。
  • 請在字串值前後加上雙引號,例如 conf_uebe_branding_companyNameShort="My Company"。
  • 請勿使用引號括住布林值 (true 或 false) 或數值。如果布林值或數值以半形引號括住,New Edge UI 就不會啟動。

如要檢查屬性的目前值,請使用 -search 選項。例如:

/opt/apigee/apigee-service/bin/apigee-service edge-management-ui \
  configure -search conf_uebe_disableGeoMap

將傳統版 Edge UI 屬性對應至新版 Edge UI

下表將 ui.properties 中支援的各項傳統版 UI 屬性,對應至 management-ui.properties 中對應的新版 Edge UI 屬性。「預設」欄會顯示 New Edge 使用者介面中的預設值。

設定功能屬性

將傳統版 UI 功能旗標對應至 management-ui.properties 中對應的 conf_uebe_* 屬性:

傳統版 UI 資源 新的 Edge UI 屬性 預設 附註
conf_apigee_apigee.feature.disablegeomap conf_uebe_disableGeoMap false 設為 true 即可隱藏地理區域地圖。在 Edge for Private Cloud 的傳統版 UI 中,地理區域地圖預設為停用。如果尚未啟用地理區域匯總功能,請將這項屬性設為 true。請參閱「啟用地理匯總和地理區域地圖」。
conf_apigee_apigee.feature.disablepasswordreset conf_uebe_disablePasswordReset false 設為 true,即可在登入頁面上隱藏「重設密碼」連結。
conf_apigee-base_apigee.feature.enableforcerangelimit conf_uebe_enableForceRangeLimit true 設為 false,即可為超過 14 天的日期範圍建立自訂報表。
conf_apigee-base_apigee.feature.enabletraceforinternaladdresses conf_uebe_trace_for_internal_addresses false 設為 true,允許追蹤工具向本機或內部 IP 位址傳送要求。
conf_apigee-base_apigee.feature.enableopenapiforinternaladdresses conf_uebe_openapi_for_internal_addresses false 設為 true,允許從本機或內部 IP 位址匯入 OpenAPI 規格。
conf_apigee-base_apigee.feature.enablewsdlforinternaladdresses conf_uebe_wsdl_for_internal_addresses false 設為 true,允許從本機或內部 IP 位址匯入 WSDL 檔案。

設定工作階段和 TLS 屬性

在 management-ui.properties 中,將傳統版 UI 工作階段逾時和 TLS 屬性對應至新版 Edge UI 的對應項目:

傳統版 UI 資源 新的 Edge UI 屬性 預設 附註
conf_application_session.maxage conf_uebe_authsessiontimeout 12 (小時) 使用者登入後,工作階段的有效時間。指定時數 (例如 12 或 0.5),或使用 h (小時) 或 m (分鐘) 單位指定時間長度 (例如 24h 或 90m)。12 和 12h 的值相同。系統不支援 d (天) 單位,請將 1d 替換為 24h。如果值無效,系統會使用預設值 12 小時,且不會回報錯誤。適用於使用基本驗證的工作階段。
conf_application_session.secure 無 不適用 啟用 TLS (conf_uebe_usehttps=true) 或 TLS 在負載平衡器 (conf_uebe_tlsoffload=true) 上終止時,New Edge UI 會自動在工作階段 Cookie 上設定 Secure 標記。
conf/application.conf+trustxforwarded conf_uebe_usehttps=true和conf_uebe_tlsoffload=true false 如果 TLS 在負載平衡器上終止,請同時設定這兩項屬性。負載平衡器必須透過 HTTP 將要求轉送至新版 Edge UI,並設定 X-Forwarded-Proto 標頭。configure-ssl 指令會在 MANAGEMENT_UI_SCHEME=https 和 MANAGEMENT_UI_TLS_OFFLOAD=y 時設定這些屬性。請參閱「為新版 Edge UI 設定 TLS」。
conf/application.conf+play.ws.ssl.loose.acceptAnyCertificate conf_uebe_skipverify false 只有在管理伺服器使用自行簽署憑證時,才設為 true。請參閱「設定 Management API 的 TLS」。

設定電子郵件屬性和範本

將舊版 Edge UI 的電子郵件寄件者、主旨、品牌宣傳、主機網址和連結到期屬性,對應至新版 Edge UI:

傳統版 UI 資源 新的 Edge UI 屬性 預設 附註
conf_apigee_apigee.mgmt.mailfrom conf_apigee_apigee.mgmt.mailfrom Apigee <sales@apigee.com>,或安裝時指定的 SMTPMAILFROM 值 未變更。
conf_apigee-base_apigee.emails.passwordreset.subject conf_apigee_apigee.emails.passwordReset.subject Password Reset Request 請注意駝峰式大小寫 passwordReset 屬性區隔。
conf_apigee-base_apigee.emails.useraddedexisting.subject conf_apigee_apigee.emails.userAddedExisting.subject You Have Been Added to an Organization {organization} 請注意駝峰式大小寫的 userAddedExisting 屬性區隔。
conf_apigee-base_apigee.emails.useraddednew.subject conf_apigee_apigee.emails.userAddedNew.subject An Account Has been Created for You at {companyNameShort} 請注意駝峰式大小寫 userAddedNew 屬性區隔。
conf_apigee_apigee.branding.companynameshort conf_uebe_branding_companyNameShort Apigee 設定電子郵件主旨和範本中 {companyNameShort} 預留位置的值。
conf_apigee_apigee.emails.hosturl conf_apigee_apigee.emails.hosturl 無 未變更。如未設定,重設密碼連結會使用安裝時指定的新版 Edge 使用者介面網址,使用者邀請連結則會使用要求的主機名稱。如果使用者透過負載平衡器或 DNS 名稱 (例如 conf_apigee_apigee.emails.hosturl="https://ui.mycompany.com") 存取新版 Edge UI,請設定這項屬性。
conf_apigee_apigee.forgotpassword.emaillinkexpiryseconds conf_apigee_apigee.forgotPassword.EmailLinkExpirySeconds 600 適用於重設密碼連結和使用者邀請連結。

新版 Edge UI 使用內建的電子郵件範本。如要使用為傳統版 UI 自訂的範本:

  1. 建立 /opt/apigee/edge-management-ui/email-templates 目錄。
  2. 將自訂的 password-reset.html、user-added-existing.html 和 user-added-new.html 檔案,從更新前建立的備份目錄 (例如 /opt/apigee/customer/backup/) 複製到 /opt/apigee/edge-management-ui/email-templates。範本檔案名稱和預留位置與舊版使用者介面相同。
  3. 確認目錄和檔案的擁有者是 apigee 使用者。
  4. 重新啟動新版 Edge UI。

詳情請參閱「自訂 Edge 電子郵件範本」。

設定自動生成的密碼屬性

將傳統版 UI 自動生成密碼屬性對應至新版 Edge UI:

傳統 UI 資源 新的 Edge UI 屬性 預設
conf_apigee-base_apigee.forgotPassword.underscore.minimum conf_apigee_apigee.forgotPassword.underscore.minimum 0
conf_apigee-base_apigee.forgotPassword.specialchars.minimum conf_apigee_apigee.forgotPassword.specialchars.minimum 0
conf_apigee-base_apigee.forgotPassword.lowecase.minimum conf_apigee_apigee.forgotPassword.lowecase.minimum 0
conf_apigee-base_apigee.forgotPassword.uppercase.minimum conf_apigee_apigee.forgotPassword.uppercase.minimum 0

設定管理伺服器連線和共用密鑰屬性

將傳統版 UI 管理伺服器連線、憑證和應用程式密鑰屬性對應至新版 Edge UI:

傳統版 UI 資源 新的 Edge UI 屬性 附註
conf_apigee_apigee.mgmt.baseurl mgmt_baseurl Management API 的網址,例如 https://FQ_domain_name:port/v1。這個屬性名稱開頭不是 conf_。如果管理伺服器使用自行簽署的憑證,請一併設定 conf_uebe_skipverify=true。
conf_apigee_apigee.mgmt.credential conf_uebe_mgmtCredential 加密的系統管理員憑證。您必須使用 ./bin/management-ui --encrypt 再次加密新版 Edge UI 的憑證;請參閱「 不同 sysadmin 憑證所需的設定」。
conf_apigee_mail.smtp.credential conf_apigee_mail.smtp.credential 加密的 SMTP 憑證。
conf_application_application.secret conf_uebe_applicationsecret 用於加密憑證和工作階段 Cookie 的密鑰。在安裝時產生。

移除不需要採取行動的傳統 UI 屬性

下列傳統版 UI 屬性在新版 Edge UI 中沒有對應項目,因為行為一律啟用。請勿在 management-ui.properties 中加入這些屬性 (並從任何自動化設定指令碼中移除):

傳統版 UI 資源 新版 Edge UI 的行為
conf_apigee_apigee.feature.expireSessionCookiesInternally 工作階段到期時間一律會在伺服器上驗證。
conf_apigee_apigee.feature.trackSessionCookies 工作階段資訊一律會儲存在伺服器記憶體中。如果您在負載平衡器後方使用多個新版 Edge UI 執行個體,請將負載平衡器設為使用黏性工作階段。

移除不支援的傳統版 UI 資源

不支援下列傳統版 UI 屬性,且新版 Edge UI 中沒有對應屬性。請勿在 management-ui.properties 中加入這些屬性 (並從任何自動化設定指令碼中移除):

傳統版 UI 資源 說明
conf_apigee_apigee.feature.apitimeout, conf_apigee_play.ws.timeout.idle, conf_apigee_play.ws.timeout.connection 您無法在新版 Edge 使用者介面中設定管理 API 呼叫的逾時時間。
conf_application_http.proxyhost、conf_application_http.proxyport、conf_application_http.proxyuser、conf_application_http.proxypassword 新版 Edge 使用者介面不支援 Trace 工具要求的轉送 Proxy。
conf_apigee-base_apigee.feature.enableconsentbanner, conf_apigee-base_apigee.consentbanner.buttoncaption, conf_apigee-base_apigee.consentbanner.body New Edge UI 不支援同意橫幅。
conf_apigee-base_apigee.feature.apiproxypaginationenabled, conf_apigee-base_apigee.pagination.apiproxypaginationbatchsize 在新版 Edge UI 中,API Proxy 清單一律會載入頁面。頁面大小無法設定。
conf_logger_settings_application_log_level,conf_logger_settings_play_log_level,conf_application_logger.application 您無法在新版 Edge UI 中設定記錄層級。記錄檔會寫入 /opt/apigee/var/log/edge-management-ui。
bin_setenv_min_mem、bin_setenv_max_mem、 bin_setenv_meta_space_size、 bin_setenv_ext_jvm_opts New Edge 使用者介面不會在 Java 虛擬機器中執行,Java 記憶體設定未套用。

查看遷移範例

以下範例比較了傳統版 UI ui.properties 檔案與新版 Edge UI 的對等 management-ui.properties 檔案。

傳統 UI,/opt/apigee/customer/application/ui.properties:

conf_apigee_apigee.feature.disablegeomap=false
conf_apigee-base_apigee.feature.enabletraceforinternaladdresses="true"
conf_application_session.maxage="1d"
conf_apigee-base_apigee.emails.passwordreset.subject="Reset your My Company password"
conf_apigee_apigee.branding.companynameshort="My Company"
conf_apigee_apigee.emails.hosturl="https://ui.mycompany.com"

新版 Edge 使用者介面: /opt/apigee/customer/application/management-ui.properties

conf_uebe_disableGeoMap=false
conf_uebe_trace_for_internal_addresses=true
conf_uebe_authsessiontimeout=24
conf_apigee_apigee.emails.passwordReset.subject="Reset your My Company password"
conf_uebe_branding_companyNameShort="My Company"
conf_apigee_apigee.emails.hosturl="https://ui.mycompany.com"

請注意,布林值 true 不會用引號括住,且工作階段逾時 1d 會替換為 24。

儲存檔案後,請重新啟動新版 Edge UI:

/opt/apigee/apigee-service/bin/apigee-service edge-management-ui restart

摘要檢查清單

請使用下列檢查清單,在 Apigee Edge for Private Cloud 4.54.00 中完成遷移至新版 Edge UI 的作業:

  1. 升級前,請先備份 /opt/apigee/customer/application/ui.properties 和 /opt/apigee/edge-ui/email-templates 中的任何自訂電子郵件範本。
  2. 新增對應的屬性至 /opt/apigee/customer/application/management-ui.properties ,且不引用布林值或數值,並省略不支援的傳統使用者介面屬性。
  3. 從備份目錄將自訂電子郵件範本複製到 /opt/apigee/edge-management-ui/email-templates。
  4. 如果您設定 conf_uebe_mgmtCredential,請使用 ./bin/management-ui --encrypt 重新加密 sysadmin 憑證。
  5. 將檔案擁有權設為 apigee:apigee,然後重新啟動 edge-management-ui。