Skip to content

fix: fix issue with change ssl_protocols failed #8985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025
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
2 changes: 1 addition & 1 deletion agent/app/service/website_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ func applySSL(website *model.Website, websiteSSL model.WebsiteSSL, req request.W
if param.Name == "ssl_protocols" {
nginxParams[i].Params = req.SSLProtocol
if len(req.SSLProtocol) == 0 {
nginxParams[i].Params = []string{"TLSv1.3", "TLSv1.2", "TLSv1.1", "TLSv1"}
nginxParams[i].Params = []string{"TLSv1.3", "TLSv1.2"}
}
}
if param.Name == "ssl_ciphers" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code snippet you provided has two minor adjustments:

  1. The line if len(req.SSLProtocol) == 0: nginxParams[i].Params = []string{"TLSv1.3", "TLSv1.2", "TLSv1.1", "TLSv1"} is corrected to avoid including "TLSv1.1" when no SSL protocols are specified. However, it could be more efficient if you handle this more robustly. For example, instead of specifying all supported versions, consider using the standard recommended settings like "ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-CBC-SHA:AES256-SHA".

  2. The list of available SSL ciphers can also vary widely depending on the environment, so handling them individually might not be necessary. Instead, consider generating a comprehensive cipher suite that includes modern standards such as TLS_AES_256_GCM_SHA384 and TLS_ECC_RSA_P521_SHA384 for maximum security against known vulnerabilities.

These changes improve clarity and adaptability without introducing unnecessary complexity.

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3384,7 +3384,7 @@ const message = {

panelExist:
'1Panel V1 service is running on this node. Please upgrade to V2 using the migration script before adding.',
coreExist: 'This node already has 1Panel V2 service deployed and cannot be added as a secondary node.',
coreExist: 'This node has already been enabled as the main node and cannot be added as a slave node.',
agentExist:
'1panel-agent is already installed on this node. Continuing will preserve existing data and only replace the 1panel-agent service. Proceed?',
dataExist: '1Panel historical data exists on this node. Confirm to continue adding?',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3240,7 +3240,7 @@ const message = {

panelExist:
'このノードで1Panel V1サービスが実行中です。追加する前に移行スクリプトでV2にアップグレードしてください。',
coreExist: 'このノードには1Panel V2サービスがデプロイ済みのため、セカンダリノードとして追加できません。',
coreExist: 'このノードは既にメインノードとして有効になっており、スレーブノードとして追加できません。',
agentExist:
'このノードには1panel-agentがインストール済みです。続行すると既存データは保持され、1panel-agentサービスのみ置き換えられます。続行しますか?',
dataExist: 'このノードに1Panelの過去データが存在します。追加を続行しますか?',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3184,7 +3184,7 @@ const message = {

panelExist:
'이 노드에서 1Panel V1 서비스가 실행 중입니다. 추가하기 전에 마이그레이션 스크립트로 V2로 업그레이드하세요.',
coreExist: '이 노드에는 이미 1Panel V2 서비스가 배포되어 있어 보조 노드로 추가할 수 없습니다.',
coreExist: '이 노드는 이미 메인 노드로 활성화되어 있어 슬레이브 노드로 추가할 수 없습니다.',
agentExist:
'이 노드에 1panel-agent가 이미 설치되어 있습니다. 계속하면 기존 데이터는 유지되고 1panel-agent 서비스만 교체됩니다. 계속하시겠습니까?',
dataExist: '이 노드에 1Panel 이전 데이터가 존재합니다. 추가를 계속하시겠습니까?',
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3311,8 +3311,7 @@ const message = {

panelExist:
'Mengesan perkhidmatan 1Panel V1 sedang berjalan pada nod ini. Sila naik taraf ke V2 menggunakan skrip migrasi sebelum menambah.',
coreExist:
'Nod ini telah mempunyai perkhidmatan 1Panel V2 dipasang, tidak boleh ditambah sebagai nod sekunder.',
coreExist: 'Node ini telah diaktifkan sebagai nod utama dan tidak boleh ditambah sebagai nod hamba.',
agentExist:
'Mengesan 1panel-agent telah dipasang pada nod ini. Jika diteruskan, data sedia ada akan dikekalkan dan hanya perkhidmatan 1panel-agent akan diganti. Teruskan?',
dataExist: 'Mengesan data sejarah 1Panel wujud pada nod ini. Sahkan untuk terus menambah?',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code appears to have some discrepancies:

  1. coreExist Message: The new message "Node ini telah diaktifkan sebagai nod utama dan tidak boleh ditambah sebagai nod hamba." is less clear than the previous version.

  2. Potential Optimization Suggestions:

    • Consider providing more context around why these messages appear in different sections of the system.
    • Review if the logic behind determining nodExist, coreExist, agentExist, and dataExist can be consolidated into a single function or method with better comments describing their behavior.

Overall, ensure that the error handling messages are understandable and provide users with appropriate guidance based on the current node's configuration.

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3318,7 +3318,7 @@ const message = {

panelExist:
'O serviço 1Panel V1 está em execução neste nó. Atualize para V2 usando o script de migração antes de adicionar.',
coreExist: 'Este nó já tem o serviço 1Panel V2 implantado e não pode ser adicionado como nó secundário.',
coreExist: 'Este nó já foi ativado como nó principal e não pode ser adicionado como um escravo.',
agentExist:
'1panel-agent já está instalado neste nó. Continuar preservará os dados existentes e substituirá apenas o serviço 1panel-agent. Prosseguir?',
dataExist: 'Existem dados históricos do 1Panel neste nó. Confirmar para continuar a adição?',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3305,7 +3305,7 @@ const message = {

panelExist:
'На этом узле запущена служба 1Panel V1. Перед добавлением обновитесь до V2 с помощью скрипта миграции.',
coreExist: 'На этом узле уже развернута служба 1Panel V2, поэтому его нельзя добавить как вторичный узел.',
coreExist: 'Этот узел уже активирован как основной узел и не может быть добавлен как подчиненный узел.',
agentExist:
'1panel-agent уже установлен на этом узле. Продолжение сохранит существующие данные и заменит только службу 1panel-agent. Продолжить?',
dataExist: 'На этом узле есть исторические данные 1Panel. Подтвердить продолжение добавления?',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3130,7 +3130,7 @@ const message = {
nodeSyncHelper2: '2. 主節點與子節點的連接信息',

panelExist: '檢測到該節點正在運行 1Panel V1 服務,請先透過遷移腳本升級至 V2 後再進行新增。',
coreExist: '該節點已部署 1Panel V2 服務,無法作為從屬節點新增。',
coreExist: '該節點已作為主節點啟用,無法作為從節點添加。',
agentExist: '檢測到該節點已安裝 1panel-agent,繼續新增將保留現有數據,僅替換 1panel-agent 服務,是否繼續?',
dataExist: '檢測到該節點存在 1Panel 歷史數據,是否確認繼續新增?',
errLicense: '檢測到該節點綁定的許可證不可用,請檢查後重試!',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3100,7 +3100,7 @@ const message = {
nodeSyncHelper1: '1. 公用的备份账号信息',
nodeSyncHelper2: '2. 主节点与子节点的连接信息',
panelExist: '检测到该节点正在运行 1Panel V1 服务,请先通过迁移脚本升级至 V2 后再进行添加。',
coreExist: '该节点已部署 1Panel V2 服务,无法作为从节点添加。',
coreExist: '该节点已作为主节点启用,无法作为从节点添加。',
agentExist: '检测到该节点已安装 1panel-agent,继续添加将保留现有数据,仅替换 1panel-agent 服务,是否继续?',
dataExist: '检测到该节点存在 1Panel 历史数据,是否确认继续添加?',
errLicense: '检测到该节点绑定的许可证不可用,请检查后重试!',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@
<el-checkbox :value="'TLSv1.3'">{{ 'TLS 1.3' }}</el-checkbox>
<el-checkbox :value="'TLSv1.2'">{{ 'TLS 1.2' }}</el-checkbox>
<el-checkbox :value="'TLSv1.1'">
{{ 'TLS 1.0' + $t('website.notSecurity') }}
{{ 'TLS 1.1' + $t('website.notSecurity') }}
</el-checkbox>
<el-checkbox :value="'TLSv1'">
{{ 'TLS 1.1' + $t('website.notSecurity') }}
{{ 'TLS 1.0' + $t('website.notSecurity') }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code snippet is not clear regarding the specific context of what it's supposed to accomplish. However, based on typical error messages or warnings associated with HTML/CSS/JavaScript discrepancies, I can highlight some key points that might indicate issues:

  1. Language Translation: The template strings "TLS 1.0" and "TLS 1.2" appear to be placeholders for translations using $t(...). It looks like there could be an issue if these keys do not exist in the translation file (translations.js, etc.) or if they have been translated incorrectly.

  2. Checkbox Values: There seems to be inconsistency in how different SSL/TLS versions are being displayed:

    • For TLSv1.0 (line 148), both options use TLS 1.1 before appending the security warning text.
    • For TLSv1.1 (line 151), similar inconsistencies exist when displaying TLS 1.1.

To resolve this, you should ensure that the same version number appears only once within each checkbox label before any additional information such as a safety notice. Additionally:

  • Verify the existence and correctness of translation texts for website.notSecurity.
  • Ensure consistency across all labels and values throughout the form structure.

If the goal is to clearly display which protocols lack security features without repeating the protocol name multiple times, consider normalizing the way these version numbers are handled in the checkboxes.

Example correction (assuming consistent naming):

<el-checkbox-group v-model="tlsVersionPreferences">
    <div style="display: flex; gap: 4px;">
        <el-checkbox :label="'TLSv1.3'">{{ 'TLS 1.3' }}</el-checkbox>
        <el-checkbox :label="'TLSv1.2'">{{ 'TLS 1.2' }}</el-checkbox>
        <!-- Consistent representation -->
        <div style="display: flex;">
            <el-checkbox :label="'TLSv1.1'" />
            <span>{{ $t('website.notSecurity') }} (Not recommended)</span>
        </div>
        <div style="display: flex;">
            <el-checkbox :label="'TLSv1'" />
            <span>{{ $t('website.notSecurity') }} (Recommended against due to severe vulnerabilities)</span>
        </div>
    </div>
</el-form-item>

This approach maintains clarity while maintaining semantic separation between protocol descriptions and security advisories, improving readability and maintainability.

Expand Down
Loading