From 074f68146f8424d5f1800959c4832e9a42c567d8 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Wed, 10 Sep 2025 14:47:06 +0530 Subject: [PATCH] [server] Support for changing server port --- server/cmd/museum/main.go | 7 ++++++- server/configurations/local.yaml | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/server/cmd/museum/main.go b/server/cmd/museum/main.go index cf05b263e8..5a4a4a4053 100644 --- a/server/cmd/museum/main.go +++ b/server/cmd/museum/main.go @@ -858,7 +858,12 @@ func runServer(environment string, server *gin.Engine) { log.Fatal(server.RunTLS(":443", certPath, keyPath)) } else { - server.Run(":8080") + port := 8080 + if viper.IsSet("http.port") { + port = viper.GetInt("http.port") + } + log.Infof("starting server on port %d", port) + server.Run(fmt.Sprintf(":%d", port)) } } diff --git a/server/configurations/local.yaml b/server/configurations/local.yaml index 484e8ff400..60a0b9f51f 100644 --- a/server/configurations/local.yaml +++ b/server/configurations/local.yaml @@ -71,8 +71,13 @@ log-file: "" # HTTP connection parameters http: - # If true, bind to 443 and use TLS. - # By default, this is false, and museum will bind to 8080 without TLS. + # The port to bind to. + # If not specified, defaults to 8080 (HTTP) or 443 (HTTPS with use-tls: true) + # port: 8080 + + # If true, use TLS for HTTPS connections. + # When true and port is not specified, defaults to port 443. + # When false and port is not specified, defaults to port 8080. # use-tls: true # Specify the base endpoints for various apps