Skip to content

fix: Handle SSL in setup database temp server - #7166

Merged
louislam merged 4 commits into
masterfrom
dev
Mar 24, 2026
Merged

fix: Handle SSL in setup database temp server#7166
louislam merged 4 commits into
masterfrom
dev

Conversation

@louislam

@louislam louislam commented Mar 19, 2026

Copy link
Copy Markdown
Owner

Summary

It seems that the temp server for setup-database page is not enabled SSL even if the settings are provided.

Also improved printServerUrls() for supporting https and sorted by IPv4 first

TODO: the temp server for db migration may have to be fixed too.
Too lazy to test, and we can check the progress in the console log, I let it alone first.

Resolves #7086

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.
  • 🔍 Any UI changes adhere to visual style of this project.
  • 🛠️ I have self-reviewed and self-tested my code to ensure it works as expected.
  • 📝 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).
  • 🧰 Dependency updates are listed and explained.
  • ⚠️ CI passes and is green.

Screenshots for Visual Changes

image

@louislam louislam changed the title Handle SSL in setup database temp server fix: Handle SSL in setup database temp server Mar 19, 2026
@louislam louislam added this to the 2.3.0 milestone Mar 19, 2026
@louislam
louislam marked this pull request as ready for review March 24, 2026 18:25
Copilot AI review requested due to automatic review settings March 24, 2026 18:25
@github-actions github-actions Bot added the pr:needs review this PR needs a review by maintainers or other community members label Mar 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes the setup-database “temp server” so it can serve over HTTPS when Uptime Kuma is configured with SSL key/cert, and updates server URL logging to correctly reflect HTTP vs HTTPS.

Changes:

  • Start the setup-database temporary Express server as an HTTPS server when isSSL is enabled.
  • Extend printServerUrls() to support HTTPS URLs and sort network addresses (IPv4 first).
  • Update the main server startup log to pass SSL state into printServerUrls().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
server/util-server.js Enhances printServerUrls() to print HTTPS URLs when applicable, sort addresses, and centralize URL construction.
server/setup-database.js Uses https.createServer() for the setup-database temp server when SSL is configured, and logs HTTPS URLs.
server/server.js Passes SSL state to printServerUrls() for correct startup URL logging.

Comment thread server/util-server.js
Comment thread server/util-server.js Outdated
louislam and others added 2 commits March 25, 2026 02:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@louislam
louislam enabled auto-merge (squash) March 24, 2026 18:30
@louislam
louislam merged commit c4b73ce into master Mar 24, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:needs review this PR needs a review by maintainers or other community members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When HTTPS is configured database creation still only works on HTTP

2 participants