diff --git a/storage/filesystem.go b/storage/filesystem.go index bb5f2be..481f2d1 100644 --- a/storage/filesystem.go +++ b/storage/filesystem.go @@ -24,7 +24,7 @@ type filesystemBackend struct { var ( nilBackend carddav.Backend = (*filesystemBackend)(nil) - validFilenameRegex = regexp.MustCompile(`^/[A-Za-z0-9_-]+(.[a-zA-Z]+)?$`) + validFilenameRegex = regexp.MustCompile(`^/[A-Za-z0-9][A-Za-z0-9_-]+(.[a-zA-Z]+)?$`) ) func NewFilesystem(path string) (carddav.Backend, error) { @@ -153,7 +153,7 @@ func (b *filesystemBackend) AddressBook(ctx context.Context) (*carddav.AddressBo if err != nil { return nil, err } - path = filepath.Join(path, "default.json") + path = filepath.Join(path, "_default_ab.json") data, err := ioutil.ReadFile(path) if os.IsNotExist(err) {