Add web server and relay configuration support

- Introduced a new Dockerfile for building the web server.
- Updated docker-compose.yml to include the web server service with environment variable support for relay URLs.
- Enhanced relay management in relays.go to read from environment variables.
- Updated main.go to provide descriptions for relay configuration in CLI commands.
This commit is contained in:
studiokaiji
2025-11-26 00:24:29 +09:00
parent 535d36bab9
commit 6841ef94bb
5 changed files with 118 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package server
import (
"context"
"fmt"
"net/http"
"strings"
@@ -25,6 +26,8 @@ func Start(port string, mode string) {
r := gin.Default()
fmt.Println("[Hostr] Using relays:", strings.Join(allRelays, ", "))
r.GET("/e/:hex_or_nevent", func(ctx *gin.Context) {
hexOrNevent := ctx.Param("hex_or_nevent")
@@ -93,8 +96,6 @@ func Start(port string, mode string) {
} else {
ctx.String(http.StatusNotFound, http.StatusText(http.StatusNotFound))
}
return
})
if mode != "secure" {
@@ -197,8 +198,6 @@ func Start(port string, mode string) {
} else {
ctx.String(http.StatusNotFound, http.StatusText(http.StatusNotFound))
}
return
})
}