fix: IMAP-Serveradresse dynamisch aus Backend laden
Hardcodierte 192.168.1.131 in settings/page.tsx ersetzt durch
dynamischen API-Call GET /api/system/info → {fqdn, imap_port}.
Fallback auf window.location.hostname wenn API nicht antwortet.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package api
|
||||
|
||||
import "net/http"
|
||||
|
||||
// handleSystemInfo liefert öffentliche System-Verbindungsdaten
|
||||
// (FQDN, IMAP-Port). Wird im Frontend für die IMAP-Zugang-Karte
|
||||
// auf der Settings-Seite verwendet.
|
||||
//
|
||||
// GET /api/system/info — auth required (Endpoint zeigt nur generische,
|
||||
// nicht-sensitive Verbindungsdaten an, ist aber an Login gebunden, um
|
||||
// öffentliches Profiling der Installation zu vermeiden).
|
||||
func (s *Server) handleSystemInfo(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, http.StatusOK, map[string]interface{}{
|
||||
"fqdn": s.fqdn,
|
||||
"imap_port": 9993,
|
||||
"imap_port_alt": 993,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user