diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md index 7866b75c..df79d1d9 100644 --- a/docs/DEPLOYMENT.md +++ b/docs/DEPLOYMENT.md @@ -95,7 +95,7 @@ php xcat cloudRepairInstanceMetadata --apply 后台 `/admin/object-storage` 可配置一个全局 S3 兼容对象存储应用,适用于 AWS S3、MinIO 及实现 AWS Signature Version 4 的兼容服务。该功能复用业务库已有的 `configurations` 表,不需要导入新表。Endpoint 必须是带有效证书的 HTTPS origin;MinIO 通常选择路径寻址,AWS S3 通常选择虚拟主机寻址。 -Access Key ID 与 Secret Access Key 只在超级管理员提交时进入 PHP,使用 `cloud_data_key` 的独立用途密钥密封后保存,读取页面不会回显。修改任一配置或停用应用都会清除原就绪标记;必须重新执行“验证连接并启用”。连接验证只发送签名的 `HeadBucket` 请求,需要目标 Bucket 的 `s3:ListBucket` 权限,不上传、覆盖或删除对象。管理员虚拟机管理已接入完整系统盘备份和新实例恢复,目标可以是原宿主机或其他合格宿主机;用户自动备份使用同一对象存储,在实例设置中按每天或每周调度并保留最多两份。运行账户还需要配置 `vm-backups/` 与 `vm-migrations/` 前缀范围内的 multipart 上传、`GetObject`、`HeadObject` 和 `DeleteObject` 权限。成功维护迁移会由普通任务 Worker 自动回收隐藏迁移传输包;版本控制 Bucket 仍须为 `vm-migrations/` 配置非当前版本过期策略。当前不包含增量链和管理员手工备份的自动保留策略,具体安全边界见 `docs/PORTABLE_VM_BACKUPS.md`。 +Access Key ID 与 Secret Access Key 只在超级管理员提交时进入 PHP,使用 `cloud_data_key` 的独立用途密钥密封后保存,读取页面不会回显。修改任一配置或停用应用都会清除原就绪标记;必须重新执行“验证连接并启用”。连接验证只发送签名的 `HeadBucket` 请求,需要目标 Bucket 的 `s3:ListBucket` 权限,不上传、覆盖或删除对象。管理员虚拟机管理已接入完整系统盘备份和新实例恢复,目标可以是原宿主机或其他合格宿主机;用户自动备份使用同一对象存储,在实例设置中按每天或每周于 UTC 00:00 调度并保留最多两份。运行账户还需要配置 `vm-backups/` 与 `vm-migrations/` 前缀范围内的 multipart 上传、`GetObject`、`HeadObject` 和 `DeleteObject` 权限。成功维护迁移会由普通任务 Worker 自动回收隐藏迁移传输包;版本控制 Bucket 仍须为 `vm-migrations/` 配置非当前版本过期策略。当前不包含增量链和管理员手工备份的自动保留策略,具体安全边界见 `docs/PORTABLE_VM_BACKUPS.md`。 生产环境应为面板创建独立服务账户,把权限限制到配置的 Bucket 和备份前缀。数据库备份必须与原始 `cloud_data_key` 一起保管,重新生成主密钥无法恢复全局配置及各备份冻结的对象存储凭据。 diff --git a/docs/PORTABLE_VM_BACKUPS.md b/docs/PORTABLE_VM_BACKUPS.md index 7ab4b0e3..51d77a5f 100644 --- a/docs/PORTABLE_VM_BACKUPS.md +++ b/docs/PORTABLE_VM_BACKUPS.md @@ -16,7 +16,7 @@ 用户在部署时购买自动备份时,首个服务周期与实例账单一并结算。运行中的实例也可以在实例设置中开启:当前服务周期按剩余秒数向上取整计费,已经提前购买但尚未包含备份的后续服务周期按每期完整价格结算。余额扣款、已支付审计账单、订阅和每个服务周期的不可变权益记录在同一事务内完成;同一个幂等请求不会重复扣款。 -调度只在订阅已开启且计划执行时间落入已支付权益时运行,并在创建备份的事务内再次核对。用户可以选择每天或每周在太平洋时间 00:00 执行,保留上限为两份。关闭会立即停止新自动备份并从下一张续费账单移除备份费用,不退还当前周期费用,也不删除当前已付权益或已有备份;同一已付周期重新开启不重复收费。续费成功后会为新服务周期写入独立权益,历史部署快照不作为当前计费授权。 +调度只在订阅已开启且计划执行时间落入已支付权益时运行,并在创建备份的事务内再次核对。用户可以选择每天或每周在 UTC 00:00 执行,保留上限为两份。关闭会立即停止新自动备份并从下一张续费账单移除备份费用,不退还当前周期费用,也不删除当前已付权益或已有备份;同一已付周期重新开启不重复收费。续费成功后会为新服务周期写入独立权益,历史部署快照不作为当前计费授权。 用户只能在源实例的设置页把自动备份恢复到原实例;全局“云备份”页面可以从已有备份创建新实例。自动备份当前仍是完整系统盘对象,不是增量链。 diff --git a/web/app/Command/CloudSetup.php b/web/app/Command/CloudSetup.php index 208a279e..8a8564ca 100644 --- a/web/app/Command/CloudSetup.php +++ b/web/app/Command/CloudSetup.php @@ -8,7 +8,7 @@ use App\Services\Config; /** Initializes only the clean-break PHP business and Agent log schemas. */ final class CloudSetup { - private const SCHEMA_VERSION = 'go-agent-wss-v8-backup-entitlements'; + private const SCHEMA_VERSION = 'go-agent-wss-v9-backup-utc-schedule'; private const MAIN_TABLES = [ 'cloud_regions', 'cloud_network_lines', 'cloud_resource_pools', 'cloud_hosts', 'cloud_host_agents', diff --git a/web/app/Services/Cloud/CloudAutomaticBackupService.php b/web/app/Services/Cloud/CloudAutomaticBackupService.php index e08074fa..03979ac4 100644 --- a/web/app/Services/Cloud/CloudAutomaticBackupService.php +++ b/web/app/Services/Cloud/CloudAutomaticBackupService.php @@ -12,7 +12,7 @@ use App\Models\CloudOffer; /** Owner-facing paid automatic-backup policy and bounded scheduler. */ final class CloudAutomaticBackupService { - public const TIMEZONE = 'America/Los_Angeles'; + public const TIMEZONE = 'UTC'; public const RUN_AT = '00:00'; public const MAX_RETENTION = 2; @@ -379,7 +379,7 @@ final class CloudAutomaticBackupService return $removed; } - /** First Pacific midnight strictly after $after. Weekday uses PHP w: 0=Sunday. */ + /** First UTC midnight strictly after $after. Weekday uses PHP w: 0=Sunday. */ public static function nextRunAt(int $after, string $frequency, int $weekday): int { diff --git a/web/public/cloud/detail.js b/web/public/cloud/detail.js index 45fb707d..3967eec0 100644 --- a/web/public/cloud/detail.js +++ b/web/public/cloud/detail.js @@ -1571,7 +1571,7 @@ function renderAutomaticBackupList(vmId, items, allowed) { const title = document.createElement('strong'); const detail = document.createElement('span'); title.textContent = '还没有可用备份'; - detail.textContent = '计划启用后,系统会在 PT 00:00 自动执行。'; + detail.textContent = '计划启用后,系统会在 UTC 00:00 自动执行。'; empty.append(title, detail); list.append(empty); return; diff --git a/web/public/cloud/styles.css b/web/public/cloud/styles.css index 6176ee79..90af59c5 100644 --- a/web/public/cloud/styles.css +++ b/web/public/cloud/styles.css @@ -291,5 +291,5 @@ body.vu-body .ssh-key-picker-manage:hover { .vm-state-sync{display:block;margin-top:4px;color:#8b9aaa;font-size:10px;line-height:1.35;white-space:nowrap}.vm-state-sync.stale{color:#b98129}.vm-state-sync.offline{color:#bd5b63}.vm-detail-state-stack{display:flex;flex-direction:column;align-items:flex-end;gap:3px}.vm-detail-state-stack .vm-state-sync{margin-top:0} .vm-ip-change-facts{display:grid;grid-template-columns:1fr;gap:1px;margin:0 0 24px;padding:1px;background:#e5ecef}.vm-ip-change-facts>div{min-width:0;padding:14px 16px;background:#fff}.vm-ip-change-facts dt{margin-bottom:5px;color:#8796a4;font-size:10px}.vm-ip-change-facts dd{margin:0;color:#294257;font:700 12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;overflow-wrap:anywhere}@media screen and (max-width:510px){.vm-ip-change-facts>div{padding:11px 13px}} .vm-upgrade-section{max-width:880px}.vm-upgrade-current-card{margin:0 0 25px;padding:18px;border:1px solid #e1e9ed;border-radius:10px;background:#fbfcfd}.vm-upgrade-current-card h4,.vm-upgrade-picker-heading h4{margin:0;color:#314a5f;font-size:13px}.vm-upgrade-spec-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;margin:14px 0 0;padding:1px;background:#e3eaee}.vm-upgrade-spec-grid>div{min-width:0;padding:11px 13px;background:#fff}.vm-upgrade-spec-grid dt{margin-bottom:4px;color:#8797a5;font-size:9px}.vm-upgrade-spec-grid dd{margin:0;color:#294257;font-size:11px;font-weight:800;overflow-wrap:anywhere}.vm-upgrade-picker-heading{display:flex;align-items:baseline;justify-content:space-between;gap:15px;margin-bottom:11px}.vm-upgrade-picker-heading span{color:#8a99a7;font-size:10px}.vm-upgrade-offers{display:grid;gap:10px;margin:0 0 22px}.vm-upgrade-offer{position:relative;display:grid;width:100%;gap:14px;padding:16px 18px;border:1px solid #dce7ec;border-radius:10px;background:#fff;color:#50677a;text-align:left;cursor:pointer}.vm-upgrade-offer:hover:not(:disabled){border-color:#8ecdd2;background:#f8fcfc}.vm-upgrade-offer:focus-visible{outline:3px solid rgba(18,166,176,.22);outline-offset:2px}.vm-upgrade-offer[aria-checked=true]{border-color:#2eabb4;background:#eef9fa;box-shadow:inset 0 0 0 1px #2eabb4}.vm-upgrade-offer[aria-checked=true]::after{content:"✓";position:absolute;top:10px;right:10px;display:grid;place-items:center;width:21px;height:21px;border-radius:50%;background:#18a6b0;color:#fff;font-size:12px;font-weight:900}.vm-upgrade-offer:disabled{cursor:not-allowed;opacity:.66}.vm-upgrade-offer-heading{display:flex;align-items:center;justify-content:space-between;gap:35px;padding-right:21px}.vm-upgrade-offer-name{min-width:0;color:#293f53;font-size:13px;overflow-wrap:anywhere}.vm-upgrade-offer-price{flex:none;color:#0d929d;font-size:13px}.vm-upgrade-offer-facts{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.vm-upgrade-offer-fact{display:grid;min-width:0;gap:3px}.vm-upgrade-offer-fact small{color:#8a99a7;font-size:9px}.vm-upgrade-offer-fact b{color:#445d70;font-size:10px;overflow-wrap:anywhere}.vm-upgrade-empty{margin:0;padding:24px;border:1px dashed #d7e1e6;border-radius:10px;color:#8494a2;font-size:11px;text-align:center}@media screen and (max-width:510px){.vm-upgrade-current-card{padding:14px}.vm-upgrade-spec-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.vm-upgrade-picker-heading{align-items:flex-start;flex-direction:column;gap:4px}.vm-upgrade-offer{gap:13px;padding:15px}.vm-upgrade-offer-heading{align-items:flex-start;flex-direction:column;gap:5px;padding-right:27px}.vm-upgrade-offer-facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px 8px}.vm-upgrade-offer-fact:last-child{grid-column:1/-1}.vm-upgrade-offer-price{font-size:12px}} -.vm-automatic-backup-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px}.vm-automatic-backup-list-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:32px 0 12px;padding-top:24px;border-top:1px solid #e6ecef}.vm-automatic-backup-list-heading h4{margin:0 0 4px;color:#354c60;font-size:14px}.vm-automatic-backup-list-heading small{color:#8797a5;font-size:10px}.vm-automatic-backup-list{display:grid;gap:10px}.vm-automatic-backup-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:13px 18px;padding:15px;border:1px solid #dfe8ed;border-radius:9px;background:#fbfdfd}.vm-automatic-backup-card-main{display:grid;gap:5px;min-width:0}.vm-automatic-backup-card-main strong{color:#31495d;font-size:12px;overflow-wrap:anywhere}.vm-automatic-backup-card-main small{color:#8192a1;font-size:10px;line-height:1.55}.vm-automatic-backup-card-status{align-self:start}.vm-automatic-backup-card-actions{grid-column:1/-1;display:flex;justify-content:flex-end}.vm-automatic-backup-empty{display:grid;gap:5px;padding:25px 17px;border:1px dashed #cedce2;border-radius:9px;color:#8797a5;text-align:center}.vm-automatic-backup-empty strong{color:#506779;font-size:12px}.vm-automatic-backup-empty span{font-size:10px}@media screen and (max-width:740px){.vm-automatic-backup-grid{grid-template-columns:1fr}}@media screen and (max-width:510px){.vm-automatic-backup-list-heading{align-items:flex-start;flex-direction:column}.vm-automatic-backup-list-heading .button{width:100%}.vm-automatic-backup-card{grid-template-columns:1fr}.vm-automatic-backup-card-status,.vm-automatic-backup-card-actions{grid-column:1}.vm-automatic-backup-card-actions .button{width:100%}} +.vm-automatic-backup-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px}.vm-automatic-backup-grid>.vm-settings-field{align-content:start}.vm-automatic-backup-list-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:32px 0 12px;padding-top:24px;border-top:1px solid #e6ecef}.vm-automatic-backup-list-heading h4{margin:0 0 4px;color:#354c60;font-size:14px}.vm-automatic-backup-list-heading small{color:#8797a5;font-size:10px}.vm-automatic-backup-list{display:grid;gap:10px}.vm-automatic-backup-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:13px 18px;padding:15px;border:1px solid #dfe8ed;border-radius:9px;background:#fbfdfd}.vm-automatic-backup-card-main{display:grid;gap:5px;min-width:0}.vm-automatic-backup-card-main strong{color:#31495d;font-size:12px;overflow-wrap:anywhere}.vm-automatic-backup-card-main small{color:#8192a1;font-size:10px;line-height:1.55}.vm-automatic-backup-card-status{align-self:start}.vm-automatic-backup-card-actions{grid-column:1/-1;display:flex;justify-content:flex-end}.vm-automatic-backup-empty{display:grid;gap:5px;padding:25px 17px;border:1px dashed #cedce2;border-radius:9px;color:#8797a5;text-align:center}.vm-automatic-backup-empty strong{color:#506779;font-size:12px}.vm-automatic-backup-empty span{font-size:10px}@media screen and (max-width:740px){.vm-automatic-backup-grid{grid-template-columns:1fr}}@media screen and (max-width:510px){.vm-automatic-backup-list-heading{align-items:flex-start;flex-direction:column}.vm-automatic-backup-list-heading .button{width:100%}.vm-automatic-backup-card{grid-template-columns:1fr}.vm-automatic-backup-card-status,.vm-automatic-backup-card-actions{grid-column:1}.vm-automatic-backup-card-actions .button{width:100%}} .vm-automatic-backup-service{display:grid;gap:15px;margin:0 0 24px;padding:18px;border:1px solid #dce7ec;border-radius:11px;background:#fbfdfd}.vm-automatic-backup-service-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.vm-automatic-backup-service-heading h4{margin:4px 0 0;color:#30495d;font-size:14px}.vm-automatic-backup-service-prices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;padding:1px;background:#e2eaed}.vm-automatic-backup-service-prices>div{display:grid;min-width:0;gap:5px;padding:14px;background:#fff}.vm-automatic-backup-service-prices span{color:#7c8e9e;font-size:10px}.vm-automatic-backup-service-prices strong{color:#263f54;font-size:14px;overflow-wrap:anywhere}.vm-automatic-backup-service-prices small{color:#8999a6;font-size:9px;line-height:1.55}.vm-automatic-backup-service-note{margin:0;color:#64798b;font-size:10px;line-height:1.7}.vm-automatic-backup-service-actions{display:flex;justify-content:flex-end;gap:10px}.vm-automatic-backup-service-actions .button{min-width:138px}@media screen and (max-width:740px){.vm-automatic-backup-service-prices{grid-template-columns:1fr}.vm-automatic-backup-service-actions{flex-direction:column}.vm-automatic-backup-service-actions .button{width:100%}} diff --git a/web/resources/views/venix/cloud/pages/detail.tpl b/web/resources/views/venix/cloud/pages/detail.tpl index e87e31c4..55737d39 100644 --- a/web/resources/views/venix/cloud/pages/detail.tpl +++ b/web/resources/views/venix/cloud/pages/detail.tpl @@ -156,7 +156,7 @@