about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--kittybox.1107
-rw-r--r--kittybox.nix13
2 files changed, 116 insertions, 4 deletions
diff --git a/kittybox.1 b/kittybox.1
new file mode 100644
index 0000000..403f1fe
--- /dev/null
+++ b/kittybox.1
@@ -0,0 +1,107 @@
+.TH KITTYBOX 1 "" https://kittybox.fireburn.ru/
+.SH NAME
+kittybox \- a CMS using IndieWeb technologies
+.SH SYNOPSIS
+.SY kittybox
+.YS
+
+.SH DESCRIPTION
+.P
+.B kittybox
+is a full-featured CMS for a personal website which is able to use various
+storage backends to store website content.
+
+It is most suitable for a personal blog, though it probably is capable of being
+used for other purposes.
+
+.SH ENVIRONMENT
+.PP
+\fI$BACKEND_URI\fR
+.RS 4
+The URI of the main storage backend to use. Available backends are:
+.TP
+.EX
+.B "postgres://<connection URI>"
+.EE
+Store website content in a Postgres database. Takes a connection URI.
+.TP
+.EX
+.B "file://<path to a folder>"
+.EE
+Store website content in a folder on the local filesystem.
+
+.B NOTE:
+This backend is not actively maintained and may not work as expected.
+It does not implement some advanced features and will probably not receive
+updates often.
+
+.RE
+.PP
+\fI$AUTHSTORE_URI\fR
+.RS 4
+The URI of the authentication backend to use.
+This backend is responsible for storing access tokens and short-lived
+authorization codes.
+Available backends are:
+.TP
+.EX
+.B "file://<path to a folder>"
+.EE
+Store authentication data in a folder on the filesystem.
+
+.RE
+.PP
+\fI$BLOBSTORE_URI\fR
+.RS 4
+The URI of the media store backend to use.
+This backend manages file uploads and storage of post attachments.
+
+Available backends are:
+.TP
+.EX
+.B "file://<path to a folder>"
+.EE
+Store file uploads in a content-addressed storage based on a folder. File
+contents are hashed using SHA-256, and the hash is used to construct the path.
+A small piece of metadata is stored next to the file in JSON format.
+
+.RE
+.PP
+\fI$JOB_QUEUE_URI\fR
+.RS 4
+The URI of the job queue backend to use.
+This backend is responsible for some background tasks, like receiving and
+validating Webmentions.
+Available backends are:
+.TP 4
+.EX
+.B "postgres://<connection URI>"
+.EE
+Use PostgreSQL as a job queue.
+This works better than one would expect.
+
+.RE
+.PP
+\fI$COOKIE_KEY\fR
+.RS 4
+A key for signing session cookies.
+This needs to be kept secret.
+.RE
+
+.SH STANDARDS
+
+Aaron Parecki, W3C,
+.UR https://www.w3.org/TR/micropub/
+\fIMicropub\fP
+.UE ","
+23 May 2017. W3C Recommendation.
+
+Aaron Parecki, IndieWeb community,
+.UR https://indieauth.spec.indieweb.org
+\fIIndieAuth\fP
+.UE ","
+11 July 2024. Living Standard.
+
+.SH SEE ALSO
+
+.MR postgres 1
diff --git a/kittybox.nix b/kittybox.nix
index b078c93..1b591f3 100644
--- a/kittybox.nix
+++ b/kittybox.nix
@@ -1,4 +1,4 @@
-{ crane, lib, nodePackages
+{ crane, lib, installShellFiles, nodePackages
 , useWebAuthn ? false, openssl, zlib, pkg-config, protobuf
 , usePostgres ? true, postgresql, postgresqlTestHook
 , nixosTests }:
@@ -9,7 +9,7 @@ assert usePostgres -> postgresql != null && postgresqlTestHook != null;
 let
   featureMatrix = features: lib.concatStringsSep " " (lib.attrNames (lib.filterAttrs (k: v: v) features));
 
-  suffixes = [ ".sql" ".ts" ".css" ".html" ".json" ".woff2" ];
+  suffixes = [ ".sql" ".ts" ".css" ".html" ".json" ".woff2" ".1" ];
   suffixFilter = suffixes: name: type:
       let base = baseNameOf (toString name);
       in type == "directory" || lib.any (ext: lib.hasSuffix ext base) suffixes;
@@ -34,7 +34,8 @@ let
     cargoExtraArgs = cargoFeatures;
 
     buildInputs = lib.optional useWebAuthn openssl;
-    nativeBuildInputs = [ nodePackages.typescript ] ++ (lib.optional useWebAuthn pkg-config);
+    nativeBuildInputs = [ nodePackages.typescript installShellFiles ]
+    ++ (lib.optional useWebAuthn pkg-config);
 
     meta = with lib.meta; {
       maintainers = with lib.maintainers; [ vikanezrimaya ];
@@ -50,13 +51,17 @@ in crane.buildPackage (args' // {
   nativeCheckInputs = lib.optionals usePostgres [
     postgresql postgresqlTestHook
   ];
-  
+
   # Tests create arbitrary databases; we need to be prepared for that
   postgresqlTestUserOptions = "LOGIN SUPERUSER";
   postgresqlTestSetupPost = ''
     export DATABASE_URL="postgres://localhost?host=$PGHOST&user=$PGUSER&dbname=$PGDATABASE"
   '';
 
+  postInstall = ''
+    installManPage ./kittybox.1
+  '';
+
   passthru = {
     tests = nixosTests;
     hasPostgres = usePostgres;