use database settings for lookups

This commit is contained in:
Peter Rounce 2023-01-27 12:01:47 +00:00
parent 085b402fef
commit 59151232dd
13 changed files with 87 additions and 42 deletions

View file

@ -8,7 +8,7 @@ import (
)
func lnurlp_response(w http.ResponseWriter, r *http.Request) {
if os.Getenv("FUNCTION_LNURLP") != "ENABLE" {
if db_get_setting("FUNCTION_LNURLP") != "ENABLE" {
log.Debug("LNURLp function is not enabled")
return
}
@ -22,9 +22,9 @@ func lnurlp_response(w http.ResponseWriter, r *http.Request) {
"r.Host": r.Host,
},).Info("lnurlp_response")
// look up domain in env vars (HOST_DOMAIN)
// look up domain setting (HOST_DOMAIN)
domain := os.Getenv("HOST_DOMAIN")
domain := db_get_setting("HOST_DOMAIN")
if r.Host != domain {
log.Warn("wrong host domain")
write_error(w)