diff --git a/engine/static/app.js b/engine/static/app.js index 6f344ed7..6ad39396 100644 --- a/engine/static/app.js +++ b/engine/static/app.js @@ -3523,9 +3523,15 @@ byId("template-import-form").addEventListener("submit", async (event) => { showError("template-import-error", "请填写不超过 64 个字符的模板名称。"); return; } - if (!existingJobId && (!url || url.origin !== "https://repo.almalinux.org" || url.username || url.password || url.search || url.hash - || !/^\/almalinux\/(9|10)\/cloud\/x86_64\/images\/AlmaLinux-\1-GenericCloud-[A-Za-z0-9._-]+\.x86_64\.qcow2$/.test(url.pathname))) { - showError("template-import-error", "目前仅支持 repo.almalinux.org 上的 AlmaLinux 9 / 10 x86_64 GenericCloud qcow2 HTTPS 地址。"); + const officialHosts = new Set([ + "repo.almalinux.org", + "cloud.debian.org", + "cloud-images.ubuntu.com", + "cloud.centos.org", + ]); + if (!existingJobId && (!url || url.protocol !== "https:" || !officialHosts.has(url.hostname) + || (url.port && url.port !== "443") || url.username || url.password || url.search || url.hash)) { + showError("template-import-error", "请填写受支持发行版官方镜像站的 HTTPS 文件地址。"); return; } if (!existingJobId && sha256 && !/^[a-f0-9]{64}$/.test(sha256)) { diff --git a/engine/static/index.html b/engine/static/index.html index 93e64fca..3f611b3a 100644 --- a/engine/static/index.html +++ b/engine/static/index.html @@ -391,10 +391,10 @@
仅管理员可以导入官方云镜像和修改模板名称;用户创建虚拟机时选择已导入的版本。
从 AlmaLinux 官方仓库下载;可选择使用发布方 SHA-256 校验。
从受支持发行版的官方镜像站下载;可选择使用发布方 SHA-256 校验。