Cross Compile Go / build (push) Canceled after 0s
- embedded React admin UI at /admin/ui (go:embed), login with ADMIN_SECRET via signed HttpOnly session cookie, X-ADMIN-KEY still works for scripts - admin API: overview stats, indexing queue, addon management (priority, reindex, delete/restore/purge, bulk), whitelist CRUD, duplicate hashes, traffic, metrics explorer, services, events/audit log, system info - built-in metrics: request latency per route, visitors, top addons and searches, indexer/scraper counters; minute buckets in the DB with hourly rollups and retention; optional Prometheus /metrics (METRICS_TOKEN) - POST /back/telemetry for indexers/scrapers (metrics, events, heartbeat) and a stdlib-only Go client in telemetry/ - auth hardening: empty secrets no longer allow access, constant-time compare, CORS not applied to /admin and /back, TRUSTED_PROXIES setting - Dockerfile builds the UI and no longer bakes config.yaml into the image; CI builds the UI, runs tests and builds arm64 with CGO
35 lines
1.4 KiB
Go
35 lines
1.4 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Addon struct {
|
|
ID string `gorm:"primaryKey" json:"id"`
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
Summary string `json:"summary"`
|
|
Unlisted bool `json:"unlisted"`
|
|
Private bool `json:"private"`
|
|
Blocked bool `json:"blocked"`
|
|
SubscriberCount int `json:"subscriberCount"`
|
|
CurrentVersionNumber string `json:"currentVersionNumber"`
|
|
CurrentVersionSize int `json:"currentVersionSize"`
|
|
CurrentVersionID int `json:"currentVersionId"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index"`
|
|
ToBeIndexed bool `json:"toBeIndexed" gorm:"default:true"`
|
|
IsBeingIndexed bool `json:"isBeingIndexed" gorm:"default:false"`
|
|
IndexStartTime time.Time `json:"indexStartTime"`
|
|
PriorityIndexing bool `json:"priorityIndexing" gorm:"default:false"`
|
|
AddonFiles []AddonFile `json:"addonFiles"`
|
|
Recheck bool `json:"recheck" gorm:"default:false"`
|
|
LastIndexedAt *time.Time `json:"lastIndexedAt"`
|
|
|
|
Preview string `json:"preview"`
|
|
Author string `json:"author"`
|
|
}
|