revert: foto de perfil e BIMI, para restaurar o servico
O site ficou a responder 502 em todos os hostnames depois do deploy destas duas funcionalidades. A reversao vem primeiro; o diagnostico vem a seguir, com o servico de pe. As migracoes 0012 e 0013 ficam. Sao aditivas, nada no codigo revertido as usa, e apaga-las deixaria a base de dados numa versao sem ficheiro correspondente, o que parte o proprio migrate no arranque seguinte. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3e06162fa0
commit
e30d000e43
26 files changed
+21
-1899
No files matched your search
@@ -1,30 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lambdamail/protocols/internal/infrastructure/postgres"
|
||||
httppresentation "lambdamail/protocols/internal/presentation/http"
|
||||
)
|
||||
|
||||
// bimiStore adapts the repository to the shape the HTTP layer asks for, so
|
||||
// that layer does not import the database package.
|
||||
type bimiStore struct {
|
||||
repo *postgres.BimiRepository
|
||||
}
|
||||
|
||||
func (s bimiStore) Save(ctx context.Context, domain string, svg []byte, vmcURL string) (string, error) {
|
||||
return s.repo.Save(ctx, domain, svg, vmcURL)
|
||||
}
|
||||
|
||||
func (s bimiStore) Load(ctx context.Context, domain string) (*httppresentation.BimiLogo, error) {
|
||||
logo, err := s.repo.Load(ctx, domain)
|
||||
if err != nil || logo == nil {
|
||||
return nil, err
|
||||
}
|
||||
return &httppresentation.BimiLogo{SVG: logo.SVG, ETag: logo.ETag, VmcURL: logo.VmcURL}, nil
|
||||
}
|
||||
|
||||
func (s bimiStore) Delete(ctx context.Context, domain string) error {
|
||||
return s.repo.Delete(ctx, domain)
|
||||
}
|
||||
@@ -230,15 +230,11 @@ func run(cfg config) {
|
||||
// list stops disagreeing with the page next to it.
|
||||
router.SetDnsStatusWriter(postgres.NewDomainRepository(pool))
|
||||
router.SetAdminDnsAPI(
|
||||
&dnsSpecSource{cfg: cfg, dkim: dkimRepo, bimi: postgres.NewBimiRepository(pool)},
|
||||
&dnsSpecSource{cfg: cfg, dkim: dkimRepo},
|
||||
netdns.NewPublicVerifier(),
|
||||
cfg.JwtSecret,
|
||||
)
|
||||
}
|
||||
// The BIMI mark: served to receivers over the well-known URL, managed from
|
||||
// the domains panel.
|
||||
router.SetBimiAPI(bimiStore{postgres.NewBimiRepository(pool)}, cfg.JwtSecret, cfg.domain())
|
||||
|
||||
// The TLS panel reads the live watcher instead of the constants the admin
|
||||
// service used to return, which reported a healthy certificate whatever
|
||||
// the process actually held.
|
||||
@@ -702,7 +698,6 @@ func runHealthcheck() {
|
||||
type dnsSpecSource struct {
|
||||
cfg config
|
||||
dkim *postgres.DkimRepository
|
||||
bimi *postgres.BimiRepository
|
||||
}
|
||||
|
||||
func (s *dnsSpecSource) ExpectedRecords(ctx context.Context, domain string) ([]entity.DnsRecord, error) {
|
||||
@@ -715,15 +710,6 @@ func (s *dnsSpecSource) ExpectedRecords(ctx context.Context, domain string) ([]e
|
||||
RelaySpfInclude: relayConfig(s.cfg).SpfInclude(),
|
||||
}
|
||||
|
||||
// The BIMI record is published only when a mark is actually stored, so
|
||||
// the panel never advertises a logo that would 404.
|
||||
if s.bimi != nil {
|
||||
if logo, err := s.bimi.Load(ctx, domain); err == nil && logo != nil {
|
||||
spec.BimiLogoURL = httppresentation.BimiLogoURL(s.cfg.PrimaryMailHost)
|
||||
spec.BimiVmcURL = logo.VmcURL
|
||||
}
|
||||
}
|
||||
|
||||
// Read rather than provisioned: verifying must not create keys as a side
|
||||
// effect of somebody opening a screen.
|
||||
if s.dkim != nil {
|
||||
|
||||
Reference in new issue
Block a user