Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion agent/app/service/disk_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,11 @@ func isPointMounted(mountPoint string) bool {
}

func addToFstabWithOptions(device, mountPoint, filesystem, options string) error {
uuid, err := getDeviceUUID(device)
if err != nil {
return fmt.Errorf("failed to get UUID for device %s: %v", device, err)
}

if filesystem == "" {
fsType, err := getFilesystemType(device)
if err != nil {
Expand All @@ -476,7 +481,7 @@ func addToFstabWithOptions(device, mountPoint, filesystem, options string) error
options = "defaults"
}

entry := fmt.Sprintf("%s %s %s %s 0 2\n", device, mountPoint, filesystem, options)
entry := fmt.Sprintf("UUID=%s %s %s %s 0 2\n", uuid, mountPoint, filesystem, options)

file, err := os.OpenFile("/etc/fstab", os.O_APPEND|os.O_WRONLY, 0644)
if err != nil {
Expand Down Expand Up @@ -568,3 +573,15 @@ func parseSizeToBytes(sizeStr string) int64 {
return val
}
}

func getDeviceUUID(device string) (string, error) {
output, err := cmd.RunDefaultWithStdoutBashC(fmt.Sprintf("blkid -s UUID -o value %s", device))
if err != nil {
return "", err
}
uuid := strings.TrimSpace(output)
if uuid == "" {
return "", fmt.Errorf("no UUID found for device %s", device)
}
return uuid, nil
}
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2755,6 +2755,8 @@ const message = {
streamPortsHelper:
'Set the external listening port number, clients will access the service through this port, separated by commas, e.g., 5222,5223',
streamHelper: 'TCP/UDP Port Forwarding and Load Balancing',

syncHtmlHelper: 'Sync to PHP and static websites',
},
php: {
short_open_tag: 'Short tag support',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/es-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2747,6 +2747,8 @@ const message = {
streamPortsHelper:
'Configura el número de puerto de escucha externo, los clientes accederán al servicio a través de este puerto, separado por comas, p. ej., 5222,5223',
streamHelper: 'Reenvío de Puertos y Balanceo de Carga TCP/UDP',

syncHtmlHelper: 'Sincronizar con PHP y sitios web estáticos',
},
php: {
short_open_tag: 'Soporte de etiquetas cortas',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2679,6 +2679,8 @@ const message = {
streamPortsHelper:
'外部リスニングポート番号を設定します。クライアントはこのポートを通じてサービスにアクセスします。カンマで区切ってください。例:5222,5223',
streamHelper: 'TCP/UDP ポート転送とロードバランシング',

syncHtmlHelper: 'PHP と静的ウェブサイトに同期',
},
php: {
short_open_tag: '短いタグサポート',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2634,6 +2634,8 @@ const message = {
streamPortsHelper:
'외부 수신 포트 번호를 설정합니다. 클라이언트는 이 포트를 통해 서비스에 액세스합니다. 쉼표로 구분하세요. 예: 5222,5223',
streamHelper: 'TCP/UDP 포트 포워딩 및 로드 밸런싱',

syncHtmlHelper: 'PHP 및 정적 웹사이트에 동기화',
},
php: {
short_open_tag: '짧은 태그 지원',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2736,6 +2736,8 @@ const message = {
streamPortsHelper:
'Tetapkan nombor port pendengaran luaran, pelanggan akan mengakses perkhidmatan melalui port ini, dipisahkan dengan koma, cth., 5222,5223',
streamHelper: 'Penerusan Port dan Pengimbangan Beban TCP/UDP',

syncHtmlHelper: 'Segerakkan ke PHP dan laman web statik',
},
php: {
short_open_tag: 'Sokongan tag pendek',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2741,6 +2741,8 @@ const message = {
streamPortsHelper:
'Defina o número da porta de escuta externa, os clientes acessarão o serviço através desta porta, separados por vírgulas, por exemplo: 5222,5223',
streamHelper: 'Encaminhamento de Portas e Balanceamento de Carga TCP/UDP',

syncHtmlHelper: 'Sincronizar com PHP e sites estáticos',
},
php: {
short_open_tag: 'Suporte para short tags',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2736,6 +2736,8 @@ const message = {
streamPortsHelper:
'Установите номер внешнего порта прослушивания, клиенты будут получать доступ к службе через этот порт, разделяйте запятыми, например: 5222,5223',
streamHelper: 'Перенаправление портов и балансировка нагрузки TCP/UDP',

syncHtmlHelper: 'Синхронизировать с PHP и статическими сайтами',
},
php: {
short_open_tag: 'Поддержка коротких тегов',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2793,6 +2793,8 @@ const message = {
streamPortsHelper:
'Harici dinleme bağlantı noktası numarasını ayarlayın, istemciler bu bağlantı noktası üzerinden hizmete erişecektir, virgülle ayırın, örn.: 5222,5223',
streamHelper: 'TCP/UDP Port Yönlendirme ve Yük Dengeleme',

syncHtmlHelper: 'PHP ve statik web siteleriyle senkronize et',
},
php: {
short_open_tag: 'Kısa etiket desteği',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2565,6 +2565,8 @@ const message = {
streamPorts: '監聽端口',
streamPortsHelper: '設定對外監聽的埠號,客戶端將透過此埠存取服務,按逗號分割,例如:5222,5223',
streamHelper: 'TCP/UDP 端口轉發與負載均衡',

syncHtmlHelper: '同步到 PHP 和靜態網站',
},
php: {
short_open_tag: '短標籤支援',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2562,6 +2562,8 @@ const message = {
streamPorts: '监听端口',
streamPortsHelper: '设置对外监听的端口号,客户端将通过此端口访问服务,按逗号分割,例如:5222,5223',
streamHelper: 'TCP/UDP 端口转发与负载均衡',

syncHtmlHelper: '同步到 PHP 和静态网站',
},
php: {
short_open_tag: '短标签支持',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/website/website/html/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</el-text>
</div>
<div class="mt-1.5">
<el-checkbox v-model="req.sync">{{ $t('同步到 PHP 和静态网站') }}</el-checkbox>
<el-checkbox v-model="req.sync">{{ $t('website.syncHtmlHelper') }}</el-checkbox>
</div>
<div ref="htmlRef" class="default-html"></div>

Expand Down
Loading