This is the main Perkeep server.
Run `perkeepd --help` for server options, or `perkeepd admin --help` for
administrative commands. Server options belong to the daemon invocation;
administrative commands have separate flags, after the command name.
`perkeepd admin dumpconfig [configfile]` replaces `pk dumpconfig`. It prints
an existing high- or low-level server configuration as low-level JSON,
without starting the daemon, opening its storage, or generating a missing
configuration. The default is server-config.json in the Perkeep configuration
directory (overridable with CAMLI_CONFIG_DIR). Explicit relative paths,
whether positional or supplied with `--configfile=FILE`, resolve from the
working directory, unlike the daemon's `--configfile` flag.
Use `perkeepd admin dumpconfig --help` for details.
The dump is not redacted: protect the output as you would the configuration.
High-level configuration expansion retains its existing behavior, including
creating cache directories; it does not install handlers or launch apps.
`perkeepd admin googinit --type=cloud` (or `--type=drive`) replaces
`pk googinit`. It prompts for the OAuth client ID, client secret, and
authorization code, then prints the existing credential/configuration
output without starting the daemon or writing a server configuration.
Protect this output: it contains the client secret and refresh token.
Use `perkeepd admin googinit --help` for details.
`perkeepd admin dbinit` replaces `pk dbinit` for offline index-database
setup. Select `--dbtype=mysql` (the default), `--dbtype=postgres`, or
`--dbtype=sqlite`, and supply `--dbname=NAME` (a filename for SQLite).
MySQL/PostgreSQL connection options remain `--user`, `--password`, `--host`,
and PostgreSQL's `--sslmode`. This command does not read or generate a
server configuration or start the daemon.
Stop the server before using `--wipe`: it destroys the existing index
database and recreates its schema. Without `--wipe`, an existing database
is refused. With `--ignoreexists`, an existing database is left unchanged,
even if `--wipe` is also specified. Explicit SQLite filenames resolve from
the working directory. Use `perkeepd admin dbinit --help` for details.
`perkeepd admin copy-storage --dst-config=FILE PREFIX` copies blobs missing
from the destination storage, using storage definitions from server
configurations. `--src-config=FILE` selects the source configuration (the
default is server-config.json in the Perkeep configuration directory);
`--dst-prefix=PREFIX` selects a different destination prefix. Explicit
relative configuration paths resolve from the working directory.
Stop the server before copying: both processes may use the same local files.
This command opens the selected storage without starting the daemon or
generating a missing configuration. Existing high-level configuration
expansion can still create cache directories.
Use `--n` for a dry run and `--limit=N` to sample the first N source blobs;
`--workers=N` controls copy concurrency. The command lists only the source,
stats its blobs in the destination, and verifies each copied blob's digest.
It does not remove blobs from the source. Both `pk copy-storage` and the
small `pk-copy-storage` shell wrapper delegate to this administrative
command, rather than carrying another copy of the storage backends.
The command accepts `--verbose` for compatibility but ignores it, as the
old standalone command did. Use `perkeepd admin copy-storage --help` for
details and an example.
Like the other administrative commands, it exits with status 0 for success
or help, 1 for an operation error, and 2 for invalid arguments. Both wrappers
relay these statuses unchanged.
`perkeepd admin reindex-diskpacked [--overwrite] [path]` replaces
`pk reindex-diskpacked`. It reads the default server configuration and
checks its diskpacked store's index, or rebuilds entries with `--overwrite`.
An optional path must exactly match a configured diskpacked handler's path;
it selects that handler rather than opening an arbitrary directory.
Without a path, exactly one eligible handler must be configured.
The handler's `metaIndex` configuration is preserved.
Stop the server first. No unrelated handlers or applications are started,
and missing configurations are not generated. The existing index backend
is opened in both modes: opening can create or reset its index, even
without `--overwrite`. This is not a filesystem-read-only check.
High-level configuration expansion can also create cache directories.
Rebuilding updates entries found in pack files; it does not clear stale
index keys. Use `perkeepd admin reindex-diskpacked --help` for details.
See also:
- The storage interface is in <root>/pkg/blobserver
- The storage implementations are under that e.g. <root>/pkg/blobserver/localdisk
- The HTTP handlers are implemented in <root>/pkg/blobserver/handlers
- The UI code is in <root>/server/perkeepd/ui