feat(service): custom product, lịch sử giám sát VM và mã hoá response theo phiên
- Dịch vụ custom: bảng custom_products + services.custom_product_id; createService nhận
custom{} thay product_id, giá = đơn giá tháng x số tháng chu kỳ (1/3/6/12/24/36),
gia hạn tính theo cùng đơn giá, ServiceClientDetailResource trả custom_product và specs.
- Giám sát VM: GET v1/system/vm-metrics/history gom lịch sử về tối đa 240 điểm;
lỗi lấy dung lượng đĩa không còn làm hỏng cả thẻ metrics.
- SealResponse: AES-256-GCM theo khoá phiên do proxy Next cấp qua header x-seal-key
(HMAC của session id). Client opt-in bằng x-seal; chi tiết dịch vụ, mật khẩu VM và
console ticket luôn được mã hoá. Body gửi lên dạng {enc} được giải mã trước validate;
khoá lệch trả 428 để client lấy khoá mới. Đây là che mắt DevTools, không phải bảo mật
chống chính chủ tài khoản.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
8108e8fe53
commit
6315a392c0
+6
-5
@@ -122,15 +122,15 @@ Route::prefix('v1')
|
||||
Route::get('hosting', 'indexHosting')->name('hosting.list');
|
||||
Route::get('web-design', 'indexWebDesign')->name('web-design.list');
|
||||
Route::get('domain', 'indexDomain')->name('domain.list');
|
||||
Route::get('{uuid}', 'getDetail')->name('detail');
|
||||
Route::get('{uuid}/vm-password', 'getVmPassword')->middleware('throttle:20,1')->name('vm-password');
|
||||
Route::get('{uuid}/console-ticket', 'getConsoleTicket')->name('console-ticket');
|
||||
Route::get('{uuid}', 'getDetail')->middleware('seal.response:always')->name('detail');
|
||||
Route::get('{uuid}/vm-password', 'getVmPassword')->middleware(['throttle:20,1', 'seal.response:always'])->name('vm-password');
|
||||
Route::get('{uuid}/console-ticket', 'getConsoleTicket')->middleware('seal.response:always')->name('console-ticket');
|
||||
Route::get('{uuid}/available-os', 'getAvailableOs')->name('available-os');
|
||||
Route::post('{uuid}/rebuild', 'rebuild')->name('rebuild');
|
||||
Route::patch('{uuid}/auto-renew', 'updateAutoRenew')->name('auto-renew.update');
|
||||
});
|
||||
|
||||
Route::middleware(['api.auth'])
|
||||
Route::middleware(['api.auth', 'seal.response:always'])
|
||||
->get('get-ticket-console', [ClientServiceController::class, 'getTicketByOrderNum'])
|
||||
->name('console-ticket');
|
||||
|
||||
@@ -318,13 +318,14 @@ Route::prefix('v1/system')
|
||||
Route::controller(VmController::class)->group(function () {
|
||||
Route::get('vm-power-state', 'powerState')->name('vm.power-state');
|
||||
Route::get('vm-metrics', 'metrics')->name('vm.metrics');
|
||||
Route::get('vm-metrics/history', 'metricsHistory')->name('vm.metrics.history');
|
||||
Route::post('vm-power-on', 'powerOn')->name('vm.power-on');
|
||||
Route::post('vm-power-off', 'powerOff')->name('vm.power-off');
|
||||
Route::get('vm-ip-options', 'ipOptions')->name('vm.ip-options');
|
||||
Route::post('vm-change-ip', 'changeIp')->name('vm.change-ip');
|
||||
Route::post('vm-change-port', 'changePort')->name('vm.change-port');
|
||||
Route::post('vm-change-password', 'changePassword')->name('vm.change-password');
|
||||
Route::get('get-ticket-console', 'consoleTicket')->name('vm.console-ticket');
|
||||
Route::get('get-ticket-console', 'consoleTicket')->middleware('seal.response:always')->name('vm.console-ticket');
|
||||
Route::post('vm-restart', 'restart')->name('vm.restart');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user