Skip to content
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

Support PostgreSQL connection with SSL #1243 #1244

Open
wants to merge 52 commits into
base: dev
Choose a base branch
from

Conversation

unical1988
Copy link

I added tsx and go codes for backend and frontend to support SSL for PostgreSQL.

@unical1988
Copy link
Author

I now made the select and checkbox two seperated form groups and remove handleChange()

@unical1988
Copy link
Author

Your comments suggest fixing the frontend part of the new feature, are there problems with the backend commited code?

@unical1988
Copy link
Author

Is the connection string building for the DB correct (in internal/install/install_req.go)?. I assume the pem and crt files should be found in the folder data/cache/certs/

@shuashuai
Copy link
Member

I now made the select and checkbox two seperated form groups and remove handleChange()

An important point is that you have locally verified the code you submitted now? Can the front-end project run correctly?
If you haven't read the development guide, please go to the official website to read the development guide first.

image

I checked it and it still didn't handle the translation completely. In addition, if your editor uses vscode, it is recommended to install the eslint plugin.

SSL Mode On element, why not apply to react-bootstrap components? And why doesn't the checkbox value apply to the value you passed in, but continue to use the value on the current page?

I'm not sure if you end up submitting and saving the value of SSL Mode checkbox to the database. If it's just a logic of whether select is displayed, then it doesn't need to be saved in formData, it just needs to be processed within the current component.

image

The following is content without translation
image

image

@shuashuai
Copy link
Member

Your comments suggest fixing the frontend part of the new feature, are there problems with the backend commited code?

I currently only review the front-end code, and the back-end code needs to wait for @LinkinStars to review it.

@unical1988
Copy link
Author

I am in the process of testing right now, I will check your comments and make the changes in the next commits

@unical1988
Copy link
Author

I made few other frontend fixes (except relating to handle the translations)

@shuashuai
Copy link
Member

shuashuai commented Feb 8, 2025

I made few other frontend fixes (except relating to handle the translations)

  1. there are still ts errors reported in development mode

image

  1. the translation file should be in the i18n directory. What do you ask about creating and submitting the language file in the cmd directory

There are some tutorials on Answer development on the official blog that may be helpful for you to be familiar with projects and development. You can read it.

@LinkinStars
Copy link
Member

LinkinStars commented Feb 8, 2025

Is the connection string building for the DB correct (in internal/install/install_req.go)?. I assume the pem and crt files should be found in the folder data/cache/certs/

@unical1988 All the files required for SSL, such as .pem and .crt, have an input field where users can directly enter the directory path. Users can place the files in the specified directory themselves.

@unical1988
Copy link
Author

All the files required for SSL, such as .pem and .crt, have an input field where users can directly enter the directory path. Users can place the files in the specified directory themselves.

does it mean I have to create input text elements (3) in the UI while SSL is enabled to enable the user to specify the paths ? or is it an upload feature?

@LinkinStars
Copy link
Member

All the files required for SSL, such as .pem and .crt, have an input field where users can directly enter the directory path. Users can place the files in the specified directory themselves.

does it mean I have to create input text elements (3) in the UI while SSL is enabled to enable the user to specify the paths ? or is it an upload feature?

@unical1988 Make it simple. Only need three input text fields.

@shuashuai
Copy link
Member

@shuashuai how to format the front-end according to the project styling? is there a prettier command to execute to do so?

This kind of problem should be solved on its own by searching or AI.

Fix single file command npx eslint --fix [filepath]

It should also be noted that I'm not going to look at the implementation logic until it passes format checking

@sy-records
Copy link
Member

By the way, the base branch of PR should be dev, you'll need to work out the conflicts locally.

value: 'require',
isInvalid: false,
errorMsg: '',
};
Copy link
Member

@shuashuai shuashuai Mar 5, 2025

Choose a reason for hiding this comment

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

The ssl_enabled and ssl_mode checksum is not needed and is meaningless, it's just a variable that controls the data underneath.

What needs to be checked is the value of key_file and pen_file and cert_file if ssl_enabled is true and ssl_mode is not required.

In addition, when switching ssl_anabled, please reinitialize these relevant values (ssl_mode、key_file、pen_file、cert_file)

Copy link
Author

@unical1988 unical1988 Mar 5, 2025

Choose a reason for hiding this comment

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

is ssl_enabled initialized somewhere? I can edit the code to account only for the values of %_file but how and where default values for ssl_mode and ssl_enabled are set? the current logic initilizes them, but you say it is not needed.

Copy link
Author

Choose a reason for hiding this comment

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

I have also added the re-initialization of the relevant variables when switching ssl_enabled

@LinkinStars LinkinStars changed the base branch from main to dev March 10, 2025 08:07
@LinkinStars LinkinStars changed the title front end and backend added for the feature #1243 Support PostgreSQL connection with SSL #1243 Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants