Skip to content

Conversation

@nilanjan-debnath
Copy link
Contributor

@nilanjan-debnath nilanjan-debnath commented Jan 10, 2026

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)
  • ⚠️ If there are Breaking change (a fix or feature that alters existing functionality in a way that could cause issues) I have called them out
  • 🧠 I have disclosed any use of LLMs/AI in this contribution and reviewed all generated content.
    I understand that I am responsible for and able to explain every line of code I submit.
  • 🔍 My code adheres to the style guidelines of this project.
  • ⚠️ My changes generate no new warnings.
  • 🛠️ I have reviewed and tested my code.
  • 📝 I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
  • 🤖 I added or updated automated tests where appropriate.
  • 📄 Documentation updates are included (if applicable).
  • 🔒 I have considered potential security impacts and mitigated risks.
  • 🧰 Dependency updates are listed and explained.

📷 Screenshots or Visual Changes

The SSL toggle button and CA textarea were added at the bottom

Event Before After
UI Before After
Testing Before After

nilanjan-debnath and others added 2 commits January 10, 2026 21:03
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
@nilanjan-debnath nilanjan-debnath changed the title Add SSL authentication method for database setup feat: Add SSL authentication method for database setup Jan 10, 2026
@nilanjan-debnath nilanjan-debnath changed the title feat: Add SSL authentication method for database setup feat(setup-database): Add SSL authentication method for database setup Jan 10, 2026
Copy link
Collaborator

@CommanderStorm CommanderStorm left a 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?

Image

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

Copy link
Contributor

Copilot AI left a 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_SSL and UPTIME_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

Comment on lines 105 to 106
dbConfig.ssl = process.env.UPTIME_KUMA_DB_SSL.toLowerCase() === "true";
dbConfig.ca = process.env.UPTIME_KUMA_DB_CA;
Copy link

Copilot AI Jan 10, 2026

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.

Copilot uses AI. Check for mistakes.
@nilanjan-debnath
Copy link
Contributor Author

nilanjan-debnath commented Jan 10, 2026

Improved the UI with detailed description of the new fields.

image image

Copy link
Collaborator

@CommanderStorm CommanderStorm left a 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.

@CommanderStorm CommanderStorm mentioned this pull request Jan 11, 2026
18 tasks
nilanjan-debnath and others added 3 commits January 11, 2026 09:37
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>
@nilanjan-debnath
Copy link
Contributor Author

@CommanderStorm, I'm planning to add those environment variables to the wiki page after this pr gets merged.
For the CA Certificate, users don't have to generate anything they will just provide the credentials received from the database provider.

@CommanderStorm
Copy link
Collaborator

Okay, we can merge once there is a documentation PR or a pr comment here how to set this up.
As said: I don't want to document this myself as I am not the expert on this.

@CommanderStorm CommanderStorm marked this pull request as draft January 11, 2026 04:23
@CommanderStorm CommanderStorm added the pr:please address review comments this PR needs a bit more work to be mergable label Jan 11, 2026
@nilanjan-debnath
Copy link
Contributor Author

Okay, no problem 👍

@nilanjan-debnath
Copy link
Contributor Author

Documentation PR is submitted Wiki PR #136

Updated section in MariaDB Environment Variables

Environment Variable Description
UPTIME_KUMA_DB_SSL (2.0.0) Optional. Enable SSL for database connection (true/false, default: false)
UPTIME_KUMA_DB_CA (2.0.0) Optional. CA certificate content in PEM format for SSL connection

@nilanjan-debnath nilanjan-debnath marked this pull request as ready for review January 11, 2026 05:28
@CommanderStorm CommanderStorm enabled auto-merge (squash) January 11, 2026 06:58
@CommanderStorm CommanderStorm added this to the 2.1.0 milestone Jan 11, 2026
@CommanderStorm CommanderStorm merged commit c5675ae into louislam:master Jan 11, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:please address review comments this PR needs a bit more work to be mergable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MariaDB allow secure connection Cannot connect to azure mysql flexible server while --require_secure_transport=ON

2 participants