-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
feat(setup-database): Add SSL authentication method for database setup #6671
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
Conversation
Add SSL checkbox and CA Certificate textarea for SetupDatabase.vue page Add UPTIME_KUMA_DB_SSL and UPTIME_KUMA_DB_CA env variables to dbConfig as ssl and ca inside setup-database.js
CommanderStorm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I think, we can make this fit in a bit better into our existing desighn with little extra effort.
What do you think?
Also, could you write a short guide (a docker run command + how to generate the certs) for how to get this running? I don't use mariadb, so don't have the best context to write this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds SSL/TLS authentication support for external database connections (MariaDB/MySQL), allowing users to configure SSL mode and provide CA certificates either through the web UI during setup or via environment variables.
Changes:
- Added UI components (toggle and textarea) in the database setup page for SSL configuration
- Extended backend environment variable handling to support
UPTIME_KUMA_DB_SSLandUPTIME_KUMA_DB_CA - Implemented SSL configuration in database connection logic across multiple connection points
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/pages/SetupDatabase.vue | Added SSL toggle switch and collapsible CA certificate textarea input to the database setup form |
| server/setup-database.js | Added environment variable parsing for SSL config and SSL connection options in the test connection logic |
| server/database.js | Implemented SSL configuration with CA certificate support across MariaDB connection configurations |
server/setup-database.js
Outdated
| dbConfig.ssl = process.env.UPTIME_KUMA_DB_SSL.toLowerCase() === "true"; | ||
| dbConfig.ca = process.env.UPTIME_KUMA_DB_CA; |
Copilot
AI
Jan 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new SSL configuration functionality in the environment variable handling lacks test coverage. Consider adding tests to verify that UPTIME_KUMA_DB_SSL and UPTIME_KUMA_DB_CA are correctly parsed and handled, including edge cases like undefined or invalid values.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CommanderStorm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few minor tweakas and simplifications.
Could you also post a very short guide how to use this for the wiki?
LGTM once these two are done?
A docker run command + how to generate the certs is sufficient. I don't use mariadb, so don't have the best context to write this.
simplify CA Certificate input Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
|
@CommanderStorm, I'm planning to add those environment variables to the wiki page after this pr gets merged. |
|
Okay, we can merge once there is a documentation PR or a pr comment here how to set this up. |
|
Okay, no problem 👍 |
|
Documentation PR is submitted Wiki PR #136 Updated section in
|
Fixes eslint warning: Attribute "v-if" should go before "class"


Add SSL checkbox and CA Certificate textarea for SetupDatabase.vue page Add UPTIME_KUMA_DB_SSL and UPTIME_KUMA_DB_CA env variables to dbConfig as ssl and ca inside setup-database.js
ℹ️ To keep reviews fast and effective, please make sure you’ve read our pull request guidelines
📝 Summary of changes done and why they are done
Some database provider needs SSL authentication with CA Certification or without the Certification, but they need the ssl mode.
This pr gives the user the option of adding those credentials from the direct database setup page form field as well as directly through environment variables.
📋 Related issues
📄 Checklist
Please follow this checklist to avoid unnecessary back and forth (click to expand)
I understand that I am responsible for and able to explain every line of code I submit.
📷 Screenshots or Visual Changes
The SSL toggle button and CA textarea were added at the bottom
UI