Caddy module to require at-proto authentication and restrict routes to DIDs
3

Configure Feed

Select the types of activity you want to include in your feed.

Fix db pathing issue

+10 -1
+2 -1
global.go
··· 2 2 3 3 import ( 4 4 "fmt" 5 + "path/filepath" 5 6 "strconv" 6 7 "time" 7 8 ··· 42 43 func (a *App) Provision(ctx caddy.Context) error { 43 44 // Defaults 44 45 if a.StoragePath == "" { 45 - a.StoragePath = "atproto.db" 46 + a.StoragePath = filepath.Join(caddy.AppDataDir(), "atproto.db") 46 47 } 47 48 48 49 // Initialize DB
+8
internal/db/db.go
··· 7 7 "encoding/hex" 8 8 "encoding/json" 9 9 "fmt" 10 + "os" 11 + "path/filepath" 10 12 "sync/atomic" 11 13 12 14 "github.com/bluesky-social/indigo/atproto/atcrypto" ··· 26 28 27 29 // NewStore initializes a new SQLite-backed storage. 28 30 func NewStore(path string) (*Store, error) { 31 + if dir := filepath.Dir(path); dir != "" && dir != "." { 32 + if err := os.MkdirAll(dir, 0755); err != nil { 33 + return nil, fmt.Errorf("failed to create directory for database: %w", err) 34 + } 35 + } 36 + 29 37 // Enable WAL mode for better concurrency 30 38 db, err := sql.Open("sqlite3", path+"?_journal_mode=WAL&_busy_timeout=5000") 31 39 if err != nil {