From 629531bdefad41e8839fa818e68bcf9a083466f8 Mon Sep 17 00:00:00 2001 From: Vika Date: Sat, 13 Aug 2022 22:33:38 +0300 Subject: NixOS module fixes and temporary fixes to the legacy configuration --- configuration.nix | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'configuration.nix') 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}"; }; -- cgit 1.4.1