feat(storage): add native PostgreSQL runtime and verified offline application import
Build and publish container images / images (push) Failing after 12m29s

This commit is contained in:
Anya Tokugawa committed 2026-11-15 05:47:14 +09:00
1 parent 96065d1e89
commit 0ba1dcfef0
243 files changed
+21441 -3090

No files matched your search

+4 -12
View File
@@ -1,11 +1,11 @@
package server
import (
"context"
"encoding/base64"
"encoding/json"
"errors"
"net/http"
"path/filepath"
"strings"
"time"
@@ -36,14 +36,7 @@ func (s *Server) calendars() (*calendar.Repository, error) {
s.calendarErr = errors.New("calendar storage unavailable")
return
}
s.calendarRepo, s.calendarErr = calendar.New(filepath.Join(s.store.DocumentRoot, "calendars"), s.store.DB)
if s.calendarErr == nil {
s.calendarRepo.PublicAllowed = func(domain string) bool {
var allowed bool
err := s.store.DB.QueryRow(`SELECT EXISTS(SELECT 1 FROM locality_publication_policies p JOIN domains d ON d.uuid=p.domain_uuid AND d.enabled=1 JOIN config c ON c.domain_uuid=p.domain_uuid AND c.key='authorization_mode' AND c.value='enforcing' WHERE p.domain_uuid=? AND p.node_kind='domain' AND p.node_uuid=p.domain_uuid AND p.policy='public')`, domain).Scan(&allowed)
return err == nil && allowed
}
}
s.calendarRepo, s.calendarErr = s.store.NewCalendarRepository(context.Background())
})
return s.calendarRepo, s.calendarErr
}
@@ -316,9 +309,8 @@ func (s *Server) handleCalendarAPI(w http.ResponseWriter, r *http.Request) {
}
id = p.UUID
}
var count int
e := s.store.DB.QueryRowContext(r.Context(), `SELECT COUNT(*) FROM domain_memberships WHERE domain_uuid=? AND principal_uuid=? AND state='active'`, domain, id).Scan(&count)
if e != nil || count != 1 {
active, e := s.store.ActiveDomainMember(r.Context(), domain, id)
if e != nil || !active {
http.Error(w, "unknown collaborator", 400)
return
}