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

Conversation

zhengkunwang223
Copy link
Member

Refs #8981

Copy link

f2c-ci-robot bot commented Jun 10, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

</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.

@@ -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.

@@ -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.

Copy link

Copy link
Member

@wanghe-fit2cloud wanghe-fit2cloud left a comment

Choose a reason for hiding this comment

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

/lgtm

@wanghe-fit2cloud
Copy link
Member

/approve

Copy link

f2c-ci-robot bot commented Jun 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wanghe-fit2cloud

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot merged commit e925773 into dev-v2 Jun 10, 2025
7 checks passed
@f2c-ci-robot f2c-ci-robot bot deleted the pr@dev-v2@website branch June 10, 2025 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants