Documentation
¶
Index ¶
- func CheckPassword(store *Store, password string) bool
- func IsSetup(store *Store) bool
- func SetPassword(store *Store, password string) error
- type BundleMeta
- type Config
- type Server
- type Store
- func (s *Store) AdminFilePath() string
- func (s *Store) Delete(id string) error
- func (s *Store) HasManifest() bool
- func (s *Store) Latest() (*BundleMeta, error)
- func (s *Store) List() ([]BundleMeta, error)
- func (s *Store) ManifestPath(id string) string
- func (s *Store) Save(manifest []byte, meta BundleMeta) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
CheckPassword verifies the given password against the stored admin password.
func SetPassword ¶
SetPassword encrypts a known plaintext with the given password and saves it. Returns an error if a password is already set.
Types ¶
type BundleMeta ¶
type BundleMeta struct {
ID string `json:"id"`
Name string `json:"name"`
Created string `json:"created"` // RFC 3339
Threshold int `json:"threshold"`
Total int `json:"total"`
ManifestSize int `json:"manifestSize"`
}
BundleMeta holds non-secret metadata about a stored manifest.
type Config ¶
type Config struct {
Host string
Port string
DataDir string
MaxManifestSize int // Maximum MANIFEST.age size in bytes
Version string
BuildDate string
}
Config holds the configuration for the server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements http.Handler for the self-hosted ReMemory web app.
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages bundle storage on the filesystem. Data directory layout:
<data-dir>/
admin.age # age-encrypted known plaintext (admin password verification)
bundles/
<uuid>/
meta.json # BundleMeta
MANIFEST.age # The encrypted archive
func NewStore ¶
NewStore creates a Store backed by the given directory. The directory is created if it doesn't exist.
func (*Store) AdminFilePath ¶
AdminFilePath returns the path to the admin.age password file.
func (*Store) HasManifest ¶
HasManifest returns true if at least one bundle exists.
func (*Store) Latest ¶
func (s *Store) Latest() (*BundleMeta, error)
Latest returns the metadata for the most recently created bundle, or nil if none exist.
func (*Store) List ¶
func (s *Store) List() ([]BundleMeta, error)
List returns metadata for all bundles, sorted by creation time (newest first).
func (*Store) ManifestPath ¶
ManifestPath returns the filesystem path to a bundle's MANIFEST.age.