about summary refs log tree commit diff
path: root/configuration.nix
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2022-08-13 22:33:38 +0300
committerVika <vika@fireburn.ru>2022-08-13 22:36:13 +0300
commit629531bdefad41e8839fa818e68bcf9a083466f8 (patch)
tree65c9bb8a5e51bcbadeded91e15b694482c075c21 /configuration.nix
parent8a6447c8aabb36ec4a8e66c61c058fbf36727802 (diff)
NixOS module fixes and temporary fixes to the legacy configuration
Diffstat (limited to 'configuration.nix')
-rw-r--r--configuration.nix30
1 files changed, 11 insertions, 19 deletions
diff --git a/configuration.nix b/configuration.nix
index 411b7b2..87759c8 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -45,7 +45,7 @@ in {
         description = ''
           Set the backend used for storing data. Available backends are:
            - file:// - static folder backend (recommended)
-           - redis:// - Redis backend
+           - redis:// - Redis backend (currently unavailable)
 
           Make sure that if you are using the file backend, the state
           directory is accessible by Kittybox. By default, the unit config
@@ -55,20 +55,15 @@ in {
           directory to reside elsewhere.
         '';
       };
-      tokenEndpoint = mkOption {
-        type = types.str;
-        example = "https://tokens.indieauth.com/token";
-        description = "Token endpoint to use for authenticating Micropub requests. Use the example if you are unsure.";
-      };
-      authorizationEndpoint = mkOption {
-        type = types.str;
-        example = "https://indieauth.com/auth";
-        description = "Authorization endpoint to use to authenticate the user. You can use the default if you are unsure.";
-      };
-      mediaEndpoint = mkOption {
+      blobstoreUri = mkOption {
         type = types.nullOr types.str;
-        default = null;
-        description = "The URL of a media endpoint to announce when asked by a Micropub client. Strongly recommended if you plan to upload images.";
+        default = "file:///var/lib/kittybox/media";
+        description = ''
+          Set the backend used for the media endpoint storage. Available options are:
+            - file:// - content-addressed storage using flat files (recommended)
+
+          When using the file backend, check notes in the `backendUri` option too.
+        '';
       };
       microsubServer = mkOption {
         type = types.nullOr types.str;
@@ -117,8 +112,7 @@ in {
 
       restartTriggers = [
         cfg.package
-        cfg.backendUri cfg.tokenEndpoint
-        cfg.authorizationEndpoint
+        cfg.backendUri cfg.blobstoreUri
         cfg.internalTokenFile
         cfg.bind cfg.port
         cfg.cookieSecretFile
@@ -126,13 +120,11 @@ in {
 
       environment = {
         SERVE_AT = "${cfg.bind}:${builtins.toString cfg.port}";
-        AUTHORIZATION_ENDPOINT = cfg.authorizationEndpoint;
-        TOKEN_ENDPOINT = cfg.tokenEndpoint;
-        MEDIA_ENDPOINT = cfg.mediaEndpoint;
         MICROSUB_ENDPOINT = cfg.microsubServer;
         WEBMENTION_ENDPOINT = cfg.webmentionEndpoint;
         #REDIS_URI = if (cfg.redisUri == null) then "redis://127.0.0.1:6379/" else cfg.redisUri;
         BACKEND_URI = cfg.backendUri;
+        BLOBSTORE_URI = cfg.blobstoreUri;
         RUST_LOG = "${cfg.logLevel}";
         COOKIE_SECRET_FILE = "${cfg.cookieSecretFile}";
       };