This commit is contained in:
Evan Jarrett
2026-01-07 22:44:35 -06:00
parent 3409af6c67
commit ab7e7c7abc
4 changed files with 17 additions and 14 deletions
+3 -3
View File
@@ -84,10 +84,10 @@ type KnownHoldExport struct {
// CachedDataNote explains what cached data exists and how to access it
type CachedDataNote struct {
Message string `json:"message"`
DeletionNotice string `json:"deletion_notice"`
Message string `json:"message"`
DeletionNotice string `json:"deletion_notice"`
YourPDSCollections []string `json:"your_pds_collections"`
HowToAccess string `json:"how_to_access"`
HowToAccess string `json:"how_to_access"`
}
// ExportUserData gathers all user data for GDPR export
+7 -3
View File
@@ -83,7 +83,9 @@ func (h *SettingsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Parse permissions JSON if present
if hold.Permissions != "" {
json.Unmarshal([]byte(hold.Permissions), &display.Permissions)
if err := json.Unmarshal([]byte(hold.Permissions), &display.Permissions); err != nil {
slog.Warn("Failed to parse permissions JSON", "component", "settings", "did", user.DID, "hold_did", hold.HoldDID, "error", err)
}
}
// Add to data map for JavaScript
@@ -221,11 +223,13 @@ func (h *UpdateDefaultHoldHandler) ServeHTTP(w http.ResponseWriter, r *http.Requ
if !hasAccess {
w.Header().Set("Content-Type", "text/html")
h.Templates.ExecuteTemplate(w, "alert", map[string]string{
if err := h.Templates.ExecuteTemplate(w, "alert", map[string]string{
"Class": "error",
"Icon": "alert-circle",
"Message": "You don't have access to this hold",
})
}); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
return
}
}
-1
View File
@@ -217,7 +217,6 @@ func getEnvOrDefault(key, defaultValue string) string {
return defaultValue
}
// RequestCrawl sends a crawl request to the ATProto relay for the given hostname.
// This makes the hold's PDS discoverable by the relay network.
func RequestCrawl(relayEndpoint, publicURL string) error {
+7 -7
View File
@@ -1497,13 +1497,13 @@ func (h *XRPCHandler) HandleGetQuota(w http.ResponseWriter, r *http.Request) {
// HoldUserDataExport represents the GDPR data export from a hold service
type HoldUserDataExport struct {
ExportedAt time.Time `json:"exported_at"`
HoldDID string `json:"hold_did"`
UserDID string `json:"user_did"`
IsCaptain bool `json:"is_captain"`
CrewRecord *CrewExport `json:"crew_record,omitempty"`
LayerRecords []LayerExport `json:"layer_records"`
StatsRecords []StatsExport `json:"stats_records"`
ExportedAt time.Time `json:"exported_at"`
HoldDID string `json:"hold_did"`
UserDID string `json:"user_did"`
IsCaptain bool `json:"is_captain"`
CrewRecord *CrewExport `json:"crew_record,omitempty"`
LayerRecords []LayerExport `json:"layer_records"`
StatsRecords []StatsExport `json:"stats_records"`
}
// CrewExport represents a sanitized crew record for export