foxcpp / foxcpp/maddy

How can I pull local_domains from table.sql_query

Offen
#731 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
new feature
Vorherrschende Sprache
Go
Sterne
6.1k
Forks
327
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

# Use case

I am building a systme where I add domains to maddy via api. I have already built the api part (if anyone finds this useful I'm happy to share). Now I'd like to, inatead of passing local_domains via ENV, read them from a postgres table, in a way that I do not need to restart maddy to make these domains visible to the modules.

Note alternatives you considered and why they are not useful.

# Your idea for a solution
Tried this
```
table.sql_query allowed_domains {
driver postgres
named_args no
dsn "postgres dsn"
lookup "SELECT domain FROM domains where domain = $1"
list "SELECT domain FROM domains"
}

whatever {
modify {
dkim {
domains $(primary_domain) $(local_domains) &allowed_domains
selector default
key_path dkim-keys/{domain}-{selector}.key
sig_expiry 120h # 5 days
hash sha256
newkey_algo rsa2048
}
}
}
```
How your solution would work in general?

Did not, domains are not in the list

- [x ] I'm willing to help with the implementation

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Es werden keine Dateien oder Tests genannt; beginne damit, die Konfigurationsverarbeitung für table.sql_query, local_domains und PostgreSQL-gestützte Lookups nachzuverfolgen. Ermittle, wie die bestehende API und die Modulkonfiguration Daten aktualisieren, und definiere anschließend die Fertigstellung so, dass tabellengestützte Domains sichtbar werden, ohne maddy neu zu starten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
go, postgres
Bereich
backend, databases
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.